[llvm] [DFAJumpThreading] Constraint the number of cloned instructions (PR #161632)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 13:04:47 PDT 2025


================
@@ -901,6 +909,22 @@ struct TransformDFA {
       }
     }
 
+    // Too much cloned instructions slow down later optimizations, especially
+    // SLPVectorizer.
+    // TODO: Thread the switch partially before reaching the threshold.
+    uint64_t NumOrigInst = 0;
+    for (auto *BB : DuplicateMap.keys())
+      NumOrigInst += range_size(*BB);
----------------
efriedma-quic wrote:

Please use BasicBlock::sizeWithoutDebug for checks like this.

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


More information about the llvm-commits mailing list