Skip to content

[PowerPC] Used named subreg indices instead of hardcoded numbers. NFC #127671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Feb 18, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 18, 2025

@llvm/pr-subscribers-backend-powerpc

Author: Craig Topper (topperc)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/127671.diff

1 Files Affected:

  • (modified) llvm/lib/Target/PowerPC/PPCFrameLowering.cpp (+2-2)
diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
index bec97c986ff66..f88af657c8ad5 100644
--- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
@@ -2344,8 +2344,8 @@ bool PPCFrameLowering::assignCalleeSavedSpillSlots(
 
     for (auto &CalleeSaveReg : CSI) {
       MCPhysReg Reg = CalleeSaveReg.getReg();
-      MCRegister Lower = RegInfo->getSubReg(Reg, 1);
-      MCRegister Higher = RegInfo->getSubReg(Reg, 2);
+      MCRegister Lower = RegInfo->getSubReg(Reg, PPC::sub_32);
+      MCRegister Higher = RegInfo->getSubReg(Reg, PPC::sub_32_hi_phony);
 
       if ( // Check only for SuperRegs.
           Lower &&

@topperc topperc merged commit 4efab09 into llvm:main Feb 18, 2025
10 checks passed
@topperc topperc deleted the pr/ppcsubregs branch February 18, 2025 18:43
wldfngrs pushed a commit to wldfngrs/llvm-project that referenced this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants