[llvm] r360936 - [Tests] More consolidation of lftr tests

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 13:42:01 PDT 2019


Author: reames
Date: Thu May 16 13:42:00 2019
New Revision: 360936

URL: http://llvm.org/viewvc/llvm-project?rev=360936&view=rev
Log:
[Tests] More consolidation of lftr tests


Removed:
    llvm/trunk/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll
    llvm/trunk/test/Transforms/IndVarSimplify/lftr-other-uses.ll
Modified:
    llvm/trunk/test/Transforms/IndVarSimplify/lftr.ll

Removed: llvm/trunk/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll?rev=360935&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll (removed)
@@ -1,36 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -indvars -S | FileCheck %s
- at .str3 = private constant [6 x i8] c"%lld\0A\00", align 1
-declare i32 @printf(i8* noalias nocapture, ...) nounwind
-
-; PR13371: indvars pass incorrectly substitutes 'undef' values
-;
-; LFTR should not user %undef as the loop counter.
-define i64 @test() nounwind {
-; CHECK-LABEL: @test(
-; CHECK-NEXT:  func_start:
-; CHECK-NEXT:    br label [[BLOCK9:%.*]]
-; CHECK:       block9:
-; CHECK-NEXT:    [[UNDEF:%.*]] = phi i64 [ [[NEXT_UNDEF:%.*]], [[BLOCK9]] ], [ undef, [[FUNC_START:%.*]] ]
-; CHECK-NEXT:    [[ITER:%.*]] = phi i64 [ [[NEXT_ITER:%.*]], [[BLOCK9]] ], [ 1, [[FUNC_START]] ]
-; CHECK-NEXT:    [[NEXT_ITER]] = add nuw nsw i64 [[ITER]], 1
-; CHECK-NEXT:    [[TMP0:%.*]] = tail call i32 (i8*, ...) @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 [[NEXT_ITER]], i64 [[UNDEF]])
-; CHECK-NEXT:    [[NEXT_UNDEF]] = add nsw i64 [[UNDEF]], 1
-; CHECK-NEXT:    [[_TMP_3:%.*]] = icmp ult i64 [[NEXT_ITER]], 100
-; CHECK-NEXT:    br i1 [[_TMP_3]], label [[BLOCK9]], label [[EXIT:%.*]]
-; CHECK:       exit:
-; CHECK-NEXT:    ret i64 0
-;
-func_start:
-  br label %block9
-block9:                                           ; preds = %block9,%func_start
-  %undef = phi i64 [ %next_undef, %block9 ], [ undef, %func_start ]
-  %iter = phi i64 [ %next_iter, %block9 ], [ 1, %func_start ]
-  %next_iter = add nsw i64 %iter, 1
-  %0 = tail call i32 (i8*, ...) @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef)
-  %next_undef = add nsw i64 %undef, 1
-  %_tmp_3 = icmp slt i64 %next_iter, 100
-  br i1 %_tmp_3, label %block9, label %exit
-exit:                                             ; preds = %block9
-  ret i64 0
-}

Removed: llvm/trunk/test/Transforms/IndVarSimplify/lftr-other-uses.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/lftr-other-uses.ll?rev=360935&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/lftr-other-uses.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/lftr-other-uses.ll (removed)
@@ -1,37 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -indvars -S | FileCheck %s
-
-; Don't RAUW the loop's original comparison instruction if it has other uses
-; which aren't dominated by the new comparison instruction (which we insert
-; at the branch user).
-define void @use_before_branch() {
-; CHECK-LABEL: @use_before_branch(
-; CHECK-NEXT:  entry:
-; CHECK-NEXT:    br label [[LOOPENTRY_0:%.*]]
-; CHECK:       loopentry.0:
-; CHECK-NEXT:    [[MB_Y_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP_152:%.*]], [[LOOPENTRY_1:%.*]] ]
-; CHECK-NEXT:    [[TMP_14:%.*]] = icmp ule i32 [[MB_Y_0]], 3
-; CHECK-NEXT:    [[TMP_15:%.*]] = zext i1 [[TMP_14]] to i32
-; CHECK-NEXT:    br i1 [[TMP_14]], label [[LOOPENTRY_1]], label [[LOOPEXIT_0:%.*]]
-; CHECK:       loopentry.1:
-; CHECK-NEXT:    [[TMP_152]] = add nuw nsw i32 [[MB_Y_0]], 2
-; CHECK-NEXT:    br label [[LOOPENTRY_0]]
-; CHECK:       loopexit.0:
-; CHECK-NEXT:    unreachable
-;
-entry:
-  br label %loopentry.0
-
-loopentry.0:
-  %mb_y.0 = phi i32 [ 0, %entry ], [ %tmp.152, %loopentry.1 ]
-  %tmp.14 = icmp sle i32 %mb_y.0, 3
-  %tmp.15 = zext i1 %tmp.14 to i32
-  br i1 %tmp.14, label %loopentry.1, label %loopexit.0
-
-loopentry.1:
-  %tmp.152 = add i32 %mb_y.0, 2
-  br label %loopentry.0
-
-loopexit.0:		; preds = %loopentry.0
-  unreachable
-}

