[llvm] [SimplifyCFG][NFC] Improve compile time for TryToSimplifyUncondBranchFromEmptyBlock optimization. (PR #110715)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 13:01:45 PDT 2024


================
@@ -1182,6 +1184,10 @@ bool llvm::TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
   if ((!BBKillable && !BBPhisMergeable) || introduceTooManyPhiEntries(BB, Succ))
     return false;
 
+  // SuccPreds may not have been fully filled by CanRedirectPredsOfEmptyBBToSucc
+  // so finish it here.
+  SuccPreds.insert(pred_begin(Succ), pred_end(Succ));
----------------
aemerson wrote:

Sure, I think you're right.

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


More information about the llvm-commits mailing list