[LLVMdev] RFC: GEP as canonical form for pointer addressing

Philip Reames listmail at philipreames.com
Wed Feb 19 10:18:32 PST 2014


On 02/18/2014 01:13 PM, Andrew Trick wrote:
> I’m not opposed to preserving the GEP’s original base as a matter of convention when there’s no good reason not to. But, in general passes expect to be able to break-up GEPs into smaller steps. We can’t guarantee that the original base will be directly referenced at every point of use.
Agreed.  From my perspective, having the direct base improves code 
quality, but is not required for correctness.
> We should certainly avoid generating out-of-bounds GEPs without retaining some in-bounds pointer, because that would break everyone’s conservative GC as well.
I have no objection to this, but it's not required either.  We can 
reconstruct a base pointer using a custom transform pass and then 
preserve this into the GC stack map.  This deals with both in bounds and 
out of bounds geps.  It does result in more messy code being generated 
though.

Philip



More information about the llvm-dev mailing list