[LLVMdev] Semantics of an Inbounds GetElementPtr

Daniel Berlin dberlin at dberlin.org
Mon May 11 08:07:55 PDT 2015


+Philip
Looks pretty good. As i just said on the review, it would be really
nice to know how often this triggers.

Philip may be interested too, if they don't already have a null check
removal pass of their own :)


On Sat, May 9, 2015 at 6:35 AM, Nicholas White <n.j.white at gmail.com> wrote:
> Thanks - that was very interesting. I've had a go at implementing it
> here - http://reviews.llvm.org/D9634 - as an improvement to the SCCP
> pass. It seems to work (see the test cases), but I had to make a few
> compromises (making PtrUseVisitor look through phi nodes, only working
> on CmpInst.isEquality() instructions, and making the SCCP pass
> dependent on the PostDominatorTree pass). I think it's O(n);
> PtrUseVisitor scans each Use at most once, and PostDominatorTree seems
> linear in the number of predecessor blocks. It was easier to implement
> by starting at a ptr-vs-null-checking CmpInst and analysing the code
> forwards rather than by starting at an inbounds GEP instruction and
> analysing the code backwards. What do you think?
>
> Thanks -
>
> Nick



More information about the llvm-dev mailing list