[llvm] 9180b9f - [DAG] foldABSToABD - rename operand value types. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 07:45:02 PST 2023


Author: Simon Pilgrim
Date: 2023-11-15T15:44:35Z
New Revision: 9180b9f2be7d41fabbad2528bab52708b8f8e7d3

URL: https://github.com/llvm/llvm-project/commit/9180b9f2be7d41fabbad2528bab52708b8f8e7d3
DIFF: https://github.com/llvm/llvm-project/commit/9180b9f2be7d41fabbad2528bab52708b8f8e7d3.diff

LOG: [DAG] foldABSToABD - rename operand value types. NFC.

Match operand variable naming.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 6b29fbd7fe766fc..b32e630e8e48584 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -10917,15 +10917,15 @@ SDValue DAGCombiner::foldABSToABD(SDNode *N) {
     return SDValue();
   }
 
-  EVT VT1 = Op0.getOperand(0).getValueType();
-  EVT VT2 = Op1.getOperand(0).getValueType();
+  EVT VT0 = Op0.getOperand(0).getValueType();
+  EVT VT1 = Op1.getOperand(0).getValueType();
   unsigned ABDOpcode = (Opc0 == ISD::SIGN_EXTEND) ? ISD::ABDS : ISD::ABDU;
 
   // fold abs(sext(x) - sext(y)) -> zext(abds(x, y))
   // fold abs(zext(x) - zext(y)) -> zext(abdu(x, y))
-  EVT MaxVT = VT1.bitsGT(VT2) ? VT1 : VT2;
-  if ((VT1 == MaxVT || Op0->hasOneUse()) &&
-      (VT2 == MaxVT || Op1->hasOneUse()) && hasOperation(ABDOpcode, MaxVT)) {
+  EVT MaxVT = VT0.bitsGT(VT1) ? VT0 : VT1;
+  if ((VT0 == MaxVT || Op0->hasOneUse()) &&
+      (VT1 == MaxVT || Op1->hasOneUse()) && hasOperation(ABDOpcode, MaxVT)) {
     SDValue ABD = DAG.getNode(ABDOpcode, DL, MaxVT,
                               DAG.getNode(ISD::TRUNCATE, DL, MaxVT, Op0),
                               DAG.getNode(ISD::TRUNCATE, DL, MaxVT, Op1));


        


More information about the llvm-commits mailing list