[PATCH] D28314: Change sqrt partial inlining to depend on sqrt argument rather than result.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 09:16:58 PST 2017


RKSimon added a comment.

In https://reviews.llvm.org/D28314#637005, @hfinkel wrote:

> In https://reviews.llvm.org/D28314#636863, @RKSimon wrote:
>
> > Would a TTI isFastMaterializeConstant be enough (similar to what we have in FastISel)?
>
>
> I think this depends on how heuristic we want to make this decision process. There are tradeoffs here with OOO processing, register pressure, etc. We might just want a dedicated TTI interface. This issue with the FP materialization seems just one of many factors. As I understand it, the issue here is giving the x86 processor more time to compute the branch condition (which is difficult to do through the sqrt instruction).


Yes avoiding unnecessary sqrtsd is my main interest, but similar issues have been found on other tickets: PR31510 (constant folding complex pow) also attempts the fast path and only then calls the lib func if any of the results are not finite - again testing the inputs may be more sensible.


https://reviews.llvm.org/D28314





More information about the llvm-commits mailing list