[ConstraintElim] Replace custom GEP index handling by using existing code
authorFlorian Hahn <flo@fhahn.com>
Sun, 16 Oct 2022 20:53:11 +0000 (21:53 +0100)
committerFlorian Hahn <flo@fhahn.com>
Sun, 16 Oct 2022 20:53:11 +0000 (21:53 +0100)
commitaec0c1009fc4f87fc0c0f47d30eb2a7c12c5c27c
tree66ef25d5a7f6dcb520cbd68d3d855ba7838158cb
parent3baadff896eddfa09fcd458d120bac95491992a7
[ConstraintElim] Replace custom GEP index handling by using existing code

Instead of duplicating the existing decomposition code for GEP indices
just use the existing code by calling the existing decompose function on
the index expression and multiply the result's coefficients by the scale of
the index.

This both reduces code duplication and generalizes the pattern we can
handle.
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/test/Transforms/ConstraintElimination/gep-arithmetic-different-types.ll
llvm/test/Transforms/ConstraintElimination/geps-unsigned-predicates.ll
llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll