[PATCH] Add support for nonnull metadata on Loads

Pete Cooper peter_cooper at apple.com
Wed Oct 22 11:17:28 PDT 2014


Hey Philip

Sorry to go back to a committed patch, but it seemed like the best place for these questions.

So firstly I really like the patch here, I have no problems with it.

I’m curious what your plans are for this in terms of expanding it to other instructions.  I’d like to see this on PHIs for example.

You also mentioned call returns.  I think that this complements function return attributes as I could do something like this:

%0 = load … !nonnull
call foo(%0)

void* foo(void*p) { return p }

You can’t put the nonnull attribute on the function return itself as you can’t prove that its always nonnull for all callers, but your metadata can be put on a specific call site like the one above.

Finally, any plans for clang to emit these?  vtable reads for example are probably guaranteed to be nonnull…probably :)

Thanks,
Pete
> On Oct 20, 2014, at 3:51 PM, Philip Reames <listmail at philipreames.com> wrote:
> 
> Closed by commit rL220240 (authored by @reames).
> 
> REPOSITORY
>  rL LLVM
> 
> http://reviews.llvm.org/D5220
> 
> Files:
>  llvm/trunk/docs/LangRef.rst
>  llvm/trunk/lib/Analysis/ValueTracking.cpp
>  llvm/trunk/test/Transforms/InstSimplify/compare.ll
> <D5220.15157.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list