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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 15:41:31 PDT 2023


================
@@ -753,15 +774,23 @@ class ExtTSPImpl {
             BestGain = CurGain;
             BestChainPred = ChainPred;
             BestChainSucc = ChainSucc;
+            // Stop early when the merge is as good as the previous one.
----------------
MaskRay wrote:

If PrevScore is changed to a std::optional, add an `assert(!PrevScore || BestGain.score() > *PrevScore + EPS)`

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


More information about the llvm-commits mailing list