forked from OSchip/llvm-project
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). llvm-svn: 282068
This commit is contained in:
parent
2506cb4ddb
commit
862758ec14
|
@ -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