diff options
| author | Davide Italiano <davide@freebsd.org> | 2017-08-28 20:29:33 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2017-08-28 20:29:33 +0000 |
| commit | 20cb7e887f00b097b632b9732ea40710ba6a8bba (patch) | |
| tree | 5739601d3f9b85e3ab08fdd74c1cbb3f9dedf6a0 /llvm/test | |
| parent | 0f76a35c5e3c2585179e7787f046519ce241129d (diff) | |
| download | bcm5719-llvm-20cb7e887f00b097b632b9732ea40710ba6a8bba.tar.gz bcm5719-llvm-20cb7e887f00b097b632b9732ea40710ba6a8bba.zip | |
[LoopUnroll] Properly update loop structure in case of successful peeling.
When peeling kicks in, it updates the loop preheader.
Later, a successful full unroll of the loop needs to update a PHI
which i-th argument comes from the loop preheader, so it'd better look
at the correct block. Fixes PR33437.
Differential Revision: https://reviews.llvm.org/D37153
llvm-svn: 311922
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/LoopUnroll/pr33437.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopUnroll/pr33437.ll b/llvm/test/Transforms/LoopUnroll/pr33437.ll new file mode 100644 index 00000000000..58fa91f4b9a --- /dev/null +++ b/llvm/test/Transforms/LoopUnroll/pr33437.ll @@ -0,0 +1,30 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt -loop-unroll %s -S | FileCheck %s + +declare zeroext i8 @patatino() + +define fastcc void @tinky() { +; CHECK-LABEL: @tinky( +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[FOR_COND93:%.*]] +; CHECK: for.cond93: +; CHECK-NEXT: br label [[FOR_BODY198:%.*]] +; CHECK: for.body198: +; CHECK-NEXT: [[CALL593:%.*]] = tail call zeroext i8 @patatino() +; CHECK-NEXT: ret void +; +entry: + br label %for.cond93 + +for.cond93.loopexit: + ret void + +for.cond93: + br label %for.body198 + +for.body198: + %l_249.12 = phi i8 [ undef, %for.cond93 ], [ %call593, %for.body198 ] + %l_522.01 = phi i32 [ 0, %for.cond93 ], [ 1, %for.body198 ] + %call593 = tail call zeroext i8 @patatino() + br i1 false, label %for.body198, label %for.cond93.loopexit +} |

