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

Tom Stellard via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 7 09:28:36 PST 2016


Hi,

I've been experimenting with global isel over the last few weeks and it
is such a vast improvement over the SelectionDAG for the AMDGPU target
that I would really like to begin using it as soon as possible.

Given the lack of a replacement for SelectionDAG's legalizer / combiner,
and how much work this will be to implement, I think the fastest path to
doing this would be to run some of the GlobalISel passes after SelectionDAG
instruction selection.

What I would like to do is modify the AMDGPU target to select SelectionDAG
nodes to generic opcodes, and then run the InstructionSelector pass on
the resulting MachineFunction.

I would start by doing this with loads/stores and then move on to other
opcodes one at a time.

These changes will be a big improvement to AMDGPU, because it will allow
us to replace our SIFixSGPRCopies pass which is essentially just another
instruction selector that re-selects instructions based on their register
classes and also let us do a much better job of matching addressing modes,
which is very important for the AMDGPU target.

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.

What do people think about this?

Thanks,
Tom


More information about the llvm-dev mailing list