1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00

AArch64/GlobalISel: Cleanup unnecessary size checks in call lowering

The CCValAssign types should now be accurate, so these are no longer
necessary.
This commit is contained in:
Matt Arsenault 2021-07-16 11:10:41 -04:00
parent 6df259fb43
commit 2b17cee2de

View File

@ -161,8 +161,6 @@ struct IncomingArgHandler : public CallLowering::IncomingValueHandler {
MachinePointerInfo &MPO, CCValAssign &VA) override { MachinePointerInfo &MPO, CCValAssign &VA) override {
MachineFunction &MF = MIRBuilder.getMF(); MachineFunction &MF = MIRBuilder.getMF();
// The reported memory location may be wider than the value.
const LLT RealRegTy = MRI.getType(ValVReg);
LLT ValTy(VA.getValVT()); LLT ValTy(VA.getValVT());
LLT LocTy(VA.getLocVT()); LLT LocTy(VA.getLocVT());
@ -173,15 +171,7 @@ struct IncomingArgHandler : public CallLowering::IncomingValueHandler {
auto MMO = MF.getMachineMemOperand( auto MMO = MF.getMachineMemOperand(
MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, LocTy, MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, LocTy,
inferAlignFromPtrInfo(MF, MPO)); inferAlignFromPtrInfo(MF, MPO));
if (RealRegTy.getSizeInBits() == ValTy.getSizeInBits()) {
// No extension information, or no extension necessary. Load into the
// incoming parameter type directly.
MIRBuilder.buildLoad(ValVReg, Addr, *MMO); MIRBuilder.buildLoad(ValVReg, Addr, *MMO);
} else {
auto Tmp = MIRBuilder.buildLoad(LocTy, Addr, *MMO);
MIRBuilder.buildTrunc(ValVReg, Tmp);
}
} }
/// How the physical register gets marked varies between formal /// How the physical register gets marked varies between formal
@ -302,10 +292,6 @@ struct OutgoingArgHandler : public CallLowering::OutgoingValueHandler {
} }
ValVReg = extendRegister(ValVReg, VA, MaxSize); ValVReg = extendRegister(ValVReg, VA, MaxSize);
const LLT RegTy = MRI.getType(ValVReg);
if (RegTy.getSizeInBits() < LocVT.getSizeInBits())
ValVReg = MIRBuilder.buildTrunc(RegTy, ValVReg).getReg(0);
} else { } else {
// The store does not cover the full allocated stack slot. // The store does not cover the full allocated stack slot.
MemTy = LLT(VA.getValVT()); MemTy = LLT(VA.getValVT());