llvm.org GIT mirror llvm / d79f714
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 Tim Northover 4 years ago
6 changed file(s) with 14 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
6161 /// lowering.
6262 ///
6363 /// \return True if the lowering succeeded, false otherwise.
64 virtual bool
65 lowerFormalArguments(MachineIRBuilder &MIRBuilder,
66 const Function::ArgumentListType &Args,
67 ArrayRef VRegs) const {
64 virtual bool lowerFormalArguments(MachineIRBuilder &MIRBuilder,
65 const Function &F,
66 ArrayRef VRegs) const {
6867 return false;
6968 }
7069
555555 SmallVector VRegArgs;
556556 for (const Argument &Arg: F.args())
557557 VRegArgs.push_back(getOrCreateVReg(Arg));
558 bool Succeeded =
559 CLI->lowerFormalArguments(MIRBuilder, F.getArgumentList(), VRegArgs);
558 bool Succeeded = CLI->lowerFormalArguments(MIRBuilder, F, VRegArgs);
560559 if (!Succeeded) {
561560 if (!TPC->isGlobalISelAbortEnabled()) {
562561 MIRBuilder.getMF().getProperties().set(
151151 return true;
152152 }
153153
154 bool AArch64CallLowering::lowerFormalArguments(
155 MachineIRBuilder &MIRBuilder, const Function::ArgumentListType &Args,
156 ArrayRef VRegs) const {
154 bool AArch64CallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
155 const Function &F,
156 ArrayRef VRegs) const {
157 auto &Args = F.getArgumentList();
157158 MachineFunction &MF = MIRBuilder.getMF();
158159 MachineBasicBlock &MBB = MIRBuilder.getMBB();
159160 MachineRegisterInfo &MRI = MF.getRegInfo();
160 const Function &F = *MF.getFunction();
161161 auto &DL = F.getParent()->getDataLayout();
162162
163163 SmallVector Seqs;
2929 bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
3030 unsigned VReg) const override;
3131
32 bool lowerFormalArguments(MachineIRBuilder &MIRBuilder,
33 const Function::ArgumentListType &Args,
32 bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
3433 ArrayRef VRegs) const override;
3534
3635 bool lowerCall(MachineIRBuilder &MIRBuilder, const MachineOperand &Callee,
3333 return true;
3434 }
3535
36 bool AMDGPUCallLowering::lowerFormalArguments(
37 MachineIRBuilder &MIRBuilder, const Function::ArgumentListType &Args,
38 ArrayRef VRegs) const {
36 bool AMDGPUCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
37 const Function &F,
38 ArrayRef VRegs) const {
3939 // TODO: Implement once there are generic loads/stores.
4040 return true;
4141 }
2626
2727 bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
2828 unsigned VReg) const override;
29 bool
30 lowerFormalArguments(MachineIRBuilder &MIRBuilder,
31 const Function::ArgumentListType &Args,
32 ArrayRef VRegs) const override;
29 bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
30 ArrayRef VRegs) const override;
3331 };
3432 } // End of namespace llvm;
3533 #endif