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

Quentin Colombet via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 18 15:52:52 PST 2015


Hi David,


> On Nov 18, 2015, at 11:55 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:
> 
> Hi Quentin,
> 
> On 18 Nov 2015, at 19:26, Quentin Colombet via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>> 
>> In the section “Goals", I defined (repeated for people that saw the talk) the goals for the Global ISel design.
>> - Do you see anything missing?
>> - Do you see something that should not be there? 
> 
> I really like the design that you outlined.  I have one very small request:
> 
> Please maintain pointers as a distinct type from integers for as long as possible.  We currently have some patches in SelectionDAG to add some pointer-specific operations, as in our architecture the operations valid on pointers are not the same as those valid on integers (and pointers are not the same size as integers).  Your proposed model looks like it would be *much* easier for us to use as long as that constraint is kept.  Various systems with different integer and address registers hit the same problem as us.

I understand the problem, but I feel like Jakob back in the day:
http://lists.llvm.org/pipermail/llvm-dev/2013-August/064734.html
http://lists.llvm.org/pipermail/llvm-dev/2013-August/064760.html

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 :).

> 
> Given the way that you’re proposing to do legalisation, this seems like it should be easy (for most architectures, assigning pointers to the same register bank as integers will be a simple choice and then all of the later selection should be the same).
> 
> On a related note, keeping pointer address spaces around in the machine IR would make things easier for us and, I think, some of the GPU folks.

Good point, this is also something that the MachineInstr should also expose as part of the make the IR self contained.

Thanks,
-Quentin

> 
> David
> 



More information about the llvm-dev mailing list