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

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 16:37:16 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.
+
----------------
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).

================
Comment at: include/llvm/IR/Operator.h:382
@@ -381,1 +381,3 @@
   }
+  /// Returns the offset of the index with an inrange attachment, or None if
+  /// none.
----------------
Can more than once index have inrange on it? It looks like no, but this is not clear from the LangRef, and I don't understand that restriction regardless.


https://reviews.llvm.org/D22793





More information about the llvm-commits mailing list