[InstSimplify] regenerate checks using a script
I didn't notice any significant changes in the actual checks here;
all of these tests already used FileCheck, so a script can batch
update them in one shot.
This commit is just to show the value of automating this process:
We have uniform formatting as opposed to a mish-mash of check
structure that changes based on individual prefs and the current
fashion. This makes it simpler to update when we find a bug or
make an enhancement.
llvm-svn: 264457
diff --git a/llvm/test/Transforms/InstSimplify/floating-point-compare.ll b/llvm/test/Transforms/InstSimplify/floating-point-compare.ll
index b148d99..7c67ffb 100644
--- a/llvm/test/Transforms/InstSimplify/floating-point-compare.ll
+++ b/llvm/test/Transforms/InstSimplify/floating-point-compare.ll
@@ -1,7 +1,8 @@
+; NOTE: Assertions have been autogenerated by update_test_checks.py
; RUN: opt < %s -instsimplify -S | FileCheck %s
; These tests choose arbitrarily between float and double,
-; and between uge and olt, to give reasonble coverage
+; and between uge and olt, to give reasonble coverage
; without combinatorial explosion.
declare float @llvm.fabs.f32(float)
@@ -15,8 +16,10 @@
declare void @expect_equal(i1,i1)
-; CHECK-LABEL: @orderedLessZeroTree(
define i1 @orderedLessZeroTree(float,float,float,float) {
+; CHECK-LABEL: @orderedLessZeroTree(
+; CHECK: ret i1 true
+;
%square = fmul float %0, %0
%abs = call float @llvm.fabs.f32(float %1)
%sqrt = call float @llvm.sqrt.f32(float %2)
@@ -25,30 +28,33 @@
%rem = frem float %sqrt, %fma
%add = fadd float %div, %rem
%uge = fcmp uge float %add, 0.000000e+00
-; CHECK: ret i1 true
ret i1 %uge
}
-; CHECK-LABEL: @orderedLessZeroExpExt(
define i1 @orderedLessZeroExpExt(float) {
+; CHECK-LABEL: @orderedLessZeroExpExt(
+; CHECK: ret i1 true
+;
%a = call float @llvm.exp.f32(float %0)
%b = fpext float %a to double
%uge = fcmp uge double %b, 0.000000e+00
-; CHECK: ret i1 true
ret i1 %uge
}
-; CHECK-LABEL: @orderedLessZeroExp2Trunc(
define i1 @orderedLessZeroExp2Trunc(double) {
+; CHECK-LABEL: @orderedLessZeroExp2Trunc(
+; CHECK: ret i1 false
+;
%a = call double @llvm.exp2.f64(double %0)
%b = fptrunc double %a to float
%olt = fcmp olt float %b, 0.000000e+00
-; CHECK: ret i1 false
ret i1 %olt
}
-; CHECK-LABEL: @orderedLessZeroPowi(
define i1 @orderedLessZeroPowi(double,double) {
+; CHECK-LABEL: @orderedLessZeroPowi(
+; CHECK: ret i1 false
+;
; Even constant exponent
%a = call double @llvm.powi.f64(double %0, i32 2)
%square = fmul double %1, %1
@@ -56,61 +62,64 @@
%b = call double @llvm.powi.f64(double %square, i32 3)
%c = fadd double %a, %b
%olt = fcmp olt double %b, 0.000000e+00
-; CHECK: ret i1 false
ret i1 %olt
}
-; CHECK-LABEL: @orderedLessZeroUIToFP(
define i1 @orderedLessZeroUIToFP(i32) {
+; CHECK-LABEL: @orderedLessZeroUIToFP(
+; CHECK: ret i1 true
+;
%a = uitofp i32 %0 to float
%uge = fcmp uge float %a, 0.000000e+00
-; CHECK: ret i1 true
ret i1 %uge
}
-; CHECK-LABEL: @orderedLessZeroSelect(
define i1 @orderedLessZeroSelect(float, float) {
+; CHECK-LABEL: @orderedLessZeroSelect(
+; CHECK: ret i1 true
+;
%a = call float @llvm.exp.f32(float %0)
%b = call float @llvm.fabs.f32(float %1)
%c = fcmp olt float %0, %1
%d = select i1 %c, float %a, float %b
%e = fadd float %d, 1.0
%uge = fcmp uge float %e, 0.000000e+00
-; CHECK: ret i1 true
ret i1 %uge
}
-; CHECK-LABEL: @orderedLessZeroMinNum(
define i1 @orderedLessZeroMinNum(float, float) {
+; CHECK-LABEL: @orderedLessZeroMinNum(
+; CHECK: ret i1 true
+;
%a = call float @llvm.exp.f32(float %0)
%b = call float @llvm.fabs.f32(float %1)
%c = call float @llvm.minnum.f32(float %a, float %b)
%uge = fcmp uge float %c, 0.000000e+00
-; CHECK: ret i1 true
ret i1 %uge
}
-; CHECK-LABEL: @orderedLessZeroMaxNum(
define i1 @orderedLessZeroMaxNum(float, float) {
+; CHECK-LABEL: @orderedLessZeroMaxNum(
+; CHECK: ret i1 true
+;
%a = call float @llvm.exp.f32(float %0)
%b = call float @llvm.maxnum.f32(float %a, float %1)
%uge = fcmp uge float %b, 0.000000e+00
-; CHECK: ret i1 true
ret i1 %uge
}
define i1 @nonans1(double %in1, double %in2) {
+; CHECK-LABEL: @nonans1(
+; CHECK: ret i1 false
+;
%cmp = fcmp nnan uno double %in1, %in2
ret i1 %cmp
-
-; CHECK-LABEL: @nonans1
-; CHECK-NEXT: ret i1 false
}
define i1 @nonans2(double %in1, double %in2) {
+; CHECK-LABEL: @nonans2(
+; CHECK: ret i1 true
+;
%cmp = fcmp nnan ord double %in1, %in2
ret i1 %cmp
-
-; CHECK-LABEL: @nonans2
-; CHECK-NEXT: ret i1 true
}