[llvm] [X86][IPRA] Add getIPRACSRegs since rbp is risked to be optimized out. (PR #109597)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 11:36:03 PDT 2024


https://github.com/rnk commented:

I think this would benefit from a clearer explanation of the problem in a GitHub issue.

If I try to fill in the details myself, I guess the issue arises because LLVM doesn't use RBP the same way other callee-saved registers are used. We simply reserve it from the set of allocatable registers, and hard code its usage to address stack memory when `hasFP` is true.

This should generalize to cover base pointers as well (ESI / RBP), where you'll see the same problem if you construct a complicated enough test case.

Do the main IPRA stakeholders feel like this is an acceptable fix? It effectively prevents making RBP an IPRA allocatable register, which seems like it might not be acceptable.

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


More information about the llvm-commits mailing list