mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
don't try to avoid inserting loads when lowering FORMAL_ARGUMENTS.
DAGCombine is now quite good at zapifying them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47053 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fec42eb6da
commit
9f72d1a730
@ -954,22 +954,15 @@ static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG &DAG,
|
||||
NumGPRs += ObjGPRs;
|
||||
|
||||
if (ObjSize) {
|
||||
// If the argument is actually used, emit a load from the right stack
|
||||
// slot.
|
||||
if (!Op.Val->hasNUsesOfValue(0, ArgNo)) {
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
int FI = MFI->CreateFixedObject(ObjSize, ArgOffset);
|
||||
SDOperand FIN = DAG.getFrameIndex(FI, MVT::i32);
|
||||
if (ObjGPRs == 0)
|
||||
ArgValue = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
|
||||
else {
|
||||
SDOperand ArgValue2 = DAG.getLoad(MVT::i32, Root, FIN, NULL, 0);
|
||||
assert(ObjectVT != MVT::i64 && "i64 should already be lowered");
|
||||
ArgValue = DAG.getNode(ARMISD::FMDRR, MVT::f64, ArgValue, ArgValue2);
|
||||
}
|
||||
} else {
|
||||
// Don't emit a dead load.
|
||||
ArgValue = DAG.getNode(ISD::UNDEF, ObjectVT);
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
int FI = MFI->CreateFixedObject(ObjSize, ArgOffset);
|
||||
SDOperand FIN = DAG.getFrameIndex(FI, MVT::i32);
|
||||
if (ObjGPRs == 0)
|
||||
ArgValue = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
|
||||
else {
|
||||
SDOperand ArgValue2 = DAG.getLoad(MVT::i32, Root, FIN, NULL, 0);
|
||||
assert(ObjectVT != MVT::i64 && "i64 should already be lowered");
|
||||
ArgValue = DAG.getNode(ARMISD::FMDRR, MVT::f64, ArgValue, ArgValue2);
|
||||
}
|
||||
|
||||
ArgOffset += ObjSize; // Move on to the next argument.
|
||||
|
@ -1008,17 +1008,9 @@ LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG, int &VarArgsFrameIndex)
|
||||
// We need to load the argument to a virtual register if we determined above
|
||||
// that we ran out of physical registers of the appropriate type
|
||||
if (needsLoad) {
|
||||
// If the argument is actually used, emit a load from the right stack
|
||||
// slot.
|
||||
if (!Op.Val->hasNUsesOfValue(0, ArgNo)) {
|
||||
int FI = MFI->CreateFixedObject(ObjSize, ArgOffset);
|
||||
SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
|
||||
ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
|
||||
} else {
|
||||
// Don't emit a dead load.
|
||||
ArgVal = DAG.getNode(ISD::UNDEF, ObjectVT);
|
||||
}
|
||||
|
||||
int FI = MFI->CreateFixedObject(ObjSize, ArgOffset);
|
||||
SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
|
||||
ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
|
||||
ArgOffset += StackSlotSize;
|
||||
}
|
||||
|
||||
|
@ -1420,19 +1420,12 @@ static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG,
|
||||
}
|
||||
|
||||
// We need to load the argument to a virtual register if we determined above
|
||||
// that we ran out of physical registers of the appropriate type
|
||||
// that we ran out of physical registers of the appropriate type.
|
||||
if (needsLoad) {
|
||||
// If the argument is actually used, emit a load from the right stack
|
||||
// slot.
|
||||
if (!Op.Val->hasNUsesOfValue(0, ArgNo)) {
|
||||
int FI = MFI->CreateFixedObject(ObjSize,
|
||||
CurArgOffset + (ArgSize - ObjSize));
|
||||
SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
|
||||
ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
|
||||
} else {
|
||||
// Don't emit a dead load.
|
||||
ArgVal = DAG.getNode(ISD::UNDEF, ObjectVT);
|
||||
}
|
||||
int FI = MFI->CreateFixedObject(ObjSize,
|
||||
CurArgOffset + (ArgSize - ObjSize));
|
||||
SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
|
||||
ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
|
||||
}
|
||||
|
||||
ArgValues.push_back(ArgVal);
|
||||
|
Loading…
Reference in New Issue
Block a user