mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Use more getZExtOrTruncs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194945 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
91053d585a
commit
ca1b7799aa
@ -1432,11 +1432,7 @@ SDValue SelectionDAGLegalize::ExpandInsertToVectorThroughStack(SDValue Op) {
|
||||
|
||||
Idx = DAG.getNode(ISD::MUL, dl, Idx.getValueType(), Idx,
|
||||
DAG.getConstant(EltSize, Idx.getValueType()));
|
||||
|
||||
if (Idx.getValueType().bitsGT(TLI.getPointerTy()))
|
||||
Idx = DAG.getNode(ISD::TRUNCATE, dl, TLI.getPointerTy(), Idx);
|
||||
else
|
||||
Idx = DAG.getNode(ISD::ZERO_EXTEND, dl, TLI.getPointerTy(), Idx);
|
||||
Idx = DAG.getZExtOrTrunc(Idx, dl, TLI.getPointerTy());
|
||||
|
||||
SDValue SubStackPtr = DAG.getNode(ISD::ADD, dl, Idx.getValueType(), Idx,
|
||||
StackPtr);
|
||||
|
@ -988,10 +988,7 @@ SDValue DAGTypeLegalizer::GetVectorElementPointer(SDValue VecPtr, EVT EltVT,
|
||||
SDValue Index) {
|
||||
SDLoc dl(Index);
|
||||
// Make sure the index type is big enough to compute in.
|
||||
if (Index.getValueType().bitsGT(TLI.getPointerTy()))
|
||||
Index = DAG.getNode(ISD::TRUNCATE, dl, TLI.getPointerTy(), Index);
|
||||
else
|
||||
Index = DAG.getNode(ISD::ZERO_EXTEND, dl, TLI.getPointerTy(), Index);
|
||||
Index = DAG.getZExtOrTrunc(Index, dl, TLI.getPointerTy());
|
||||
|
||||
// Calculate the element offset and add it to the pointer.
|
||||
unsigned EltSize = EltVT.getSizeInBits() / 8; // FIXME: should be ABI size.
|
||||
|
Loading…
Reference in New Issue
Block a user