[PATCH] D18738: Add new !unconditionally_dereferenceable load instruction metadata

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 13 23:56:26 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D18738#754200, @sanjoy wrote:

> In https://reviews.llvm.org/D18738#752535, @whitequark wrote:
>
> > @hfinkel Oh, my bad--I now remember that this came up long ago...
>
>
>


...

>> @sanjoy Can you confirm that a dereferenceable attribute on getelementptr would be an acceptable IR extension?
> 
> A GEP that always produces a dereferenceable value may be tricky to implement since we'll have to remember to strip said attribute whenever we hoist GEPs; and LLVM likes to hoist GEP's without thinking too much.  But I believe this is going in the right direction -- we should not have soundness problems as long as the safety of some operation is guaranteed by some //other// preceding operation.

In your usage model, would you need the metadata on the GEP, or would putting it on whatever generates the base pointer be sufficient?


Repository:
  rL LLVM

https://reviews.llvm.org/D18738





More information about the llvm-commits mailing list