[PATCH] D43142: Experimental pass to convert all floating point operations to the equivalent constrained intrinsics

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 2 11:49:22 PDT 2018


cameron.mcinally added a comment.

In https://reviews.llvm.org/D43142#1285708, @andrew.w.kaylor wrote:

> The fact that we have chosen to inline the function doesn't change the semantics.


I agree with this. Inlined or a call, it should be the same semantics.

> The only thing we need to worry about is making sure that FP operations don't migrate across calls or other FP operations that would break these semantics. Using the intrinsics after inlining takes care of that.

I don't agree with this. This is changing the semantics if we choose to inline a function by converting some operations into constrained intrinsics. In other words, an executable will have different behavior if we choose to inline or not. That's not ok.

We're in undefined behavior territory if the user doesn't explicitly reset the FP Env to the default when moving to a FENV_ACCESS=OFF function. If we treat the feenableexcept() and friends as barriers (which we must anyway), then we can feely inline (or call) a function as we wish with no change to semantics.


https://reviews.llvm.org/D43142





More information about the llvm-commits mailing list