This patch enables AAValueSimplify to use information from AAPotentialValues
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/IPO/AttributorAttributes.cpp | ||
---|---|---|
4487 | 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 | ||
---|---|---|
4487 |
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 | ||
---|---|---|
4484 | Nit: Even better if we add a dependence only if we use the result, in either case, OPTIONAL is the right kind :) | |
4491 | You don't need an else after return, that should bring all the indention to a single level here. | |
4497 | 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 :)