llvm-project/llvm/test/Transforms/CallSiteSplitting
Taewook Oh e0db533feb [CallSiteSplitting] Do not perform callsite splitting inside landing pad
Summary:
If the callsite is inside landing pad, do not perform callsite splitting.

Callsite splitting uses utility function llvm::DuplicateInstructionsInSplitBetween, which eventually calls llvm::SplitEdge. llvm::SplitEdge calls llvm::SplitCriticalEdge with an assumption that the function returns nullptr only when the target edge is not a critical edge (and further assumes that if the return value was not nullptr, the predecessor of the original target edge always has a single successor because critical edge splitting was successful). However, this assumtion is not true because SplitCriticalEdge returns nullptr if the destination block is a landing pad. This invalid assumption results assertion failure.

Fundamental solution might be fixing llvm::SplitEdge to not to rely on the invalid assumption. However, it'll involve a lot of work because current API assumes that llvm::SplitEdge never fails. Instead, this patch makes callsite splitting to not to attempt splitting if the callsite is in a landing pad.

Attached test case will crash with assertion failure without the fix.

Reviewers: fhahn, junbuml, dberlin

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D45130

llvm-svn: 329250
2018-04-05 04:16:23 +00:00
..
callsite-instructions-before-call.ll Recommit r325001: [CallSiteSplitting] Support splitting of blocks with instrs before call. 2018-02-14 13:59:12 +00:00
callsite-no-or-structure.ll Recommit r325001: [CallSiteSplitting] Support splitting of blocks with instrs before call. 2018-02-14 13:59:12 +00:00
callsite-no-splitting.ll [CallSiteSplitting] Fix infinite loop when recording conditions. 2018-01-26 10:36:50 +00:00
callsite-split-debug.ll Recommit r325001: [CallSiteSplitting] Support splitting of blocks with instrs before call. 2018-02-14 13:59:12 +00:00
callsite-split-or-phi.ll Recommit r325001: [CallSiteSplitting] Support splitting of blocks with instrs before call. 2018-02-14 13:59:12 +00:00
callsite-split.ll Recommit r325001: [CallSiteSplitting] Support splitting of blocks with instrs before call. 2018-02-14 13:59:12 +00:00
lpad.ll [CallSiteSplitting] Do not perform callsite splitting inside landing pad 2018-04-05 04:16:23 +00:00
musttail.ll [CallSiteSplitting] properly split musttail calls 2018-03-03 21:40:14 +00:00
split-loop.ll [CallSiteSplitting] Do not crash when BB's terminator changes. 2018-03-06 14:00:58 +00:00