[llvm] [StructurizeCFG] bug fix in zero cost hoist (PR #157969)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 11 01:41:27 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))
----------------
jayfoad wrote:
Do you still need the `== BB` check? Shouldn't it be subsumed by the `dominates` check?
https://github.com/llvm/llvm-project/pull/157969
More information about the llvm-commits
mailing list