[PATCH] D103656: [ScalarEvolution] Ensure backedge-taken counts are not pointers.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 4 10:34:12 PDT 2021


lebedev.ri added a comment.

In D103656#2799450 <https://reviews.llvm.org/D103656#2799450>, @efriedma wrote:

> For pointers where the index type is smaller than the pointer type, coming up with the right result is a little tricky.  As far as I can tell from the LangRef rules, icmp compares all the bits of the pointer, not just the index bits?  So I guess we can special-case comparisons where both sides have the same pointer base: the non-index bits will be the same.  If both sides have the same pointer base, and we've inferred some sort of nowrap, we can then convert the icmp to compare the index bits.  I guess we can handle non-integral pointers the same way.
>
> But I don't want to try to implement this logic without any real-world testing.  As far as I know, no in-tree targets use this feature.  So I'll leave it to someone who cares about such targets, and I don't think it should block this patch.

So that is "yes, let's \"break\" SCEV for non-integral pointers and datalayouts with too small of an GEP index sizes".
I see. That does indeed allow us to fix SCEV :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103656



More information about the llvm-commits mailing list