[PATCH] D22793: IR: Introduce inbounds attribute on getelementptr indices.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 14:20:56 PDT 2016


mehdi_amini added a comment.

In https://reviews.llvm.org/D22793#496473, @pcc wrote:

> Passes are free to discard this annotation, it's similar to metadata in that way.


Oh, that wasn't clear to me.

In https://reviews.llvm.org/D22793#496512, @eli.friedman wrote:

> We'll probably have to be extremely cautious in terms of how we actually use inrange in clang.  Applying inrange to a computation like "&p->a" is theoretically allowed by the C standard, but likely to cause problems in practice.  Specifically, we could end up breaking programs without any good way to find the problem.  Existing tools like valgrind and asan can't detect this sort of issue at all.  That's more of a question of what makes sense for clang rather than something which affects the attribute itself... but if clang can't really use inrange markings outside of vtables, that reduces the utility a lot.


Isn't it similar to TBBA? What kind of extra problem do you anticipate?
You may be able to chime in on this related thread on llvm-dev currently: https://groups.google.com/forum/#!topic/llvm-dev/Lc8POEocCX8


https://reviews.llvm.org/D22793





More information about the llvm-commits mailing list