[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 06:26:38 PDT 2025


================
@@ -1286,6 +1290,11 @@ std::optional<bool> LoopInterchangeProfitability::isProfitableForVectorization(
 bool LoopInterchangeProfitability::isProfitable(
     const Loop *InnerLoop, const Loop *OuterLoop, unsigned InnerLoopId,
     unsigned OuterLoopId, CharMatrix &DepMatrix, CacheCostManager &CCM) {
+
+  // Return true if interchange is forced.
+  if (Profitabilities.size() == 1 && Profitabilities[0] == RuleTy::Ignore)
+    return true;
+
----------------
kasuga-fj wrote:

Unnecessary if we handle `RuleTy::Ignore` properly in the later switch statement.

https://github.com/llvm/llvm-project/pull/148858


More information about the llvm-commits mailing list