[PATCH] D51435: [SLC] Support expanding pow(x, n+0.5) to x * x * ... * sqrt(x)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 3 06:58:53 PDT 2018


fhahn added a comment.

In https://reviews.llvm.org/D51435#1219433, @spatel wrote:

> Comment + extra tests look good.
>
> Given the revert of https://reviews.llvm.org/D49273, make the getSqrtCall() diff an NFC commit ahead of this patch + generalize that for any libcall, so we make sure that we're not generating libcalls when we're not allowed to?


I had a look at other uses that could benefit from a general getSqrtCall, but I am not entirely sure what the scope of it should be. Also, for sqrt, we use the intrinsic when possible, and a lib call if it is available otherwise. But e.g. for the pow(2.0 ** n, x) -> exp2(n * x) transform we check if an exp2 lib func is available. If it is not, we also do not emit an intrinsic, even if it would be possible. Should the generic function behave similar to the exp2 behavior?


https://reviews.llvm.org/D51435





More information about the llvm-commits mailing list