diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-07-09 15:59:27 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-07-09 15:59:27 +0000 |
commit | 89f43a5c709c7ae88e338dca53c5c71e97acbb1c (patch) | |
tree | 6851df7d603ce9d1acabe7c74e2292f3f8e486eb /lib/Transforms/Utils/SSI.cpp | |
parent | 4c12ee5f612f5f67af9e7715dba44d28f9c03ad5 (diff) | |
download | external_llvm-89f43a5c709c7ae88e338dca53c5c71e97acbb1c.zip external_llvm-89f43a5c709c7ae88e338dca53c5c71e97acbb1c.tar.gz external_llvm-89f43a5c709c7ae88e338dca53c5c71e97acbb1c.tar.bz2 |
There's no need to consider PHI nodes in the same block as the instruction
we're inserting sigma/phi functions for. Patch by Andre Tavares.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SSI.cpp')
-rw-r--r-- | lib/Transforms/Utils/SSI.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/SSI.cpp b/lib/Transforms/Utils/SSI.cpp index caafb31..0585561 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; } |