add nsw with negative constants can be used for reasoning, if the
first operand is larger or equal to the subtracted constant. Then the
value won't cross 0.
Add a precondition to ensure that.
Paths
| Differential D138416
[ConstraintElim] Support add nsw with negative constants. Needs ReviewPublic Authored by fhahn on Nov 21 2022, 4:03 AM.
Details
Diff Detail
Unit TestsFailed Event TimelineComment Actions Looks like gep-arithmetic-add.ll fails in pre-commit CI.
Revision Contents
Diff 476854 llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/test/Transforms/ConstraintElimination/add-nsw.ll
|
Is this correct if C is INT_MIN?