[llvm] r364156 - [Tests] Autogen and improve test readability
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 23 10:13:53 PDT 2019
Author: reames
Date: Sun Jun 23 10:13:53 2019
New Revision: 364156
URL: http://llvm.org/viewvc/llvm-project?rev=364156&view=rev
Log:
[Tests] Autogen and improve test readability
Modified:
llvm/trunk/test/Transforms/IndVarSimplify/floating-point-iv.ll
Modified: llvm/trunk/test/Transforms/IndVarSimplify/floating-point-iv.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/floating-point-iv.ll?rev=364156&r1=364155&r2=364156&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/floating-point-iv.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/floating-point-iv.ll Sun Jun 23 10:13:53 2019
@@ -1,92 +1,141 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -indvars -S | FileCheck %s
+
define void @test1() nounwind {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[BB:%.*]]
+; CHECK: bb:
+; CHECK-NEXT: [[IV_INT:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[DOTINT:%.*]], [[BB]] ]
+; CHECK-NEXT: [[INDVAR_CONV:%.*]] = sitofp i32 [[IV_INT]] to double
+; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @foo(double [[INDVAR_CONV]]) #0
+; CHECK-NEXT: [[DOTINT]] = add nuw nsw i32 [[IV_INT]], 1
+; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[DOTINT]], 10000
+; CHECK-NEXT: br i1 [[TMP1]], label [[BB]], label [[RETURN:%.*]]
+; CHECK: return:
+; CHECK-NEXT: ret void
+;
entry:
- br label %bb
+ br label %bb
bb: ; preds = %bb, %entry
- %x.0.reg2mem.0 = phi double [ 0.000000e+00, %entry ], [ %1, %bb ] ; <double> [#uses=2]
- %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; <i32> [#uses=0]
- %1 = fadd double %x.0.reg2mem.0, 1.000000e+00 ; <double> [#uses=2]
- %2 = fcmp olt double %1, 1.000000e+04 ; <i1> [#uses=1]
- br i1 %2, label %bb, label %return
+ %iv = phi double [ 0.000000e+00, %entry ], [ %1, %bb ]
+ %0 = tail call i32 @foo(double %iv) nounwind
+ %1 = fadd double %iv, 1.000000e+00
+ %2 = fcmp olt double %1, 1.000000e+04
+ br i1 %2, label %bb, label %return
return: ; preds = %bb
- ret void
-; CHECK-LABEL: @test1(
-; CHECK: icmp
+ ret void
}
declare i32 @foo(double)
define void @test2() nounwind {
+; CHECK-LABEL: @test2(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[BB:%.*]]
+; CHECK: bb:
+; CHECK-NEXT: [[IV_INT:%.*]] = phi i32 [ -10, [[ENTRY:%.*]] ], [ [[DOTINT:%.*]], [[BB]] ]
+; CHECK-NEXT: [[INDVAR_CONV:%.*]] = sitofp i32 [[IV_INT]] to double
+; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @foo(double [[INDVAR_CONV]]) #0
+; CHECK-NEXT: [[DOTINT]] = add nsw i32 [[IV_INT]], 2
+; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[DOTINT]], -1
+; CHECK-NEXT: br i1 [[TMP1]], label [[BB]], label [[RETURN:%.*]]
+; CHECK: return:
+; CHECK-NEXT: ret void
+;
entry:
- br label %bb
+ br label %bb
bb: ; preds = %bb, %entry
- %x.0.reg2mem.0 = phi double [ -10.000000e+00, %entry ], [ %1, %bb ] ; <double> [#uses=2]
- %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; <i32> [#uses=0]
- %1 = fadd double %x.0.reg2mem.0, 2.000000e+00 ; <double> [#uses=2]
- %2 = fcmp olt double %1, -1.000000e+00 ; <i1> [#uses=1]
- br i1 %2, label %bb, label %return
+ %iv = phi double [ -10.000000e+00, %entry ], [ %1, %bb ]
+ %0 = tail call i32 @foo(double %iv) nounwind
+ %1 = fadd double %iv, 2.000000e+00
+ %2 = fcmp olt double %1, -1.000000e+00
+ br i1 %2, label %bb, label %return
return: ; preds = %bb
- ret void
-; CHECK-LABEL: @test2(
-; CHECK: icmp
+ ret void
}
define void @test3() nounwind {
+; CHECK-LABEL: @test3(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[BB:%.*]]
+; CHECK: bb:
+; CHECK-NEXT: [[IV:%.*]] = phi double [ 0.000000e+00, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[BB]] ]
+; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @foo(double [[IV]]) #0
+; CHECK-NEXT: [[TMP1]] = fadd double [[IV]], 1.000000e+00
+; CHECK-NEXT: br i1 false, label [[BB]], label [[RETURN:%.*]]
+; CHECK: return:
+; CHECK-NEXT: ret void
+;
entry:
- br label %bb
+ br label %bb
bb: ; preds = %bb, %entry
- %x.0.reg2mem.0 = phi double [ 0.000000e+00, %entry ], [ %1, %bb ]
- %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind
- %1 = fadd double %x.0.reg2mem.0, 1.000000e+00
- %2 = fcmp olt double %1, -1.000000e+00
- br i1 %2, label %bb, label %return
+ %iv = phi double [ 0.000000e+00, %entry ], [ %1, %bb ]
+ %0 = tail call i32 @foo(double %iv) nounwind
+ %1 = fadd double %iv, 1.000000e+00
+ %2 = fcmp olt double %1, -1.000000e+00
+ br i1 %2, label %bb, label %return
return:
- ret void
-; CHECK-LABEL: @test3(
-; CHECK: br i1 false
+ ret void
}
define void @test4() nounwind {
+; CHECK-LABEL: @test4(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[BB:%.*]]
+; CHECK: bb:
+; CHECK-NEXT: [[IV_INT:%.*]] = phi i32 [ 40, [[ENTRY:%.*]] ], [ [[DOTINT:%.*]], [[BB]] ]
+; CHECK-NEXT: [[INDVAR_CONV:%.*]] = sitofp i32 [[IV_INT]] to double
+; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @foo(double [[INDVAR_CONV]]) #0
+; CHECK-NEXT: [[DOTINT]] = add nsw i32 [[IV_INT]], -1
+; CHECK-NEXT: br i1 false, label [[BB]], label [[RETURN:%.*]]
+; CHECK: return:
+; CHECK-NEXT: ret void
+;
entry:
- br label %bb
+ br label %bb
bb: ; preds = %bb, %entry
- %x.0.reg2mem.0 = phi double [ 40.000000e+00, %entry ], [ %1, %bb ] ; <double> [#uses=2]
- %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; <i32> [#uses=0]
- %1 = fadd double %x.0.reg2mem.0, -1.000000e+00 ; <double> [#uses=2]
- %2 = fcmp olt double %1, 1.000000e+00 ; <i1> [#uses=1]
- br i1 %2, label %bb, label %return
+ %iv = phi double [ 40.000000e+00, %entry ], [ %1, %bb ]
+ %0 = tail call i32 @foo(double %iv) nounwind
+ %1 = fadd double %iv, -1.000000e+00
+ %2 = fcmp olt double %1, 1.000000e+00
+ br i1 %2, label %bb, label %return
return:
- ret void
-; CHECK-LABEL: @test4(
-; CHECK-NOT: cmp
-; CHECK: br i1 false
+ ret void
}
; PR6761
define void @test5() nounwind {
; <label>:0
+; CHECK-LABEL: @test5(
+; CHECK-NEXT: br label [[TMP1:%.*]]
+; CHECK: 1:
+; CHECK-NEXT: [[DOTINT:%.*]] = phi i32 [ 9, [[TMP0:%.*]] ], [ [[DOTINT1:%.*]], [[TMP1]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = tail call i32 @foo(double 0.000000e+00)
+; CHECK-NEXT: [[DOTINT1]] = add nsw i32 [[DOTINT]], -1
+; CHECK-NEXT: [[TMP3:%.*]] = icmp slt i32 [[DOTINT1]], 0
+; CHECK-NEXT: br i1 [[TMP3]], label [[EXIT:%.*]], label [[TMP1]]
+; CHECK: exit:
+; CHECK-NEXT: ret void
+;
br label %1
-; <label>:1 ; preds = %1, %0
- %2 = phi double [ 9.000000e+00, %0 ], [ %4, %1 ] ; <double> [#uses=1]
- %3 = tail call i32 @foo(double 0.0) ; <i32> [#uses=0]
- %4 = fadd double %2, -1.000000e+00 ; <double> [#uses=2]
- %5 = fcmp ult double %4, 0.000000e+00 ; <i1> [#uses=1]
+; <label>:1
+ %2 = phi double [ 9.000000e+00, %0 ], [ %4, %1 ]
+ %3 = tail call i32 @foo(double 0.0)
+ %4 = fadd double %2, -1.000000e+00
+ %5 = fcmp ult double %4, 0.000000e+00
br i1 %5, label %exit, label %1
exit:
ret void
-
-; CHECK-LABEL: @test5(
-; CHECK: icmp slt i32 {{.*}}, 0
-; CHECK-NEXT: br i1
}
More information about the llvm-commits
mailing list