[llvm] [StackMaps] Check both subregs and superregs for getDwarfRegNum (PR #95837)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 07:48:51 PDT 2024


================
@@ -191,14 +191,22 @@ unsigned StackMaps::getNextMetaArgIdx(const MachineInstr *MI, unsigned CurIdx) {
   return CurIdx;
 }
 
-/// Go up the super-register chain until we hit a valid dwarf register number.
+/// Go up the super-register and sub-register chain until we hit a valid dwarf
+/// register number.
 static unsigned getDwarfRegNum(unsigned Reg, const TargetRegisterInfo *TRI) {
   int RegNum;
   for (MCPhysReg SR : TRI->superregs_inclusive(Reg)) {
     RegNum = TRI->getDwarfRegNum(SR, false);
     if (RegNum >= 0)
       break;
   }
+  if (RegNum < 0) {
----------------
chenzheng1030 wrote:

OK. Thanks for comment @arsenm 

I am fine if we solve PPC's issue by just adding `DwarfRegAlias` in PPC td files. We can do the refactor for the two versions `getDwarfRegNum()` in another patch.

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


More information about the llvm-commits mailing list