Skip to content
Commit 5f94f3b7 authored by Jim Lin's avatar Jim Lin
Browse files

[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
parent 4e84ec81
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment