[llvm] e574fd9 - AArch64/GlobalISel: Cleanup unnecessary size checks in call lowering
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 19 08:13:11 PDT 2021
Author: Matt Arsenault
Date: 2021-07-19T11:01:30-04:00
New Revision: e574fd9d524dd7e14be0f024c9a3e6ae68c983ba
URL: https://github.com/llvm/llvm-project/commit/e574fd9d524dd7e14be0f024c9a3e6ae68c983ba
DIFF: https://github.com/llvm/llvm-project/commit/e574fd9d524dd7e14be0f024c9a3e6ae68c983ba.diff
LOG: AArch64/GlobalISel: Cleanup unnecessary size checks in call lowering
The CCValAssign types should now be accurate, so these are no longer
necessary.
Added:
Modified:
llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp b/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
index dcc6a44c5452d..0f75429626910 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
@@ -161,8 +161,6 @@ struct IncomingArgHandler : public CallLowering::IncomingValueHandler {
MachinePointerInfo &MPO, CCValAssign &VA) override {
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 LocTy(VA.getLocVT());
@@ -173,15 +171,7 @@ struct IncomingArgHandler : public CallLowering::IncomingValueHandler {
auto MMO = MF.getMachineMemOperand(
MPO, MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant, LocTy,
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);
- } else {
- auto Tmp = MIRBuilder.buildLoad(LocTy, Addr, *MMO);
- MIRBuilder.buildTrunc(ValVReg, Tmp);
- }
+ MIRBuilder.buildLoad(ValVReg, Addr, *MMO);
}
/// How the physical register gets marked varies between formal
@@ -302,10 +292,6 @@ struct OutgoingArgHandler : public CallLowering::OutgoingValueHandler {
}
ValVReg = extendRegister(ValVReg, VA, MaxSize);
- const LLT RegTy = MRI.getType(ValVReg);
-
- if (RegTy.getSizeInBits() < LocVT.getSizeInBits())
- ValVReg = MIRBuilder.buildTrunc(RegTy, ValVReg).getReg(0);
} else {
// The store does not cover the full allocated stack slot.
MemTy = LLT(VA.getValVT());
More information about the llvm-commits
mailing list