[llvm] [X86] Remove redundant and-not pattern code in X86 (PR #157687)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 8 08:44:01 PDT 2026


================
@@ -3638,29 +3638,23 @@ bool X86TargetLowering::isMaskAndCmp0FoldingBeneficial(
 }
 
 bool X86TargetLowering::hasAndNotCompare(SDValue Y) const {
-  EVT VT = Y.getValueType();
-
-  if (VT.isVector())
-    return false;
-
-  if (!Subtarget.hasBMI())
-    return false;
-
-  // There are only 32-bit and 64-bit forms for 'andn'.
-  if (VT != MVT::i32 && VT != MVT::i64)
-    return false;
-
-  return !isa<ConstantSDNode>(Y) || cast<ConstantSDNode>(Y)->isOpaque();
+  return Y.getValueType().isScalarInteger();
----------------
RKSimon wrote:

Please add a brief comment explaining this can be efficiently handled by NOT+TEST (or BMI ANDN)

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


More information about the llvm-commits mailing list