[PATCH] D124926: [LoopInterchange] New cost model for loop interchange
Bardia Mahjour via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 3 07:15:02 PDT 2022
bmahjour added a comment.
> Having all tests depend on a single target is not ideal, because this limits the number of bots/configurations that run the tests. I think we need a way to keep most of the tests independent of the PowerPC or any other target and only have tests that explicitly test the cost-modeling depend on the target.
The analysis uses `getCacheLineSize()` which returns 0 by default unless a subtarget overrides it. I think value 0 is meant for machines with no cache model (in which case loop interchange will likely not matter). Ideally all other targets should implement this function, but for the time being two ways I can think of to solve this without making the tests target-dependent are:
1. Define an option-controlled CacheLineSize inside `LoopCacheAnalysis.cpp` (with a default of say 64). If the option is specified we use the value supplied otherwise, we call `getCacheLineSize()` and use the value if it's non zero, or fall-back to the default value in case of zero.
2. Halt the analysis and invalidate the result when `getCacheLineSize()` returns zero. Clients must check the validity of result before using it, or query if the analysis can be computed for the specified target. This looks undesirable to me, since it makes the analysis less consumable. Also there seem to be targets that can benefit from interchange but just haven't implemented `getCacheLineSize()` yet.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124926/new/
https://reviews.llvm.org/D124926
More information about the llvm-commits
mailing list