mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-29 15:17:14 +00:00
Use getZExtOrTrunc helper instead of manually doing zext/trunc check. NFC.
The code here was doing exactly what is already in getZExtOrTrunc(). Just use that method instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242260 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -599,8 +599,7 @@ PerformInsertVectorEltInMemory(SDValue Vec, SDValue Val, SDValue Idx,
|
|||||||
false, false, 0);
|
false, false, 0);
|
||||||
|
|
||||||
// Truncate or zero extend offset to target pointer type.
|
// Truncate or zero extend offset to target pointer type.
|
||||||
unsigned CastOpc = IdxVT.bitsGT(PtrVT) ? ISD::TRUNCATE : ISD::ZERO_EXTEND;
|
Tmp3 = DAG.getZExtOrTrunc(Tmp3, dl, PtrVT);
|
||||||
Tmp3 = DAG.getNode(CastOpc, dl, PtrVT, Tmp3);
|
|
||||||
// Add the offset to the index.
|
// Add the offset to the index.
|
||||||
unsigned EltSize = EltVT.getSizeInBits()/8;
|
unsigned EltSize = EltVT.getSizeInBits()/8;
|
||||||
Tmp3 = DAG.getNode(ISD::MUL, dl, IdxVT, Tmp3,
|
Tmp3 = DAG.getNode(ISD::MUL, dl, IdxVT, Tmp3,
|
||||||
|
@@ -1852,8 +1852,7 @@ SDValue SelectionDAG::getShiftAmountOperand(EVT LHSTy, SDValue Op) {
|
|||||||
EVT ShTy = TLI->getShiftAmountTy(LHSTy, getDataLayout());
|
EVT ShTy = TLI->getShiftAmountTy(LHSTy, getDataLayout());
|
||||||
if (OpTy == ShTy || OpTy.isVector()) return Op;
|
if (OpTy == ShTy || OpTy.isVector()) return Op;
|
||||||
|
|
||||||
ISD::NodeType Opcode = OpTy.bitsGT(ShTy) ? ISD::TRUNCATE : ISD::ZERO_EXTEND;
|
return getZExtOrTrunc(Op, SDLoc(Op), ShTy);
|
||||||
return getNode(Opcode, SDLoc(Op), ShTy, Op);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CreateStackTemporary - Create a stack temporary, suitable for holding the
|
/// CreateStackTemporary - Create a stack temporary, suitable for holding the
|
||||||
|
Reference in New Issue
Block a user