[ConstraintElimination] Use ZExtValue for unsigned decomposition.
authorFlorian Hahn <flo@fhahn.com>
Mon, 7 Mar 2022 13:33:50 +0000 (13:33 +0000)
committerFlorian Hahn <flo@fhahn.com>
Mon, 7 Mar 2022 13:34:01 +0000 (13:34 +0000)
commit4bbee17ecb00bcdf43a43650a64172a4d9eb130c
tree1ba3359a180c7b625297e5435bd472c906dc1243
parent873e630d6cdb5a2678d3439edac30cfa3f09e481
[ConstraintElimination] Use ZExtValue for unsigned decomposition.

When decomposing constraints for unsigned conditions, we can use
negative values by zero-extending them, as long as they are less than
the maximum constraint value.

Fixes https://github.com/llvm/llvm-project/issues/54224
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/test/Transforms/ConstraintElimination/add-nuw.ll