[llvm-dev] Reserve ARM register for only section of the program

Nisal Menuka via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 9 10:02:05 PDT 2017

How can I reserve an ARM register for only a part of the code?

Example: lets say I have 3 functions, A(), B() and C(). I want to
prohibit compiler from using a register (lets say X9 in ARM 64) in
function C() only.

I think that by AArch64RegisterInfo::getReservedRegs  function, a
register can be reserved for the whole program. But, I need to reserve
for only part of the code.

Can I implement a custom #pragma to do it?

Thanks and Best

More information about the llvm-dev mailing list