[llvm] [X86] - Prevent the wrong fold of x86_avx512_mask_cmp_ss/sd to fcmp (PR #202321)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 06:33:39 PDT 2026
================
@@ -2424,6 +2424,17 @@ X86TTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
case Intrinsic::x86_avx512_mask_cmp_sd: {
// These intrinsics only demand the 0th element of their input vectors. If
// we can simplify the input based on that, do so now.
+ //
+ // NOTE: Only operands 0 and 1 (the scalar-as-vector FP inputs) may be
+ // touched here. For the mask.cmp.ss/sd intrinsics, operand 2 is the
+ // comparison predicate (0..31) and operand 4 is the SAE/embedded-rounding
+ // control; both encode semantics that a plain fcmp cannot represent
+ // (signaling-vs-quiet predicates and FP-exception suppression). Do NOT add
----------------
phoebewang wrote:
I think it has the same problem as #200607. Signaling-vs-quiet predicates and FP-exception suppression are only useful under strictfp model. But target intrinsics are not covered by strictfp model so far.
https://github.com/llvm/llvm-project/pull/202321
More information about the llvm-commits
mailing list