[AArch64] Add an option to reserve physical registers from RA
authorGuozhi Wei <carrot@google.com>
Tue, 6 Sep 2022 17:18:01 +0000 (17:18 +0000)
committerGuozhi Wei <carrot@google.com>
Tue, 6 Sep 2022 17:18:01 +0000 (17:18 +0000)
commit3cf4ab54476e549a787b1240a4fd2e9576822f17
treeefa94087dfffa9ba2554cbcdf16ea57a6091ba5a
parent5fab33af7f083a0043112742027172e9f297c07f
[AArch64] Add an option to reserve physical registers from RA

This patch adds an option --reserve-regs-for-regalloc, so we can reserve a list
of physical registers. These registers will not be used by register allocator,
but can still be used as ABI requests such as passing arguments to function
call.

Its main purpose is simulating high register pressure by reserving many physical
registers. So it will be much easier to test and debug register allocation
changes.

Differential Revision: https://reviews.llvm.org/D132717
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
llvm/lib/Target/AArch64/AArch64RegisterInfo.h
llvm/lib/Target/AArch64/AArch64Subtarget.cpp
llvm/lib/Target/AArch64/AArch64Subtarget.h
llvm/test/CodeGen/AArch64/arm64-platform-reg.ll