[PATCH] D31924: SROA: Allow eliminating addrspacecasted allocas

David Chisnall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 11:38:19 PDT 2017


theraven added a comment.

For us, speculation isn't a problem.  `ptrtoint` is not guaranteed to give stable results in all run-time environments (i.e. if we enable a copying GC), but it doesn't break the memory safety guarantees.  `inttoptr` only works in some execution environments (and will result in a null where it wouldn't work), and it's up to the C programmer to ensure that they don't use it when it wouldn't be sensible and other front ends won't emit it at all.  Code works as expected, as long as optimisers don't try to add them.


https://reviews.llvm.org/D31924





More information about the llvm-commits mailing list