[ConstraintElim] Bail out for GEPs when index size > 64 bits.
authorFlorian Hahn <flo@fhahn.com>
Thu, 13 Oct 2022 09:19:29 +0000 (10:19 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 13 Oct 2022 09:19:30 +0000 (10:19 +0100)
commit359bc5c541ae4b02ad74bb9a9c3cb64e61464a4a
tree79045b9ab8c7ff033702d929e9ec2e4fc4063eb0
parent440ce05fbf869040b41a5fc9953d7b11ad5bb776
[ConstraintElim] Bail out for GEPs when index size > 64 bits.

Limit pointer decomposition to pointers with index sizes of at most 64
bits. int64_t is used for coefficients, so as long as the index size <=
64 bits we should be able to represent all pointer offsets.

Pointer decomposition is limited to inbounds GEPs, so if a index
computation would overflow the result is poison, so it doesn't matter
that the coefficient overflows.

This allows replacing MulOverflow with regular multiplications.
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll