summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-02-20 23:44:05 -0800
committerGitHub <noreply@github.com>2025-02-20 23:44:05 -0800
commitaf64f0a6c2e26b3fd1979c1fa380136e5528c9b3 (patch)
treed2faea36175b46cb336183c478d1e5e70dbb63a6 /llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
parent581599096e8a1a89ccd3e053a1209c69a9079083 (diff)
[FrameLowering] Use MCRegister instead of Register in CalleeSavedInfo. NFC (#128095)
Callee saved registers should always be phyiscal registers. They are often passed directly to other functions that take MCRegister like getMinimalPhysRegClass or TargetRegisterClass::contains. Unfortunately, sometimes the MCRegister is compared to a Register which gave an ambiguous comparison error when the MCRegister is on the LHS. Adding a MCRegister==Register comparison operator created more ambiguous comparison errors elsewhere. These cases were usually comparing against a base or frame pointer register that is a physical register in a Register. For those I added an explicit conversion of Register to MCRegister to fix the error.
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIFrameLowering.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
index 060db477a59f..ce21f8963fe8 100644
--- a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
@@ -1719,11 +1719,12 @@ bool SIFrameLowering::assignCalleeSavedSpillSlots(
NumModifiedRegs++;
for (auto &CS : CSI) {
- if (CS.getReg() == FramePtrReg && SGPRForFPSaveRestoreCopy) {
+ if (CS.getReg() == FramePtrReg.asMCReg() && SGPRForFPSaveRestoreCopy) {
CS.setDstReg(SGPRForFPSaveRestoreCopy);
if (--NumModifiedRegs)
break;
- } else if (CS.getReg() == BasePtrReg && SGPRForBPSaveRestoreCopy) {
+ } else if (CS.getReg() == BasePtrReg.asMCReg() &&
+ SGPRForBPSaveRestoreCopy) {
CS.setDstReg(SGPRForBPSaveRestoreCopy);
if (--NumModifiedRegs)
break;