[llvm] [JumpThreading] Thread over BB with only an unconditional branch (PR #86312)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 23:56:07 PDT 2024


================
@@ -1013,12 +1013,14 @@ CanRedirectPredsOfEmptyBBToSucc(BasicBlock *BB, BasicBlock *Succ,
                                 const SmallPtrSetImpl<BasicBlock *> &SuccPreds,
                                 BasicBlock *&CommonPred) {
 
-  // There must be phis in BB, otherwise BB will be merged into Succ directly
-  if (BB->phis().empty() || Succ->phis().empty())
+  // Only handle the nontrivial case. Assume we need to update the phi of succ
+  // here.
----------------
dtcxzyw wrote:

I think the original comment is easier to understand than this one.

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


More information about the llvm-commits mailing list