[PATCH] D55449: [InstCombine] Fix negative GEP offset evaluation for 32-bit pointers

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 12:47:09 PST 2018


nikic added a comment.

In D55449#1328633 <https://reviews.llvm.org/D55449#1328633>, @efriedma wrote:

> I think I would rather SignExtend64(X, 32) or something like that... yes, it's effectively the same for well-defined code, but I'd rather explicitly truncate the offset rather than implicitly truncate it in ConstantInt::get.


Another possibility would be to not apply the simplification if the offsets are too large, i.e. make `isIntN(IntPtrWidth, Offset) && isIntN(IntPtrWidth, VariableScale)` a precondition for this transform. What do you think?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55449





More information about the llvm-commits mailing list