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

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 17:21:40 PDT 2016


hfinkel added inline comments.

================
Comment at: docs/LangRef.rst:7551
@@ +7550,3 @@
+``inrange`` operand. Note that the ``inrange`` keyword is currently only
+allowed in constant expressions.
+
----------------
pcc wrote:
> hfinkel wrote:
> > I don't think we should limit this to constant expressions. We should be able to use this to model p.x[i] vs. p.y. Removing the restriction to constant expressions will also mean you need to generalize the text about pointer comparisons: instead of saying that all operands must be identical, you'll need to say that the same elements need to be selected (or something like that).
> Seems reasonable enough, but I'm not sure if I'll have any time soon to implement this for non-constants. Perhaps the non-constant implementation can be a separate patch.
Aside from the LangRef, what needs to change to allow non-constant indicies? I think they should be allowed, even if taking advantage of them is future work. I don't see anything in the parser changes that forbids them.


https://reviews.llvm.org/D22793





More information about the llvm-commits mailing list