[PATCH] D28566: Disable Callee Saved Registers
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 1 11:00:50 PST 2017
MatzeB added inline comments.
================
Comment at: include/llvm/CodeGen/RegisterClassInfo.h:56
+ // runOnFunction() call. Used only to determine if an update was made.
+ SmallVector<uint8_t, 16> CalleeSavedRegs;
----------------
oren_ben_simhon wrote:
> MatzeB wrote:
> > There are several targets out there with more than 256 registers! AMDGPU already has > 1000, and I know of even crazier out-of-tree targets.
> The size here is just the initial size. The size is updated according to the number of registers.
>
> Notice that following code exmaple that actually changes the size (using push_back):
>
> SmallVector<uint8_t, 16> ActualCalleeSaved;
> ...
> for (unsigned I = 0; unsigned Reg = CSR[I]; ++I)
> ActualCalleeSaved.push_back(Reg);
> ...
> CalleeSavedRegs = ActualCalleeSaved;
You hold a register number in an uint8_t with UINT8_MAX==256, don't you?
You should use MCPhysReg (or `unsigned` if you want to store phys+virtual regs)
Repository:
rL LLVM
https://reviews.llvm.org/D28566
More information about the llvm-commits
mailing list