Modified: llvm/trunk/test/Transforms/IndVarSimplify/lftr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/lftr.ll?rev=360936&r1=360935&r2=360936&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/lftr.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/lftr.ll Thu May 16 13:42:00 2019
@@ -115,3 +115,72 @@ loop:
 exit:
   ret void
 }
+
+; Don't RAUW the loop's original comparison instruction if it has other uses
+; which aren't dominated by the new comparison instruction (which we insert
+; at the branch user).
+define void @use_before_branch() {
+; CHECK-LABEL: @use_before_branch(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    br label [[LOOPENTRY_0:%.*]]
+; CHECK:       loopentry.0:
+; CHECK-NEXT:    [[MB_Y_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP_152:%.*]], [[LOOPENTRY_1:%.*]] ]
+; CHECK-NEXT:    [[TMP_14:%.*]] = icmp ule i32 [[MB_Y_0]], 3
+; CHECK-NEXT:    br i1 [[TMP_14]], label [[LOOPENTRY_1]], label [[LOOPEXIT_0:%.*]]
+; CHECK:       loopentry.1:
+; CHECK-NEXT:    [[TMP_152]] = add nuw nsw i32 [[MB_Y_0]], 2
+; CHECK-NEXT:    br label [[LOOPENTRY_0]]
+; CHECK:       loopexit.0:
+; CHECK-NEXT:    unreachable
+;
+entry:
+  br label %loopentry.0
+
+loopentry.0:
+  %mb_y.0 = phi i32 [ 0, %entry ], [ %tmp.152, %loopentry.1 ]
+  %tmp.14 = icmp sle i32 %mb_y.0, 3
+  %tmp.15 = zext i1 %tmp.14 to i32
+  br i1 %tmp.14, label %loopentry.1, label %loopexit.0
+
+loopentry.1:
+  %tmp.152 = add i32 %mb_y.0, 2
+  br label %loopentry.0
+
+loopexit.0:		; preds = %loopentry.0
+  unreachable
+}
+
+ at .str3 = private constant [6 x i8] c"%lld\0A\00", align 1
+declare i32 @printf(i8* noalias nocapture, ...) nounwind
+
+; PR13371: indvars pass incorrectly substitutes 'undef' values
+;
+; LFTR should not user %undef as the loop counter.
+define i64 @no_undef_counter() nounwind {
+; CHECK-LABEL: @no_undef_counter(
+; CHECK-NEXT:  func_start:
+; CHECK-NEXT:    br label [[BLOCK9:%.*]]
+; CHECK:       block9:
+; CHECK-NEXT:    [[UNDEF:%.*]] = phi i64 [ [[NEXT_UNDEF:%.*]], [[BLOCK9]] ], [ undef, [[FUNC_START:%.*]] ]
+; CHECK-NEXT:    [[ITER:%.*]] = phi i64 [ [[NEXT_ITER:%.*]], [[BLOCK9]] ], [ 1, [[FUNC_START]] ]
+; CHECK-NEXT:    [[NEXT_ITER]] = add nuw nsw i64 [[ITER]], 1
+; CHECK-NEXT:    [[TMP0:%.*]] = tail call i32 (i8*, ...) @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 [[NEXT_ITER]], i64 [[UNDEF]])
+; CHECK-NEXT:    [[NEXT_UNDEF]] = add nsw i64 [[UNDEF]], 1
+; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[NEXT_ITER]], 100
+; CHECK-NEXT:    br i1 [[EXITCOND]], label [[BLOCK9]], label [[EXIT:%.*]]
+; CHECK:       exit:
+; CHECK-NEXT:    ret i64 0
+;
+func_start:
+  br label %block9
+block9:                                           ; preds = %block9,%func_start
+  %undef = phi i64 [ %next_undef, %block9 ], [ undef, %func_start ]
+  %iter = phi i64 [ %next_iter, %block9 ], [ 1, %func_start ]
+  %next_iter = add nsw i64 %iter, 1
+  %0 = tail call i32 (i8*, ...) @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef)
+  %next_undef = add nsw i64 %undef, 1
+  %_tmp_3 = icmp slt i64 %next_iter, 100
+  br i1 %_tmp_3, label %block9, label %exit
+exit:                                             ; preds = %block9
+  ret i64 0
+}




More information about the llvm-commits mailing list