[PATCH] D31924: SROA: Allow eliminating addrspacecasted allocas

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 10:45:37 PDT 2017


efriedma added inline comments.


================
Comment at: docs/LangRef.rst:8451
+complex value modification. A defined pointer computation casted in
+one address space and then indexed should give the same result as an
+equivalent indexing calculation in the original address space and then
----------------
What does "and then indexed" mean for a gep that isn't inbounds?  We clearly can't make all indexing equivalent: if you use a gep to increment a pointer by 2^33, that's clearly going to have a different result if you try to round-trip that value through a 32-bit pointer.

I mean, I understand what you're getting at with the new text: the rule is essentially that the original and casted pointers point at the same memory allocation.  LangRef really needs to be clear, though.


https://reviews.llvm.org/D31924





More information about the llvm-commits mailing list