diff options
author | Anna Thomas <anna@azul.com> | 2017-07-06 18:39:26 +0000 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2017-07-06 18:39:26 +0000 |
commit | eb6d5d19508c5485aafb7f9a30dee819a3b64352 (patch) | |
tree | 2ccf4707d6ff4c66f1933a4ce8522d6e00f26667 /llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll | |
parent | 47c8f66997b6839e5fd59e4c4b73cebeba325f90 (diff) | |
download | bcm5719-llvm-eb6d5d19508c5485aafb7f9a30dee819a3b64352.tar.gz bcm5719-llvm-eb6d5d19508c5485aafb7f9a30dee819a3b64352.zip |
[LoopUnrollRuntime] Bailout when multiple exiting blocks to the unique latch exit block
Currently, we do not support multiple exiting blocks to the
latch exit block. However, this bailout wasn't triggered when we had a
unique exit block (which is the latch exit), with multiple exiting
blocks to that unique exit.
Moved the bailout so that it's triggered in both cases and added
testcase.
llvm-svn: 307291
Diffstat (limited to 'llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll')
-rw-r--r-- | llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll b/llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll index 1f31a133e34..5cff94906d8 100644 --- a/llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll +++ b/llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll @@ -184,6 +184,36 @@ for.exit2: ret i32 42 } +; FIXME: Support multiple exiting blocks to the unique exit block. +define void @unique_exit(i32 %arg) { +; CHECK-LABEL: unique_exit +; CHECK-NOT: .unr +; CHECK-NOT: .epil +entry: + %tmp = icmp sgt i32 undef, %arg + br i1 %tmp, label %preheader, label %returnblock + +preheader: ; preds = %entry + br label %header + +LoopExit: ; preds = %header, %latch + %tmp2.ph = phi i32 [ %tmp4, %header ], [ -1, %latch ] + br label %returnblock + +returnblock: ; preds = %LoopExit, %entry + %tmp2 = phi i32 [ -1, %entry ], [ %tmp2.ph, %LoopExit ] + ret void + +header: ; preds = %preheader, %latch + %tmp4 = phi i32 [ %inc, %latch ], [ %arg, %preheader ] + %inc = add nsw i32 %tmp4, 1 + br i1 true, label %LoopExit, label %latch + +latch: ; preds = %header + %cmp = icmp slt i32 %inc, undef + br i1 %cmp, label %header, label %LoopExit +} + ; two exiting and two exit blocks. ; the non-latch exiting block has duplicate edges to the non-latch exit block. define i64 @test5(i64 %trip, i64 %add, i1 %cond) { |