[llvm] r346323 - [InstCombine] add tests for more fcmp+fabs preds; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 7 07:27:02 PST 2018
Author: spatel
Date: Wed Nov 7 07:27:02 2018
New Revision: 346323
URL: http://llvm.org/viewvc/llvm-project?rev=346323&view=rev
Log:
[InstCombine] add tests for more fcmp+fabs preds; NFC
Modified:
llvm/trunk/test/Transforms/InstCombine/fcmp.ll
Modified: llvm/trunk/test/Transforms/InstCombine/fcmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/fcmp.ll?rev=346323&r1=346322&r2=346323&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/fcmp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/fcmp.ll Wed Nov 7 07:27:02 2018
@@ -197,6 +197,17 @@ define <2 x i1> @fabs_ole(<2 x float> %a
ret <2 x i1> %cmp
}
+define <2 x i1> @fabs_ule(<2 x float> %a) {
+; CHECK-LABEL: @fabs_ule(
+; CHECK-NEXT: [[CALL:%.*]] = call <2 x float> @llvm.fabs.v2f32(<2 x float> [[A:%.*]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ninf arcp ule <2 x float> [[CALL]], zeroinitializer
+; CHECK-NEXT: ret <2 x i1> [[CMP]]
+;
+ %call = call <2 x float> @llvm.fabs.v2f32(<2 x float> %a)
+ %cmp = fcmp ninf arcp ule <2 x float> %call, zeroinitializer
+ ret <2 x i1> %cmp
+}
+
define i1 @fabs_ogt(double %a) {
; CHECK-LABEL: @fabs_ogt(
; CHECK-NEXT: [[CMP:%.*]] = fcmp one double [[A:%.*]], 0.000000e+00
@@ -207,6 +218,17 @@ define i1 @fabs_ogt(double %a) {
ret i1 %cmp
}
+define i1 @fabs_ugt(double %a) {
+; CHECK-LABEL: @fabs_ugt(
+; CHECK-NEXT: [[CALL:%.*]] = call double @llvm.fabs.f64(double [[A:%.*]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp reassoc ninf ugt double [[CALL]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %call = call double @llvm.fabs.f64(double %a)
+ %cmp = fcmp ninf reassoc ugt double %call, 0.0
+ ret i1 %cmp
+}
+
define i1 @fabs_oge(double %a) {
; CHECK-LABEL: @fabs_oge(
; CHECK-NEXT: [[CMP:%.*]] = fcmp ord double [[A:%.*]], 0.000000e+00
More information about the llvm-commits
mailing list