aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-08-11 10:19:19 +0200
committerNikita Popov <npopov@redhat.com>2023-08-11 10:20:46 +0200
commit421577f539c79808fdcd9f372b7182f20b3c65a2 (patch)
tree09fe3cf7e1fe63aed918cad878b0f3676225a953 /llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
parent23e5130ebfe140d865f16b5d2dd6cd8a670379da (diff)
downloadllvm-421577f539c79808fdcd9f372b7182f20b3c65a2.zip
llvm-421577f539c79808fdcd9f372b7182f20b3c65a2.tar.gz
llvm-421577f539c79808fdcd9f372b7182f20b3c65a2.tar.bz2
Revert "[CHR] Fix up phi nodes with unreachable predecessors (PR64594)"
This reverts commit cfc9298dc588c626a52193260da28a630e103916. The newly added test fails under EXPENSIVE_CHECKS, revert while I investigate.
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
index 478e45b..3e3be53 100644
--- a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
@@ -1777,21 +1777,6 @@ void CHR::cloneScopeBlocks(CHRScope *Scope,
BasicBlock *NewBB = CloneBasicBlock(BB, VMap, ".nonchr", &F);
NewBlocks.push_back(NewBB);
VMap[BB] = NewBB;
-
- // Unreachable predecessors will not be cloned and will not have an edge
- // to the cloned block. As such, also remove them from any phi nodes.
- // To avoid iterator invalidation, first collect the dead predecessors
- // from the first phi node, and then perform the actual removal.
- SmallVector<BasicBlock *> DeadPreds;
- for (PHINode &PN : NewBB->phis()) {
- for (BasicBlock *Pred : PN.blocks())
- if (!DT.isReachableFromEntry(Pred))
- DeadPreds.push_back(Pred);
- break;
- }
- for (PHINode &PN : make_early_inc_range(NewBB->phis()))
- for (BasicBlock *Pred : DeadPreds)
- PN.removeIncomingValue(Pred);
}
// Place the cloned blocks right after the original blocks (right before the