This patch enables AAValueSimplify to use information from AAPotentialValues
Details
Diff Detail
Event Timeline
llvm/lib/Transforms/IPO/AttributorAttributes.cpp | ||
---|---|---|
4493 | I'm not sure we need/want this failAll flag. Can't we just return true, given that ::None is the right simplified value in that case? With the current setup we will always call AAPotentialValues, even if the range analysis would determine a constant result eventually. |
llvm/lib/Transforms/IPO/AttributorAttributes.cpp | ||
---|---|---|
4493 |
I thought llvm::None is a weaker result than concrete ConstantInt values, but that was my mistake. I'll fix this. |
LGTM, some minor nits to consider.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp | ||
---|---|---|
4488 | Nit: Even better if we add a dependence only if we use the result, in either case, OPTIONAL is the right kind :) | |
4502 | You don't need an else after return, that should bring all the indention to a single level here. | |
4508 | early exits: if (ask...) return true; if (ask...) return true; return false; |
I'm sorry for forgetting to include changes in tests. There are changes in the number of iterations only.
And I moved PotentialValuesState's change to this because the bug in there causes a wrong value simplification.
Nit: Even better if we add a dependence only if we use the result, in either case, OPTIONAL is the right kind :)