[llvm] [NFC][AMDGPU] Compute always reserved registers once (PR #132006)

Akshat Oke via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 19 23:42:32 PDT 2025


optimisan wrote:

> Why? Is this a compile time performance improvement? Is it measurable?

Looking at `getReservedRegs()` only, I get about 4.2% reduction in instruction refs on a small testcase. Running the lit tests is only marginally faster (about a second on average to run everything in `llvm/test/CodeGen/AMDGPU`) but definitely not slower.

> I know getReservedRegs is expensive, but the parts you have moved into getAlwaysReservedRegs look relatively cheap.

True, I just saw this is redundant and distilled it out.

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


More information about the llvm-commits mailing list