[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:22:51 PST 2019


arsenm marked an inline comment as done.
arsenm added inline comments.


================
Comment at: lib/CodeGen/RegAllocFast.cpp:78
+      StackSlotForVirtReg(-1),
+      ClearVirtRegs(ClearVirtRegs_) {
+    }
----------------
arsenm wrote:
> 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
Actually I stopped creating new virtual registers at some point in the current implementation, but I still may want to do so in the future


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55301/new/

https://reviews.llvm.org/D55301





More information about the llvm-commits mailing list