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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 10:46:57 PDT 2020


efriedma added a comment.

Assuming we have properly typed SCEVs, we can pretend the high bits of the pointer don't exist in a pointer SCEV.  We can't pretend they don't exist in an integer SCEV: that leads to miscompiles.  This is why SCEVPtrToIntExpr, specifically, needs special handling.

My suggestion was just to skip creating SCEVPtrToInt was mostly so you don't have to write a bunch of tests for various operations on SCEVPtrToInt expressions involving pointers with a narrow index type.  It's probably not hard to implement, just sort of tedious, and we don't have good testing infrastructure.


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