[PATCH] D91972: Improve STRICT_FSETCC codegen in absence of no NaN
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 9 00:08:38 PST 2021
thopre added a comment.
In D91972#2548536 <https://reviews.llvm.org/D91972#2548536>, @thopre wrote:
> In D91972#2548500 <https://reviews.llvm.org/D91972#2548500>, @SjoerdMeijer wrote:
>
>> In D91972#2548455 <https://reviews.llvm.org/D91972#2548455>, @thopre wrote:
>>
>>> Don't check for instruction nonan flag since there's none for constrained fcmp
>>
>> But that check seems useful for float instructions? In other words, can we keep the check for `FPMO->hasNoNaNs()`, but just add some new tests for that?
>
> Constrained FCmp instructions cannot be given fast-math flags in textual IR currently. I'm not sure if there's a way for the flag to be propagated from somewhere else. I'll try to dig a bit more. Bear with me
Constrained fcmp can have such flags since any FPMathOperation can have the NoNaN flag but I could not find a way to set it from looking at the code. There are no parameter attribute that would achieve it, no easy way to express it with llvm.assume and no obvious combine that would work. Since there's no way to test that code I think it's safer to leave it out. Worst case it's an optimisation that does not happen and we can patch it later.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91972/new/
https://reviews.llvm.org/D91972
More information about the llvm-commits
mailing list