Currently, the assumed range is taken union with a new known range in IntegerRangeState::unionKnown.
However, that is unnecessary because an assumed range is guaranteed to be subsumed by a known range.
Details
Diff Detail
Event Timeline
llvm/test/Transforms/Attributor/range.ll | ||
---|---|---|
2 | An assumed range for the argument %depth of @rec in this test grows one by one during iterations. So we need a very big number of iterations to reach a fixpoint and I have difficulty in using attributor-max-iterations-verify option here. |
llvm/test/Transforms/Attributor/range.ll | ||
---|---|---|
2 | You have to detect this and abort. We have similar situations in other places, e.g. dereferenceability and alignment, take a look and give it a try, we can discuss this further as well. |
llvm/test/Transforms/Attributor/range.ll | ||
---|---|---|
2 | I understood that circular reasoning was caught by traversing values with stripAndAccumulateMinimalOffsets in AADereferenceable. To catch such circular reasoning in AAValueConstantRange, I think we need to track the dependence graph. (i.e. we need to check if there is a loop that contains the considered AA.) |
llvm/test/Transforms/Attributor/range.ll | ||
---|---|---|
2 | I might be wrong but I think the current reasoning around stripAndAccumulateMinimalOffsets looks unsound since we can say "Value V is in the range of [L, R]" by using ConstantRangeAA but not "Value V must become L in the execution". |
An assumed range for the argument %depth of @rec in this test grows one by one during iterations. So we need a very big number of iterations to reach a fixpoint and I have difficulty in using attributor-max-iterations-verify option here.