[llvm-dev] [GlobalISel] A Proposal for global instruction selection

David Chisnall via llvm-dev llvm-dev at lists.llvm.org
Thu Nov 19 01:57:33 PST 2015


On 18 Nov 2015, at 23:52, Quentin Colombet <qcolombet at apple.com> wrote:
> 
> To summarize with my own words and feelings that gives:
> To me the pointer/integer distinction is a way for you to specify the register classes you want. This is something the RegBankSelect pass will do for you and this distinction should not be necessary to produce efficient or correct code.
> 
> If that doesn’t work, you should be able to have target specific pass to select what you want directly after the translation or with a custom translation. One can envision some kind of IRTranslationKit that has all the generic translation build into to help you in such case.
> 
> Anyway, the good point with the prototype is that we will be able to experiment these things :).

As long as the pointer vs integer distinction is preserved until the RegBankSelect stage, then that will work for us.  The problem with the current SelectionDAG ordering is that ‘what integer type do you use to represent pointers?’ is the first question that the generic CodeGen infastructure asks the back end during type legalisation, and the information is then gone (unless you add new MVTs, as we’ve had to do).  If the initial lower preserves the difference between pointer-in-address-space-X and i64, and we are allowed register banks that overlap for final register allocation (which is almost certainly needed for less exotic use cases anyway), then this scheme would be *lot* easier for us to work with than the existing CodeGen infrastructure.

David



More information about the llvm-dev mailing list