[PATCH] D26855: New unsafe-fp-math implementation for X86 target

Andrew V. Tischenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 00:38:21 PST 2016


avt77 added a comment.

In https://reviews.llvm.org/D26855#608325, @spatel wrote:

> In https://reviews.llvm.org/D26855#606635, @avt77 wrote:
>
> > The new reciprocal implementation is done on more than 97%: we still don't have public tests but the code changes are almost completed. Please review and send me your comments.
>
>
> I applied the patch to trunk, but every example that I tried after that crashed:
>  Assertion failed: (i < getNumOperands() && "getOperand() out of range!"), function getOperand, file llvm/include/llvm/CodeGen/MachineInstr.h, line 280.
>
> Is it correct that this patch will allow us to remove 'fake' subtarget features like FeatureFastScalarFSQRT / FeatureFastVectorFSQRT ?


Sorry for crashes - it's a result of my last minute changes and missing of corresponding tests. Hope to fix it today-tomorrow. 
About FeatureFastScalarFSQRT / FeatureFastVectorFSQRT: I did not look at these features yet but it seems YES, we'll be able to remove them because the corresponding functionality should appear automatically. The idea of the patch: the throughput(latency) should be calculated automatically for every specific alternative code sequence (e.g. recip instead of div) but I did not check yet if it works at the moment. And we should check other similar features if they exist (FeatureFastLZCNT, etc.) Does it make sense?

BTW, I have a question:  this is the first patch in the possible series of patches. This patch introduces the the suggested approach on the example of FDiv - Recip implementation. Should I complete this patch with FDIV only or should I extend it with rsqrt? The patch is rather big that's why I suggest to make it really working with fdiv only and commit. After that I'll be able to make other similar patches faster and safely. Is it OK?


https://reviews.llvm.org/D26855





More information about the llvm-commits mailing list