[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
Tue Jul 31 09:36:57 PDT 2018


spatel added a comment.

Why is this the right IR canonicalization?

We have a bug report requesting the opposite transform here:
https://bugs.llvm.org/show_bug.cgi?id=35600
...citing the case of a chain of many nested sqrt. If we're going to canonicalize the sequence with many sqrt() to pow() in IR, then we might as well do the same for sqrt(sqrt()) to be consistent. Then, we convert back to sqrt(sqrt()) as a special-case for pow(x, 0.25) in the backend because that's a perf win.


https://reviews.llvm.org/D49306





More information about the llvm-commits mailing list