[llvm] [StructurizeCFG] bug fix in zero cost hoist (PR #157969)

Vigneshwar Jayakumar via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 07:33:18 PDT 2025


================
@@ -435,24 +448,14 @@ static bool isHoistableInstruction(Instruction *I, BasicBlock *BB,
   // Check if any operands are instructions defined in the same block.
   for (auto &Op : I->operands()) {
     if (auto *OpI = dyn_cast<Instruction>(Op)) {
-      if (OpI->getParent() == BB)
+      if (OpI->getParent() == BB || !DT->dominates(OpI->getParent(), HoistTo))
----------------
VigneshwarJ wrote:

oh yes, updated.

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


More information about the llvm-commits mailing list