[llvm] [RISCV] Disable Zilsd CSR-pair generation when push/pop or save-restore is enabled (PR #200623)
Sudharsan Veeravalli via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 1 08:50:44 PDT 2026
================
@@ -1690,9 +1690,13 @@ void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF,
// For Zilsd on RV32, append GPRPair registers to the CSR list. This prevents
// the need to create register sets for each abi which is a lot more complex.
// Don't use Zilsd for callee-saved coalescing if the required alignment
- // exceeds the stack alignment.
+ // exceeds the stack alignment or when Zcmp/Xqccmp or save/restore libcalls
+ // are enabled.
+ bool HasPushPopCompression = STI.hasStdExtZcmp() || STI.hasVendorXqccmp();
bool UseZilsd = !STI.is64Bit() && STI.hasStdExtZilsd() &&
- STI.getZilsdAlign() <= getStackAlign();
+ STI.getZilsdAlign() <= getStackAlign() &&
+ !RVFI->isPushable(MF) && !RVFI->useSaveRestoreLibCalls(MF) &&
+ !HasPushPopCompression;
----------------
svs-quic wrote:
Yeah thanks I've removed it.
https://github.com/llvm/llvm-project/pull/200623
More information about the llvm-commits
mailing list