[LLVMdev] Moving towards a singular pointer type

Chris Lattner clattner at apple.com
Mon Feb 16 15:53:50 PST 2015


> On Feb 6, 2015, at 3:38 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> It's an idea been thrown around in a few different threads (including Rafael's recent http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141201/247285.html <http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141201/247285.html> and Chandler's http://llvm.org/viewvc/llvm-project?rev=226781&view=rev <http://llvm.org/viewvc/llvm-project?rev=226781&view=rev> ) so I'm putting up my hand to volunteer to do the work & interested in getting a bit more feedback, thoughts on best approaches, timing, etc.
> 
> For some more detail: pointer types (i32*, %foo*, etc) complicate IR canonicalization. store + load should be the same instructions given the same number of bytes stored to memory, but instead we can have store float, store int, etc, etc. Another point Chandler made was that the bitcasts involved when a pointer isn't of the right type results in extra IR instructions we don't really need.
> 
> So the general idea is that all pointers would just be called "ptr" (pointer? void*?).
> 
> Is this something everyone feels is the right direction? Any reason why it wouldn't be?


Hi David,

You can emulate this by having clang always generate "i8*” as the general type, then bitcast to "%Foo*” before doing a GEP.  Have you prototyped this change (with this approach, or any other one) to see what it does to the optimizers?

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150216/3fa3dad4/attachment.html>


More information about the llvm-dev mailing list