[llvm] [LoopInterchange] Ignore the cost-model, force interchange if legal (PR #148858)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 17 08:06:36 PDT 2025
================
@@ -106,7 +107,10 @@ static cl::list<RuleTy> Profitabilities(
clEnumValN(RuleTy::PerInstrOrderCost, "instorder",
"Prioritize the IVs order of each instruction"),
clEnumValN(RuleTy::ForVectorization, "vectorize",
- "Prioritize vectorization")));
+ "Prioritize vectorization"),
+ clEnumValN(RuleTy::Ignore, "ignore",
+ "Ignore profitability, force interchange (does not "
+ "work with other options)")));
----------------
kasuga-fj wrote:
As mentioned in another comment, the force interchange option can lead to odd transformations regardless of the interface. So I think it's acceptable if it is a bit rough. Given that, I preferred adding a new entry to `-loop-interchange-profitabilities` over introducing a new option like `-loop-interchange-force`, as it seemed easier to work with overall. I didn't intend adding some special handling for `RuleTy::Ignore` distinct from other rules.
If you prefer to reject cases like `option-a,option-b,...,ignore`, I think that's also fine. However, it would be good to add validation and provide some form of user notification (e.g., a debug message).
https://github.com/llvm/llvm-project/pull/148858
More information about the llvm-commits
mailing list