[llvm-branch-commits] [llvm] [ConstantFolding] Non-constrained functions in strictfp (PR #190478)
Serge Pavlov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Apr 6 11:21:04 PDT 2026
================
@@ -2513,34 +2492,47 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
// Use internal versions of these intrinsics.
- if (IntrinsicID == Intrinsic::nearbyint || IntrinsicID == Intrinsic::rint ||
- IntrinsicID == Intrinsic::roundeven) {
----------------
spavloff wrote:
They have different reasons, why their constant evaluation is not possible in strictfp environment. For `rint` and `nearbyint` the primary reason is the rounding mode unknown at compile-time. `roundeven` does not depend on the rounding mode, it cannot be folded due to the signaling NaN. So the comment in the block `rint/nearbyint` is not pertinemt to `roundeven`.
https://github.com/llvm/llvm-project/pull/190478
More information about the llvm-branch-commits
mailing list