[llvm-branch-commits] [llvm] [ConstantFolding] Non-constrained functions in strictfp (PR #190478)

James Y Knight via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Apr 6 13:19:36 PDT 2026


jyknight wrote:

> Non-constrained function calls, allowed in strictfp functions by PR188297, are equivalent to their constrained counterparts with dynamic rounding and strict exception handling

After thinking about this more, I don't think this is a good direction. It's not a necessary step towards converging non-constrained and constrained. Because, when they're converged,
1. we will need to be able to choose the rounding/exception-handling explicitly for each instruction, as we do with the existing constrained intrinsics.
2. then, we would want to control these foldings based on the actual policy set for each instruction, not based on the strictfp-ness of the containing function.

I believe an alternative design is preferable: these instructions should keep the current default policy of acting like the constrained intrinsics' "round.tonearest", "fpexcept.ignore", and the not-yet-explicitly-spellable "loose-sNaN-handling" mode. (Until we add support for changing those options on the non-constrained intrinsics, that "default" is the only choice.)

I _am_ in favor the idea of permitting the use of these in strictfp functions -- and preventing invalid reorderings. I just don't  them to become effectively round.dynamic/fpexcept.strict by doing so.

https://github.com/llvm/llvm-project/pull/190478


More information about the llvm-branch-commits mailing list