[llvm] [ARM] Replace ABS and tABS machine nodes with custom lowering (PR #156717)

David Green via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 7 06:54:07 PDT 2025


================
@@ -20924,16 +20917,17 @@ static SDValue performNegCSelCombine(SDNode *N, SelectionDAG &DAG) {
   SDValue N0 = CSel.getOperand(0);
   SDValue N1 = CSel.getOperand(1);
 
-  // If both of them is not negations, it's not worth the folding as it
+  // If neither of them are negations, it's not worth the folding as it
   // introduces two additional negations while reducing one negation.
   if (!isNegatedInteger(N0) && !isNegatedInteger(N1))
     return SDValue();
 
-  SDValue N0N = getNegatedInteger(N0, DAG);
-  SDValue N1N = getNegatedInteger(N1, DAG);
-
   SDLoc DL(N);
   EVT VT = CSel.getValueType();
+
+  SDValue N0N = DAG.getNegative(N0, DL, VT);
+  SDValue N1N = DAG.getNegative(N1, DL, VT);
+
----------------
davemgreen wrote:

Can you send these changes in another patch?

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


More information about the llvm-commits mailing list