[PATCH] D49306: [SLC] Simplify pow(x, 0.25) to sqrt(sqrt(x))

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 08:59:43 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D49306#1184350, @evandro wrote:

> A specialized transcendental function is inherently faster than a generic one.  In the case of `cbrt()` this is measurable in popular benchmarks, like CPU2000 and CPU2006.


No disagreement there. I understand the motivation and would like to see this fixed too.

> I can see the appeal of converging particular cases back to one generic case in the middle end, but IMO it's the opposite way in the run time environment.  From this perspective, methinks that the case for an intrinsic of `cbrt()` is stronger than folding it into `pow()`.

I think we need a stronger argument to add another LLVM math intrinsic for cbrt(). Eg, what IR transforms/analysis would that intrinsic enable vs. something we could already do for llvm.pow(x, 0.33)? If there's no added value, then we should convert this to cbrt() in the backend.


https://reviews.llvm.org/D49306





More information about the llvm-commits mailing list