[llvm] r363286 - [InstCombine] auto-generate complete test checks; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 11:14:50 PDT 2019


Author: spatel
Date: Thu Jun 13 11:14:49 2019
New Revision: 363286

URL: http://llvm.org/viewvc/llvm-project?rev=363286&view=rev
Log:
[InstCombine] auto-generate complete test checks; NFC

Modified:
    llvm/trunk/test/Transforms/InstCombine/sqrt.ll

Modified: llvm/trunk/test/Transforms/InstCombine/sqrt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/sqrt.ll?rev=363286&r1=363285&r2=363286&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/sqrt.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/sqrt.ll Thu Jun 13 11:14:49 2019
@@ -1,43 +1,41 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt -S -instcombine < %s | FileCheck %s
 
 define float @test1(float %x) nounwind readnone ssp {
-entry:
 ; CHECK-LABEL: @test1(
-; CHECK-NOT: fpext
-; CHECK-NOT: sqrt(
-; CHECK: sqrtf(
-; CHECK-NOT: fptrunc
-  %conv = fpext float %x to double                ; <double> [#uses=1]
-  %call = tail call double @sqrt(double %conv) readnone nounwind ; <double> [#uses=1]
-  %conv1 = fptrunc double %call to float          ; <float> [#uses=1]
-; CHECK: ret float
+; CHECK-NEXT:    [[SQRTF:%.*]] = call float @sqrtf(float [[X:%.*]]) #3
+; CHECK-NEXT:    ret float [[SQRTF]]
+;
+  %conv = fpext float %x to double
+  %call = tail call double @sqrt(double %conv) readnone nounwind
+  %conv1 = fptrunc double %call to float
   ret float %conv1
 }
 
 ; PR8096
+
 define float @test2(float %x) nounwind readnone ssp {
-entry:
 ; CHECK-LABEL: @test2(
-; CHECK-NOT: fpext
-; CHECK-NOT: sqrt(
-; CHECK: sqrtf(
-; CHECK-NOT: fptrunc
-  %conv = fpext float %x to double                ; <double> [#uses=1]
-  %call = tail call double @sqrt(double %conv) nounwind ; <double> [#uses=1]
-  %conv1 = fptrunc double %call to float          ; <float> [#uses=1]
-; CHECK: ret float
+; CHECK-NEXT:    [[SQRTF:%.*]] = call float @sqrtf(float [[X:%.*]]) #3
+; CHECK-NEXT:    ret float [[SQRTF]]
+;
+  %conv = fpext float %x to double
+  %call = tail call double @sqrt(double %conv) nounwind
+  %conv1 = fptrunc double %call to float
   ret float %conv1
 }
 
 ; rdar://9763193
 ; Can't fold (fptrunc (sqrt (fpext x))) -> (sqrtf x) since there is another
 ; use of sqrt result.
+
 define float @test3(float* %v) nounwind uwtable ssp {
-entry:
 ; CHECK-LABEL: @test3(
-; CHECK: sqrt(
-; CHECK-NOT: sqrtf(
-; CHECK: fptrunc
+; CHECK-NEXT:    [[CALL34:%.*]] = call double @sqrt(double 0x7FF8000000000000) #3
+; CHECK-NEXT:    [[CALL36:%.*]] = call i32 @foo(double [[CALL34]]) #4
+; CHECK-NEXT:    [[CONV38:%.*]] = fptrunc double [[CALL34]] to float
+; CHECK-NEXT:    ret float [[CONV38]]
+;
   %arrayidx13 = getelementptr inbounds float, float* %v, i64 2
   %tmp14 = load float, float* %arrayidx13
   %mul18 = fmul float %tmp14, %tmp14
@@ -50,5 +48,4 @@ entry:
 }
 
 declare i32 @foo(double)
-
 declare double @sqrt(double) readnone




More information about the llvm-commits mailing list