[llvm] [X86] Prefer sub-of-not for vector inc-of-add (PR #207695)
Rohan Shenoy via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 15 11:46:22 PDT 2026
================
@@ -60622,6 +60629,12 @@ static SDValue combineSub(SDNode *N, SelectionDAG &DAG,
return DAG.getNode(ISD::SUB, DL, VT, ADC.getValue(0), Op1.getOperand(0));
}
+ // Fold SUB(~A,~B) -> SUB(B,A)
+ if (isBitwiseNot(Op0) && Op0.hasOneUse() && isBitwiseNot(Op1) &&
+ Op1.hasOneUse()) {
----------------
222rohan wrote:
AFAIK as of now it only affects x86 path for this particular patch. Unsure if generic path would benefit, I will have to check
https://github.com/llvm/llvm-project/pull/207695
More information about the llvm-commits
mailing list