[ConstraintElim] Support `add nsw` for unsigned preds with positive ops.
authorFlorian Hahn <flo@fhahn.com>
Sun, 16 Oct 2022 19:24:16 +0000 (20:24 +0100)
committerFlorian Hahn <flo@fhahn.com>
Sun, 16 Oct 2022 19:25:14 +0000 (20:25 +0100)
commita4635ec7108c57adc248d203a39e809918a9d028
treec9ce4ad789ac038900cab612daaf01b45e7ef21c
parent3c5a164994b1777ab20f67762f61c878a70f6438
[ConstraintElim] Support `add nsw` for unsigned preds with positive ops.

If both operands of an `add nsw` are known positive, it can be treated
the same as `add nuw` and added to the unsigned system.

https://alive2.llvm.org/ce/z/6gprff
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/test/Transforms/ConstraintElimination/add-nsw.ll