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 | ab81d2f5e93e5bdf5796505929a3b4114b288b11 (patch) | |
| tree | 5492209d929babfc6aad215076aebed73898f6aa /llvm/lib/Transforms/Utils | |
| parent | f747f092d1088da721b14257a6707ca3952f2a7c (diff) | |
| download | bcm5719-llvm-ab81d2f5e93e5bdf5796505929a3b4114b288b11.tar.gz bcm5719-llvm-ab81d2f5e93e5bdf5796505929a3b4114b288b11.zip | |
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.
llvm-svn: 75138
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/SSI.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SSI.cpp b/llvm/lib/Transforms/Utils/SSI.cpp index caafb318e8b..0585561a30b 100644 --- a/llvm/lib/Transforms/Utils/SSI.cpp +++ b/llvm/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; } |

