[PATCH] D50036: [SLC] Expand the simplification of pow(x, 0.5) to sqrt(x)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 06:27:22 PDT 2018


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/pow-sqrt.ll:8-9
 ;
-  %pow = call fast double @llvm.pow.f64(double %x, double 5.000000e-01)
-  ret double %pow
+  %pow = call fast float @llvm.pow.f32(float %x, float 5.0e-01)
+  ret float %pow
 }
----------------
Why change the data types?


================
Comment at: llvm/test/Transforms/InstCombine/pow-sqrt.ll:20
 ;
   %pow = call afn <2 x double> @llvm.pow.v2f64(<2 x double> %x, <2 x double> <double 5.0e-01, double 5.0e-01>)
   ret <2 x double> %pow
----------------
The minimal test for this case requires no FMF?


================
Comment at: llvm/test/Transforms/InstCombine/pow-sqrt.ll:30
 ;
-  %pow = call afn double @pow(double %x, double 5.0e-01)
-  ret double %pow
+  %pow = call ninf float @powf(float %x, float 5.0e-01)
+  ret float %pow
----------------
Why change the data types? Same question for the later tests - the types should be irrelevant to the change in functionality, right?

Please make any IR changes to the tests that are necessary to show off the improved/fixed functionality as a preliminary step to this review.


https://reviews.llvm.org/D50036





More information about the llvm-commits mailing list