================
@@ -1030,6 +1036,11 @@ bool MachineBlockPlacement::isTrellis(
   SmallPtrSet<const MachineBasicBlock *, 8> SeenPreds;
 
   for (MachineBasicBlock *Succ : ViableSuccs) {
+    // Compile-time optimization: runtime is quadratic in the number of
+    // predecessors. For such uncommon cases, exit early.
+    if (Succ->pred_size() > PredecessorLimit)
----------------
spupyrev wrote:

Just to confirm I understand correctly: you have an example of (generated) IR 
where the runtime is large without the diff and is much smaller with the 
proposed change?
(I'm not familiar with this function but I don't see where quadratic complexity 
is.)

https://github.com/llvm/llvm-project/pull/142584
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to