[PATCH] D50035: [SLC] Expand simplification of pow() for vector types

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 9 15:39:16 PDT 2018


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1171-1172
+  // Bail out if simplifying libcalls to pow() is disabled.
+  if (!hasUnaryFloatFn(TLI, Ty, LibFunc_pow, LibFunc_powf, LibFunc_powl))
+    return nullptr;
+
----------------
evandro wrote:
> spatel wrote:
> > Why do we need this check? In all of the affected transforms, we're not transforming *to* pow(). Is there a known bug without this check? Given that we have a pow intrinsic, I don't see the problem.
> Without this check, `pow()` would be simplified even with `-disable-simplify-libcalls` and `pow-3.ll` would fail.
No, that test still passes (we don't convert) because we check for the availability of sqrt() before trying the transform.

I suppose this raises a question: if -disable-simplify-libcalls is specified, should that preclude simplifications from LLVM intrinsics that mimic libcalls to other LLVM intrinsics that mimic libcalls?
...but that's probably best left to another patch or asked on llvm-dev.


https://reviews.llvm.org/D50035





More information about the llvm-commits mailing list