mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-01 15:40:53 +00:00
GlobalISel: pass Function to lowerFormalArguments directly (NFC).
The only implementation that exists immediately looks it up anyway, and the information is needed to handle various parameter attributes (stored on the function itself). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282068 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d5fca758fa
commit
d79f714b0b
@ -62,10 +62,9 @@ class CallLowering {
|
||||
/// lowering.
|
||||
///
|
||||
/// \return True if the lowering succeeded, false otherwise.
|
||||
virtual bool
|
||||
lowerFormalArguments(MachineIRBuilder &MIRBuilder,
|
||||
const Function::ArgumentListType &Args,
|
||||
ArrayRef<unsigned> VRegs) const {
|
||||
virtual bool lowerFormalArguments(MachineIRBuilder &MIRBuilder,
|
||||
const Function &F,
|
||||
ArrayRef<unsigned> VRegs) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -556,8 +556,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &MF) {
|
||||
SmallVector<unsigned, 8> VRegArgs;
|
||||
for (const Argument &Arg: F.args())
|
||||
VRegArgs.push_back(getOrCreateVReg(Arg));
|
||||
bool Succeeded =
|
||||
CLI->lowerFormalArguments(MIRBuilder, F.getArgumentList(), VRegArgs);
|
||||
bool Succeeded = CLI->lowerFormalArguments(MIRBuilder, F, VRegArgs);
|
||||
if (!Succeeded) {
|
||||
if (!TPC->isGlobalISelAbortEnabled()) {
|
||||
MIRBuilder.getMF().getProperties().set(
|
||||
|
@ -152,13 +152,13 @@ bool AArch64CallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AArch64CallLowering::lowerFormalArguments(
|
||||
MachineIRBuilder &MIRBuilder, const Function::ArgumentListType &Args,
|
||||
ArrayRef<unsigned> VRegs) const {
|
||||
bool AArch64CallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
|
||||
const Function &F,
|
||||
ArrayRef<unsigned> VRegs) const {
|
||||
auto &Args = F.getArgumentList();
|
||||
MachineFunction &MF = MIRBuilder.getMF();
|
||||
MachineBasicBlock &MBB = MIRBuilder.getMBB();
|
||||
MachineRegisterInfo &MRI = MF.getRegInfo();
|
||||
const Function &F = *MF.getFunction();
|
||||
auto &DL = F.getParent()->getDataLayout();
|
||||
|
||||
SmallVector<MachineInstr *, 8> Seqs;
|
||||
|
@ -30,8 +30,7 @@ class AArch64CallLowering: public CallLowering {
|
||||
bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
|
||||
unsigned VReg) const override;
|
||||
|
||||
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder,
|
||||
const Function::ArgumentListType &Args,
|
||||
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
|
||||
ArrayRef<unsigned> VRegs) const override;
|
||||
|
||||
bool lowerCall(MachineIRBuilder &MIRBuilder, const MachineOperand &Callee,
|
||||
|
@ -34,9 +34,9 @@ bool AMDGPUCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AMDGPUCallLowering::lowerFormalArguments(
|
||||
MachineIRBuilder &MIRBuilder, const Function::ArgumentListType &Args,
|
||||
ArrayRef<unsigned> VRegs) const {
|
||||
bool AMDGPUCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
|
||||
const Function &F,
|
||||
ArrayRef<unsigned> VRegs) const {
|
||||
// TODO: Implement once there are generic loads/stores.
|
||||
return true;
|
||||
}
|
||||
|
@ -27,10 +27,8 @@ class AMDGPUCallLowering: public CallLowering {
|
||||
|
||||
bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
|
||||
unsigned VReg) const override;
|
||||
bool
|
||||
lowerFormalArguments(MachineIRBuilder &MIRBuilder,
|
||||
const Function::ArgumentListType &Args,
|
||||
ArrayRef<unsigned> VRegs) const override;
|
||||
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
|
||||
ArrayRef<unsigned> VRegs) const override;
|
||||
};
|
||||
} // End of namespace llvm;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user