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.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp
index 37ab7ee7ff..3c70f735e8 100644
--- a/lib/Transforms/Utils/LCSSA.cpp
+++ b/lib/Transforms/Utils/LCSSA.cpp
@@ -215,6 +215,12 @@ void LCSSA::processInstruction(Instruction* Instr,
for (Instruction::use_iterator UI = Instr->use_begin(), UE = Instr->use_end();
UI != UE; ++UI) {
Instruction* use = cast<Instruction>(*UI);
+ BasicBlock* UserBB = use->getParent();
+ if (PHINode* p = dyn_cast<PHINode>(use)) {
+ unsigned OperandNo = UI.getOperandNo();
+ UserBB = p->getIncomingBlock(OperandNo/2);
+ }
+
// Don't need to update uses within the loop body.
if (!inLoop(use->getParent()))
Uses.push_back(use);