[PATCH] D41114: Look through address space casts in IsConstantOffsetFromGlobal()

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 16:57:55 PST 2020


arsenm added a comment.

In D41114#952977 <https://reviews.llvm.org/D41114#952977>, @arichardson wrote:

> True, I didn't think of that. For us this will almost always work without adding an additional offset but I am not sure what the correct way to fix this is.
>
> Would it make sense to add a function like `canPerformConstantAddrSpaceCast(unsigned FromAS, unsigned ToAS)` to DataLayout?


I think there correct solution is to allow bitcasts between equivalently sized pointers for no-op casts


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D41114/new/

https://reviews.llvm.org/D41114





More information about the llvm-commits mailing list