[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 12:17:18 PDT 2018


spatel added inline comments.


================
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
----------------
evandro wrote:
> spatel wrote:
> > evandro wrote:
> > > spatel wrote:
> > > > The minimal test for this case requires no FMF?
> > > IIUC, not all of them, just AFN.
> > 'afn' means this transform can diverge from the original code in some way, but I don't think that's true here. Ie, sqrt(x) should be the same as pow(x, 0.5) for all values other than -0.0 and -INFINITY.
> > Not sure if that is specified by any standard though? (cc @scanon)
> The test originally had AFN, so I aimed at preserving it.  
It's not obvious where the holes are in the existing code, so I added tests at:
rL339711
rL339713 (fix copy/paste errors)

If you want to vary the data types more in those tests, feel free. But I think that should provide coverage for everything that is changing in this patch based on FMF + libcall vs. intrinsic. Please rebase this patch with those tests.


https://reviews.llvm.org/D50036





More information about the llvm-commits mailing list