[llvm] [PowerPC] Used named subreg indices instead of hardcoded numbers. NFC (PR #127671)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 09:19:03 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-powerpc

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) llvm/lib/Target/PowerPC/PPCFrameLowering.cpp (+2-2) 


``````````diff
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 &&

``````````

</details>


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


More information about the llvm-commits mailing list