mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
don't try to avoid inserting loads when lowering FORMAL_ARGUMENTS.
DAGCombine is now quite good at zapifying them. llvm-svn: 47053
This commit is contained in:
parent
c798882db7
commit
57f2088225
@ -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