[llvm] d688a67 - AMDGPU/GlobalISel: Simplify code
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 21 01:55:44 PST 2019
Author: Matt Arsenault
Date: 2019-12-21T04:55:36-05:00
New Revision: d688a6739df527d14dfe578d8bc97439d3884a73
URL: https://github.com/llvm/llvm-project/commit/d688a6739df527d14dfe578d8bc97439d3884a73
DIFF: https://github.com/llvm/llvm-project/commit/d688a6739df527d14dfe578d8bc97439d3884a73.diff
LOG: AMDGPU/GlobalISel: Simplify code
This can directly access the register bank, and doesn't need to get it
through the ID.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
index a51d3d74c899..8d645609b4be 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
@@ -928,7 +928,7 @@ bool AMDGPURegisterBankInfo::executeInWaterfallLoop(
Op.setReg(Merge.getReg(0));
}
- MRI.setRegBank(Op.getReg(), getRegBank(AMDGPU::SGPRRegBankID));
+ MRI.setRegBank(Op.getReg(), AMDGPU::SGPRRegBank);
}
}
}
@@ -1117,11 +1117,11 @@ bool AMDGPURegisterBankInfo::applyMappingWideLoad(MachineInstr &MI,
for (unsigned DefIdx = 0, e = DefRegs.size(); DefIdx != e; ++DefIdx) {
Register IdxReg = MRI.createGenericVirtualRegister(LLT::scalar(32));
B.buildConstant(IdxReg, DefIdx);
- MRI.setRegBank(IdxReg, getRegBank(AMDGPU::VGPRRegBankID));
+ MRI.setRegBank(IdxReg, AMDGPU::VGPRRegBank);
B.buildExtractVectorElement(DefRegs[DefIdx], TmpReg, IdxReg);
}
- MRI.setRegBank(DstReg, getRegBank(AMDGPU::VGPRRegBankID));
+ MRI.setRegBank(DstReg, AMDGPU::VGPRRegBank);
return true;
}
@@ -1389,7 +1389,7 @@ void AMDGPURegisterBankInfo::applyMappingImpl(
B.buildSelect(DefRegs[0], Src0Regs[0], Src1Regs[0], Src2Regs[0]);
B.buildSelect(DefRegs[1], Src0Regs[0], Src1Regs[1], Src2Regs[1]);
- MRI.setRegBank(DstReg, getRegBank(AMDGPU::VGPRRegBankID));
+ MRI.setRegBank(DstReg, AMDGPU::VGPRRegBank);
MI.eraseFromParent();
return;
}
@@ -1445,7 +1445,7 @@ void AMDGPURegisterBankInfo::applyMappingImpl(
.addUse(Src0Regs[1])
.addUse(Src1Regs[1]);
- MRI.setRegBank(DstReg, getRegBank(AMDGPU::VGPRRegBankID));
+ MRI.setRegBank(DstReg, AMDGPU::VGPRRegBank);
MI.eraseFromParent();
return;
}
More information about the llvm-commits
mailing list