Skip to content

Commit 09155ac

Browse files
committed
[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.
1 parent d312788 commit 09155ac

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,32 +386,28 @@ SDValue SelectionDAGLegalize::PerformInsertVectorEltInMemory(SDValue Vec,
386386
SDValue Val,
387387
SDValue Idx,
388388
const SDLoc &dl) {
389-
SDValue Tmp1 = Vec;
390-
SDValue Tmp2 = Val;
391-
SDValue Tmp3 = Idx;
392-
393389
// If the target doesn't support this, we have to spill the input vector
394390
// to a temporary stack slot, update the element, then reload it. This is
395391
// badness. We could also load the value into a vector register (either
396392
// with a "move to register" or "extload into register" instruction, then
397393
// permute it into place, if the idx is a constant and if the idx is
398394
// supported by the target.
399-
EVT VT = Tmp1.getValueType();
395+
EVT VT = Vec.getValueType();
400396
EVT EltVT = VT.getVectorElementType();
401397
SDValue StackPtr = DAG.CreateStackTemporary(VT);
402398

403399
int SPFI = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex();
404400

405401
// Store the vector.
406402
SDValue Ch = DAG.getStore(
407-
DAG.getEntryNode(), dl, Tmp1, StackPtr,
403+
DAG.getEntryNode(), dl, Vec, StackPtr,
408404
MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SPFI));
409405

410-
SDValue StackPtr2 = TLI.getVectorElementPointer(DAG, StackPtr, VT, Tmp3);
406+
SDValue StackPtr2 = TLI.getVectorElementPointer(DAG, StackPtr, VT, Idx);
411407

412408
// Store the scalar value.
413409
Ch = DAG.getTruncStore(
414-
Ch, dl, Tmp2, StackPtr2,
410+
Ch, dl, Val, StackPtr2,
415411
MachinePointerInfo::getUnknownStack(DAG.getMachineFunction()), EltVT);
416412
// Load the updated vector.
417413
return DAG.getLoad(VT, dl, Ch, StackPtr, MachinePointerInfo::getFixedStack(

0 commit comments

Comments
 (0)