aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SSI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/SSI.cpp')
-rw-r--r--lib/Transforms/Utils/SSI.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/SSI.cpp b/lib/Transforms/Utils/SSI.cpp
index caafb318e8..0585561a30 100644
--- a/lib/Transforms/Utils/SSI.cpp
+++ b/lib/Transforms/Utils/SSI.cpp
@@ -282,12 +282,16 @@ void SSI::substituteUse(Instruction *I) {
}
/// Test if the BasicBlock BB dominates any use or definition of value.
+/// If it dominates a phi instruction that is on the same BasicBlock,
+/// that does not count.
///
bool SSI::dominateAny(BasicBlock *BB, Instruction *value) {
for (Value::use_iterator begin = value->use_begin(),
end = value->use_end(); begin != end; ++begin) {
Instruction *I = cast<Instruction>(*begin);
BasicBlock *BB_father = I->getParent();
+ if (BB == BB_father && isa<PHINode>(I))
+ continue;
if (DT_->dominates(BB, BB_father)) {
return true;
}