[PATCH] D137811: InstCombine: Perform basic isnan combines on llvm.is.fpclass
Serge Pavlov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 18 23:04:44 PST 2023
sepavloff added a comment.
In D137811#4063159 <https://reviews.llvm.org/D137811#4063159>, @efriedma wrote:
>> inlining may require conversion to a form that uses constrained intrinsics
>
> Functions which are not strictfp are allowed to introduce "spurious" fp flag writes; for example, we can flatten control flow that contains floating-point ops. Inlining the function doesn't change that general rule. The inliner converts fp operations just to ensure that later optimizations don't move those operations around.
"spurious" fp flag writes can appear only as a result of transformations, the source code provided to compiler does not have them. Compiler should avoid such transformation at early stages of IR pipeline, otherwise it produces program with incorrect semantics.
In D137811#4063200 <https://reviews.llvm.org/D137811#4063200>, @kpn wrote:
> In D137811#4063159 <https://reviews.llvm.org/D137811#4063159>, @efriedma wrote:
>
>>> inlining may require conversion to a form that uses constrained intrinsics
>>
>> Functions which are not strictfp are allowed to introduce "spurious" fp flag writes; for example, we can flatten control flow that contains floating-point ops. Inlining the function doesn't change that general rule. The inliner converts fp operations just to ensure that later optimizations don't move those operations around.
>
> I didn't think we had code in the tree to convert normal FP instructions into constrained intrinsics. Andy Kaylor had a ticket with code to do this, but I didn't think it ever went in. Where is this code used by the inliner?
Here it is: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Utils/CloneFunction.cpp#L390
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137811/new/
https://reviews.llvm.org/D137811
More information about the llvm-commits
mailing list