[PATCH] D50036: [SLC] Expand the simplification of pow(x, 0.5) to sqrt(x)
Evandro Menezes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 14 08:41:20 PDT 2018
evandro added a comment.
I'll commit the data type changes increasing type diversity on the side.
================
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
}
----------------
spatel wrote:
> Why change the data types?
In order to increase test coverage. Otherwise, it virtually tested for `double` only.
================
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
----------------
spatel wrote:
> The minimal test for this case requires no FMF?
IIUC, not all of them, just AFN.
================
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
----------------
spatel wrote:
> 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.
Replacing AFN for NINF shows the improved functionality.
https://reviews.llvm.org/D50036
More information about the llvm-commits
mailing list