[llvm] [X86] Prefer sub-of-not for vector inc-of-add (PR #207695)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 20 04:23:53 PDT 2026
================
@@ -3819,6 +3819,13 @@ unsigned X86TargetLowering::preferedOpcodeForCmpEqPiecesOfOperand(
return ISD::SRL;
}
+bool X86TargetLowering::preferIncOfAddToSubOfNot(EVT VT) const {
+ // Prefer inc-of-add for scalars and single-element vectors, and sub-of-not
+ // for multi-element vectors.
+ return VT.isScalarInteger() ||
+ (VT.isVector() && VT.getVectorElementCount().isScalar());
----------------
RKSimon wrote:
why the weird vector handling? x86 doesn't have any legal x1iX vector types
https://github.com/llvm/llvm-project/pull/207695
More information about the llvm-commits
mailing list