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

Kai Luo via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 18:10:10 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) {
----------------
bzEq wrote:

Is this change still necessary after using `DwarfRegAlias`? Looks we have similar register structure as https://github.com/llvm/llvm-project/commit/ddffa0e160036229f19e0ec9867952fc4c4dd66c.

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


More information about the llvm-commits mailing list