[PATCH] D99660: Use DL.getIndexType() in Value::getPointerAlignment()

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 31 07:31:40 PDT 2021


lebedev.ri requested changes to this revision.
lebedev.ri added a comment.
This revision now requires changes to proceed.

In D99660#2661435 <https://reviews.llvm.org/D99660#2661435>, @nikic wrote:

> It's not really clear why using the index type for this would be correct. The index type is used for GEP index and casting a pointer to the index type doesn't make a whole lot of sense to me. Do you have any LangRef wording or other usages that would show that this is a sensible thing to do?

+1, i'm not convinced that `index type` is the right fix here.
I would think that you need to either unbreak the invariant that `decltype(sizeof(ptr)==intptrtype)`
or make that addressspace non-integral, thus preventing int<->ptr casts.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99660



More information about the llvm-commits mailing list