[PATCH] D55301: RegAlloc: Allow targets to split register allocation

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 13 09:18:05 PST 2019

arsenm marked 2 inline comments as done.
arsenm added inline comments.

Comment at: lib/CodeGen/RegAllocFast.cpp:78
+      StackSlotForVirtReg(-1),
+      ClearVirtRegs(ClearVirtRegs_) {
+    }
qcolombet wrote:
> It feels dangerous to expose the ClearVirtRegs to me.
> Could we deduce what has to be cleared based on what we allocate instead of exposing this?
The problem is somewhere needs to set NoVRegs property. The same parameter is added to createVirtRegRewriter, but fastregalloc does the assignment itself.

I don't think this can be inferred, and the target needs to say when it's done allocating register classes. For example it would be possible to have a degenerate function where all SGPRs are allocated in the first run, and there happen to be no VGPR vregs. Intervening passes may want to introduce new vregs to be taken care of by the later runs, but that won't work if the earlier pass decided to infer that all registers were taken care of



More information about the llvm-commits mailing list