Depend on D129358.
Details
Diff Detail
Unit Tests
Event Timeline
I think this is correct as written, but also confusing. It would make more sense to me if for fptoui we used getUnsignedRange() and getActiveBits() and for fptosi used getSignedRange() and getMinSignedBits().
llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll | ||
---|---|---|
182 | We should be testing negative ranges as well -- in this case, they would actually be not legal. |
llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll | ||
---|---|---|
182 | for unsigned type induction, negative ranges will be determined true at very early pass, so we don't need check it ? |
update according comment
fptoui we used getUnsignedRange() and getActiveBits()
fptosi used getSignedRange() and getMinSignedBits()
LGTM
The last step here would be to deal with different sizes between the itofp and fptoi with trunc or sext/zext.
llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll | ||
---|---|---|
182 | Passes need to be correct in isolation, so I think it is important to still test that case here, even if it gets transformed earlier in the full pipeline. |
llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll | ||
---|---|---|
182 | Done, thanks |
We should be testing negative ranges as well -- in this case, they would actually be not legal.