[llvm] 09155ac - [LegalizeDAG] Remove unneeded temporary SDValues from PerformInsertVectorEltInMemory. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 16:30:47 PDT 2024


Author: Craig Topper
Date: 2024-03-26T16:25:24-07:00
New Revision: 09155ac290b0906ac8011c87ee43d7c7a2710387

URL: https://github.com/llvm/llvm-project/commit/09155ac290b0906ac8011c87ee43d7c7a2710387
DIFF: https://github.com/llvm/llvm-project/commit/09155ac290b0906ac8011c87ee43d7c7a2710387.diff

LOG: [LegalizeDAG] Remove unneeded temporary SDValues from PerformInsertVectorEltInMemory. NFC

There were 3 temporaries that just renamed the 3 well name arguments to the
function to Tmp1-3. Looks like this was done when the code was extracted from
elsewhere into a separate function 15 years ago.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 808e3c622033e0..b1f6fd6f3c7220 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -386,17 +386,13 @@ SDValue SelectionDAGLegalize::PerformInsertVectorEltInMemory(SDValue Vec,
                                                              SDValue Val,
                                                              SDValue Idx,
                                                              const SDLoc &dl) {
-  SDValue Tmp1 = Vec;
-  SDValue Tmp2 = Val;
-  SDValue Tmp3 = Idx;
-
   // If the target doesn't support this, we have to spill the input vector
   // to a temporary stack slot, update the element, then reload it.  This is
   // badness.  We could also load the value into a vector register (either
   // with a "move to register" or "extload into register" instruction, then
   // permute it into place, if the idx is a constant and if the idx is
   // supported by the target.
-  EVT VT    = Tmp1.getValueType();
+  EVT VT    = Vec.getValueType();
   EVT EltVT = VT.getVectorElementType();
   SDValue StackPtr = DAG.CreateStackTemporary(VT);
 
@@ -404,14 +400,14 @@ SDValue SelectionDAGLegalize::PerformInsertVectorEltInMemory(SDValue Vec,
 
   // Store the vector.
   SDValue Ch = DAG.getStore(
-      DAG.getEntryNode(), dl, Tmp1, StackPtr,
+      DAG.getEntryNode(), dl, Vec, StackPtr,
       MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SPFI));
 
-  SDValue StackPtr2 = TLI.getVectorElementPointer(DAG, StackPtr, VT, Tmp3);
+  SDValue StackPtr2 = TLI.getVectorElementPointer(DAG, StackPtr, VT, Idx);
 
   // Store the scalar value.
   Ch = DAG.getTruncStore(
-      Ch, dl, Tmp2, StackPtr2,
+      Ch, dl, Val, StackPtr2,
       MachinePointerInfo::getUnknownStack(DAG.getMachineFunction()), EltVT);
   // Load the updated vector.
   return DAG.getLoad(VT, dl, Ch, StackPtr, MachinePointerInfo::getFixedStack(


        


More information about the llvm-commits mailing list