From 09155ac290b0906ac8011c87ee43d7c7a2710387 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 26 Mar 2024 16:23:26 -0700 Subject: [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. --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 808e3c6..b1f6fd6 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( -- cgit v1.1