aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LCSSA.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r--lib/Transforms/Utils/LCSSA.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp
index 43c9678cd0..21f9352637 100644
--- a/lib/Transforms/Utils/LCSSA.cpp
+++ b/lib/Transforms/Utils/LCSSA.cpp
@@ -177,7 +177,7 @@ void LCSSA::ProcessInstruction(Instruction *Instr,
}
// If the user is in the loop, don't rewrite it!
- if (inLoop(UserBB)) {
+ if (UserBB == Instr->getParent() || inLoop(UserBB)) {
++UI;
continue;
}
@@ -215,7 +215,7 @@ SetVector<Instruction*> LCSSA::getLoopValuesUsedOutsideLoop(Loop *L) {
UserBB = p->getIncomingBlock(OperandNo/2);
}
- if (!inLoop(UserBB)) {
+ if (*BB != UserBB && !inLoop(UserBB)) {
AffectedValues.insert(I);
break;
}