[ConstraintElimination] Make decompose() infallible
authorNikita Popov <npopov@redhat.com>
Fri, 11 Nov 2022 16:02:40 +0000 (17:02 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 14 Nov 2022 09:42:04 +0000 (10:42 +0100)
commit30982a595da66c4224ca0c2601fbad16ce75a78a
tree27f5fb92e2acab181b313a60c1f8dc9ec6332b68
parent7a1bd01493ad873e2c0f6d01d619adddba906968
[ConstraintElimination] Make decompose() infallible

decompose() currently returns a mix of {} and 0 + 1*V on failure.
This changes it to always return the 0 + 1*V form, thus making
decompose() infallible.

This makes the code marginally more powerful, e.g. we now fold
sub_decomp_i80 by treating the constant as a symbolic value.

Differential Revision: https://reviews.llvm.org/D137847
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll