[PATCH] D31924: SROA: Allow eliminating addrspacecasted allocas

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 13:34:07 PDT 2017


efriedma added a comment.

I'd like to see some testcases which involve mixing GEPs and addrspacecasts.  What width of APInt do we use to accumulate the offset?  How does overflow work when we mix GEPs in different address-spaces?



================
Comment at: docs/LangRef.rst:8460
+same memory location. The pointer conversion cannot be an arbitrarily
+complex value modification. For a defined result, the inverse cast to
+the original address space should yield the original pointer value.
----------------
arsenm wrote:
> efriedma wrote:
> > "The pointer conversion cannot be an arbitrarily complex value modification." is a bit vague... it'd be better if we could specifically say what transforms are allowed.
> Would just dropping that sentence work? The intent is more clear in the second sentence where it needs to be reversible
Yes, I think that's fine.


https://reviews.llvm.org/D31924





More information about the llvm-commits mailing list