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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 09:18:30 PST 2025


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

None

>From c8e10ebf3f964a02f7df6bf334a72b0cf425c893 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Tue, 18 Feb 2025 09:17:47 -0800
Subject: [PATCH] [PowerPC] Used named subreg indices instead of hardcoded
 numbers. NFC

---
 llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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



More information about the llvm-commits mailing list