[llvm] b54a663 - [LoopUnroll] Extend test case with additional loop with larger TC.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun May 17 05:56:30 PDT 2020
Author: Florian Hahn
Date: 2020-05-17T13:55:11+01:00
New Revision: b54a6633128f987b94869059ae85e922d4ed14a0
URL: https://github.com/llvm/llvm-project/commit/b54a6633128f987b94869059ae85e922d4ed14a0
DIFF: https://github.com/llvm/llvm-project/commit/b54a6633128f987b94869059ae85e922d4ed14a0.diff
LOG: [LoopUnroll] Extend test case with additional loop with larger TC.
Added:
Modified:
llvm/test/Transforms/LoopUnroll/pr33437.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LoopUnroll/pr33437.ll b/llvm/test/Transforms/LoopUnroll/pr33437.ll
index 210875b6ca42..55c17e062285 100644
--- a/llvm/test/Transforms/LoopUnroll/pr33437.ll
+++ b/llvm/test/Transforms/LoopUnroll/pr33437.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -loop-unroll -unroll-peel-count=1 < %s | FileCheck %s
+; RUN: opt -S -loop-unroll -unroll-count=4 -unroll-peel-count=1 < %s | FileCheck %s
declare zeroext i8 @patatino()
@@ -41,3 +41,59 @@ loop:
%call593 = tail call zeroext i8 @patatino()
br i1 false, label %loop, label %loopexit
}
+
+define void @tinky2() {
+; CHECK-LABEL: @tinky2(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[NEXT:%.*]]
+; CHECK: loopexit.loopexit:
+; CHECK-NEXT: br label [[LOOPEXIT:%.*]]
+; CHECK: loopexit:
+; CHECK-NEXT: ret void
+; CHECK: next:
+; CHECK-NEXT: br label [[LOOP_PEEL_BEGIN:%.*]]
+; CHECK: loop.peel.begin:
+; CHECK-NEXT: br label [[LOOP_PEEL:%.*]]
+; CHECK: loop.peel:
+; CHECK-NEXT: [[CALL593_PEEL:%.*]] = tail call zeroext i8 @patatino()
+; CHECK-NEXT: [[B_NEXT_PEEL:%.*]] = add i32 0, 1
+; CHECK-NEXT: [[COND_PEEL:%.*]] = icmp ne i32 0, 30
+; CHECK-NEXT: br i1 [[COND_PEEL]], label [[LOOP_PEEL_NEXT:%.*]], label [[LOOPEXIT]]
+; CHECK: loop.peel.next:
+; CHECK-NEXT: br label [[LOOP_PEEL_NEXT1:%.*]]
+; CHECK: loop.peel.next1:
+; CHECK-NEXT: br label [[NEXT_PEEL_NEWPH:%.*]]
+; CHECK: next.peel.newph:
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: [[B:%.*]] = phi i32 [ [[B_NEXT_PEEL]], [[NEXT_PEEL_NEWPH]] ], [ [[B_NEXT_3:%.*]], [[LOOP_2:%.*]] ]
+; CHECK-NEXT: [[CALL593:%.*]] = tail call zeroext i8 @patatino()
+; CHECK-NEXT: [[B_NEXT:%.*]] = add nuw nsw i32 [[B]], 1
+; CHECK-NEXT: [[CALL593_1:%.*]] = tail call zeroext i8 @patatino()
+; CHECK-NEXT: [[B_NEXT_1:%.*]] = add nuw nsw i32 [[B_NEXT]], 1
+; CHECK-NEXT: [[COND_1:%.*]] = icmp ne i32 [[B_NEXT]], 30
+; CHECK-NEXT: br i1 [[COND_1]], label [[LOOP_2]], label [[LOOPEXIT_LOOPEXIT:%.*]], !llvm.loop !0
+; CHECK: loop.2:
+; CHECK-NEXT: [[CALL593_2:%.*]] = tail call zeroext i8 @patatino()
+; CHECK-NEXT: [[B_NEXT_2:%.*]] = add nuw nsw i32 [[B_NEXT_1]], 1
+; CHECK-NEXT: [[CALL593_3:%.*]] = tail call zeroext i8 @patatino()
+; CHECK-NEXT: [[B_NEXT_3]] = add nuw nsw i32 [[B_NEXT_2]], 1
+; CHECK-NEXT: br label [[LOOP]], !llvm.loop !2
+;
+entry:
+ br label %next
+
+loopexit:
+ ret void
+
+next:
+ br label %loop
+
+loop:
+ %a = phi i8 [ undef, %next ], [ %call593, %loop ]
+ %b = phi i32 [ 0, %next ], [ %b.next, %loop ]
+ %call593 = tail call zeroext i8 @patatino()
+ %b.next = add i32 %b, 1
+ %cond = icmp ne i32 %b, 30
+ br i1 %cond, label %loop, label %loopexit
+}
More information about the llvm-commits
mailing list