[llvm] [X86] Prefer AVX512 VPCMP against zero over splat(1) for sle/slt (PR #216716)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 07:55:35 PDT 2026


================
@@ -58455,17 +58479,22 @@ static SDValue combineSetCC(SDNode *N, SelectionDAG &DAG,
           CmpKnown.Zero.isSignBitSet() || CmpKnown.One.isSignBitSet();
     }
     if (CanMakeSigned || ISD::isSignedIntSetCC(CC)) {
+      // AVX512 can encode LE/GE against zero; do not turn that into LT/GT
+      // vs ±1.
+      const bool KeepZeroCmp = Subtarget.hasAVX512() && VT.isVectorOf(MVT::i1);
----------------
RKSimon wrote:

(style) don't bother with constification
```suggestion
      bool KeepZeroCmp = Subtarget.hasAVX512() && VT.isVectorOf(MVT::i1);
```

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


More information about the llvm-commits mailing list