[RISCV] Refine getMaxPushPopReg like getLibCallID. NFC.
If save/restore libcall or Zcmp push/pop are enabled, callee-saved registers including ra would be assigned a negative frame index (-1 for ra, -2 for s0, ..., -13 for s11) by RISCVRegisterInfo::hasReservedSpillSlot. getLibCallID would find a callee-saved register that has max register id and with assigned negative frame index. And use this max register to get which save/restore libcall should be selected. In getMaxPushPopReg (for Zcmp push/pop, similar getLibCallID), it uses extra register class (PGPR) to check the saved register is in ra, s0-s11 instead of checking the frame index is negative. This patch just changes the checking for the saved register from `is contained in PGPR` to `has a negative frame index`. Reviewed By: fakepaper56 Differential Revision: https://reviews.llvm.org/D156393
Loading
Please sign in to comment