[llvm] [CodeLayout] Faster basic block reordering, ext-tsp (PR #68617)

Rahman Lavaee via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 12:38:37 PDT 2023


================
@@ -734,14 +743,25 @@ class ExtTSPImpl {
         // Get candidates for merging with the current chain.
         for (const auto &[ChainSucc, Edge] : ChainPred->Edges) {
           // Ignore loop edges.
-          if (ChainPred == ChainSucc)
+          if (Edge->isSelfEdge())
             continue;
-
           // Stop early if the combined chain violates the maximum allowed size.
           if (ChainPred->numBlocks() + ChainSucc->numBlocks() >= MaxChainSize)
             continue;
+          // Don't merge the chains if they have vastly different densities.
+          // We stop early if the ratio between the densities exceeds
----------------
rlavaee wrote:

Skip rather than stop?

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


More information about the llvm-commits mailing list