[llvm] r346325 - [InstCombine] add tests for isnan(fabs(X)); NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 07:36:24 PST 2018


Author: spatel
Date: Wed Nov  7 07:36:23 2018
New Revision: 346325

URL: http://llvm.org/viewvc/llvm-project?rev=346325&view=rev
Log:
[InstCombine] add tests for isnan(fabs(X)); 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=346325&r1=346324&r2=346325&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/fcmp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/fcmp.ll Wed Nov  7 07:36:23 2018
@@ -296,6 +296,28 @@ define <2 x i1> @fabs_ueq(<2 x float> %a
   ret <2 x i1> %cmp
 }
 
+define <2 x i1> @fabs_ord(<2 x float> %a) {
+; CHECK-LABEL: @fabs_ord(
+; CHECK-NEXT:    [[CALL:%.*]] = call <2 x float> @llvm.fabs.v2f32(<2 x float> [[A:%.*]])
+; CHECK-NEXT:    [[CMP:%.*]] = fcmp arcp ord <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 arcp ord <2 x float> %call, zeroinitializer
+  ret <2 x i1> %cmp
+}
+
+define <2 x i1> @fabs_uno(<2 x float> %a) {
+; CHECK-LABEL: @fabs_uno(
+; CHECK-NEXT:    [[CALL:%.*]] = call <2 x float> @llvm.fabs.v2f32(<2 x float> [[A:%.*]])
+; CHECK-NEXT:    [[CMP:%.*]] = fcmp arcp uno <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 arcp uno <2 x float> %call, zeroinitializer
+  ret <2 x i1> %cmp
+}
+
 ; Don't crash.
 define i32 @test17(double %a, double (double)* %p) {
 ; CHECK-LABEL: @test17(




More information about the llvm-commits mailing list