[llvm] [SimplifyCFG] Use hash map to continue hoisting the common instructions (PR #78615)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 11:29:21 PDT 2024


================
@@ -1608,16 +1622,42 @@ bool SimplifyCFGOpt::hoistCommonCodeFromSuccessors(BasicBlock *BB,
 
   auto *TI = BB->getTerminator();
 
+  SmallVector<BasicBlock *, 8> SuccessorBBs;
+  for (auto *Succ : successors(BB)) {
+    // If we find an unreachable instruction at the beginning of a basic block,
+    // we can still hoist instructions from the rest of the basic blocks.
----------------
goldsteinn wrote:

Can you put the `hasAddressTaken` check in this loop?

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


More information about the llvm-commits mailing list