llvm-project
9250d4e7 - [ValueTracking] Extend computeConstantRange for add/sub, sext/zext/trunc

Commit
4 days ago
[ValueTracking] Extend computeConstantRange for add/sub, sext/zext/trunc Recursively compute operand ranges for add/sub and propagate ranges through sext/zext/trunc. For add/sub, the computed range is intersected with any existing range from setLimitsForBinOp, and NSW/NUW flags are used via addWithNoWrap/ subWithNoWrap to tighten bounds. The motivation is to enable further folding of reduce.add expressions in comparisons, where the result range can be bounded by the input element ranges. Compile-time impact on llvm-test-suite is <0.1% mean.
Author
Committer
Parents
Loading