This is a follow-up from discussion in D138412. Sometimes we want to evaluate
the cost of expansion of several SCEVs together with same budget. For example,
if one of them is a bit above cheap limit, and the second one is free, then
we still want to expand. Checking each of them with "cheap" limit is a bit more
pessimistic.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h | ||
---|---|---|
226 | I was thinking Budget should be a non-const-ref, |
llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h | ||
---|---|---|
226 | I think it should be fine, let's try it out. |
llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h | ||
---|---|---|
226 | Let's leave it as is. The issue I'm seeing is that the estimate is done in terms of scaled budget, and there is no clear translation of scaled budget back into the normal one (division is lossy). |
While i do think that the suggestion would be useful,
this is better than nothing
llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h | ||
---|---|---|
226 | As far as i'm concerned TargetTransformInfo::TCC_Basic is always 1, |
I was thinking Budget should be a non-const-ref,
and we should just subtract the computed cost from it
if we return false from this function.
Would that be worse?