[llvm-dev] Running GlobaISel passes after SelectionDAG instruction selection

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 7 09:57:31 PST 2016


On 7 Nov 2016, at 09:28, Tom Stellard <tom at stellard.net> wrote:
> I already have a working prototype where I run SelectionDAG ISel and
> then the InstructionSelector pass right afterwards, but I think to
> make this approach work long-term, we will need to agree that this is a
> supported use case of GlobalISel, and we will also need to start
> building the GlobalISel code by default.

Enabling GlobalISel by default should be fine now. I think it was mostly disabled because we used to add extra type data to the MachineInstr class, which penalized existing memory usage. Now we store that in MachineRegisterInfo and there's no overhead unless you're actually using GlobalISel.

My main worry is that this form of plumbing would seem to turn the fallback code path into an infinite loop if you're not careful (and not actually simplify SelectionDAG if you are).

Other than that, I suppose the biggest issue would be divergence between what InstructionSelect expects (from RegBankSelect) and what your SelectionDAG shim is providing. I think that should be fairly minimal though (InstructionSelect needs to be able to cope with fully constrained VRegs anyway IMO), so no real objections here.

Tim.


More information about the llvm-dev mailing list