diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-02-03 21:30:34 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-02-03 21:30:34 +0000 |
| commit | a53b5bbb184d02c6a8fa1fca8a5bafb2cf16195f (patch) | |
| tree | 2fbe01d560aba8930559e60e897cfe3dbeba32e7 /llvm/test/Transforms/LoopStrengthReduce | |
| parent | fa8681e45245be394a62fb1efae38f44d1884959 (diff) | |
| download | bcm5719-llvm-a53b5bbb184d02c6a8fa1fca8a5bafb2cf16195f.tar.gz bcm5719-llvm-a53b5bbb184d02c6a8fa1fca8a5bafb2cf16195f.zip | |
[LoopStrengthReduce] Don't rewrite PHIs with incoming values from CatchSwitches
Bail out if we have a PHI on an EHPad that gets a value from a
CatchSwitchInst. Because the CatchSwitchInst cannot be split, there is
no good place to stick any instructions.
This fixes PR26373.
llvm-svn: 259702
Diffstat (limited to 'llvm/test/Transforms/LoopStrengthReduce')
| -rw-r--r-- | llvm/test/Transforms/LoopStrengthReduce/funclet.ll | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopStrengthReduce/funclet.ll b/llvm/test/Transforms/LoopStrengthReduce/funclet.ll index 5d20646141c..1bee3706caf 100644 --- a/llvm/test/Transforms/LoopStrengthReduce/funclet.ll +++ b/llvm/test/Transforms/LoopStrengthReduce/funclet.ll @@ -214,3 +214,32 @@ try.cont.7: ; preds = %try.cont ; CHECK: catch.dispatch.2: ; CHECK: %e.0 = phi i32* [ %c, %try.cont ], [ %b, %catch.dispatch ] + +define i32 @test2() personality i32 (...)* @_except_handler3 { +entry: + br label %for.body + +for.body: ; preds = %for.inc, %entry + %phi = phi i32 [ %inc, %for.inc ], [ 0, %entry ] + invoke void @reserve() + to label %for.inc unwind label %catch.dispatch + +catch.dispatch: ; preds = %for.body + %tmp18 = catchswitch within none [label %catch.handler] unwind to caller + +catch.handler: ; preds = %catch.dispatch + %phi.lcssa = phi i32 [ %phi, %catch.dispatch ] + %tmp19 = catchpad within %tmp18 [i8* null] + catchret from %tmp19 to label %done + +done: + ret i32 %phi.lcssa + +for.inc: ; preds = %for.body + %inc = add i32 %phi, 1 + br label %for.body +} + +; CHECK-LABEL: define i32 @test2( +; CHECK: %phi.lcssa = phi i32 [ %phi, %catch.dispatch ] +; CHECK-NEXT: catchpad within |

