diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-10-27 19:48:28 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-10-27 19:48:28 +0000 |
| commit | 235acde953856a52b692cecf2c0484f2c30fdf43 (patch) | |
| tree | e151dfe8fcb7c1fd3b80c2099f04f12d7dd06d54 /llvm/test/Transforms/LoopStrengthReduce/funclet.ll | |
| parent | 0e631639be8c20dae7e8bf259c271ba97c825b0a (diff) | |
| download | bcm5719-llvm-235acde953856a52b692cecf2c0484f2c30fdf43.tar.gz bcm5719-llvm-235acde953856a52b692cecf2c0484f2c30fdf43.zip | |
[ScalarEvolutionExpander] PHI on a catchpad can be used on both edges
A PHI on a catchpad might be used by both edges out of the catchpad,
feeding back into a loop. In this case, just use the insertion point.
Anything more clever would require new basic blocks or PHI placement.
llvm-svn: 251442
Diffstat (limited to 'llvm/test/Transforms/LoopStrengthReduce/funclet.ll')
| -rw-r--r-- | llvm/test/Transforms/LoopStrengthReduce/funclet.ll | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopStrengthReduce/funclet.ll b/llvm/test/Transforms/LoopStrengthReduce/funclet.ll index 60bec76e7e6..ba2234f3105 100644 --- a/llvm/test/Transforms/LoopStrengthReduce/funclet.ll +++ b/llvm/test/Transforms/LoopStrengthReduce/funclet.ll @@ -146,3 +146,45 @@ iter: ; preds = %loop_body ; CHECK: blah2: ; CHECK-NEXT: ptrtoint i8* %phi2 to i32 + +define void @i() personality i32 (...)* @_except_handler3 { +entry: + br label %throw + +throw: ; preds = %throw, %entry + %tmp96 = getelementptr inbounds i8, i8* undef, i32 1 + invoke void @reserve() + to label %throw unwind label %catchpad + +catchpad: ; preds = %throw + %phi2 = phi i8* [ %tmp96, %throw ] + catchpad [] to label %cp_body unwind label %catchendpad + +cp_body: + br label %loop_head + +catchendpad: + catchendpad unwind label %cleanuppad + +cleanuppad: + cleanuppad [] + br label %loop_head + +loop_head: + br label %loop_body + +loop_body: ; preds = %iter, %catchpad + %tmp99 = phi i8* [ %tmp101, %iter ], [ %phi2, %loop_head ] + %tmp100 = icmp eq i8* %tmp99, undef + br i1 %tmp100, label %unwind_out, label %iter + +iter: ; preds = %loop_body + %tmp101 = getelementptr inbounds i8, i8* %tmp99, i32 1 + br i1 undef, label %unwind_out, label %loop_body + +unwind_out: ; preds = %iter, %loop_body + unreachable +} + +; CHECK-LABEL: define void @i( +; CHECK: ptrtoint i8* %phi2 to i32 |

