[PATCH] D89540: [SCEV] Index type usually is, but is not guaranteed to be, equal to the pointer bit width

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 09:55:39 PDT 2020


lebedev.ri added a comment.

In D89540#2335050 <https://reviews.llvm.org/D89540#2335050>, @efriedma wrote:

> I'm not sure I completely understand the history from https://reviews.llvm.org/D42123.  But I think the idea is that for pointer-type SCEVs, we want to do SCEV arithmetic using the index type because the other bits aren't relevant: from my understanding, they don't participate in pointer arithmetic.
>
> So I think the right solution is to leave this code alone.  And maybe don't create SCEVPtrToInt expressions for ptrtoint operations on pointers where getIndexTypeSizeInBits() isn't equal to getTypeSizeInBits(), at least initially, since it's sort of tricky to reason about.

I question sanity of that approach.
That being said, then perhaps D89456 <https://reviews.llvm.org/D89456> simply should also pretend that the pointer's high bits don't exist if they don't matter for us?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89540



More information about the llvm-commits mailing list