diff options
Diffstat (limited to 'polly/lib/Analysis/TempScopInfo.cpp')
-rw-r--r-- | polly/lib/Analysis/TempScopInfo.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp index c0f19f136c2..897ed261800 100644 --- a/polly/lib/Analysis/TempScopInfo.cpp +++ b/polly/lib/Analysis/TempScopInfo.cpp @@ -105,15 +105,14 @@ bool TempScopInfo::buildScalarDependences(Instruction *Inst, Region *R) { bool AnyCrossStmtUse = false; BasicBlock *ParentBB = Inst->getParent(); - for (Instruction::use_iterator UI = Inst->use_begin(), UE = Inst->use_end(); - UI != UE; ++UI) { - Instruction *U = dyn_cast<Instruction>(*UI); + for (User *U : Inst->users()) { + Instruction *UI = dyn_cast<Instruction>(U); // Ignore the strange user - if (U == 0) + if (UI == 0) continue; - BasicBlock *UseParent = U->getParent(); + BasicBlock *UseParent = UI->getParent(); // Ignore the users in the same BB (statement) if (UseParent == ParentBB) @@ -121,7 +120,7 @@ bool TempScopInfo::buildScalarDependences(Instruction *Inst, Region *R) { // No need to translate these scalar dependences into polyhedral form, // because synthesizable scalars can be generated by the code generator. - if (canSynthesize(U, LI, SE, R)) + if (canSynthesize(UI, LI, SE, R)) continue; // Now U is used in another statement. @@ -131,12 +130,12 @@ bool TempScopInfo::buildScalarDependences(Instruction *Inst, Region *R) { if (!R->contains(UseParent)) continue; - assert(!isa<PHINode>(U) && "Non synthesizable PHINode found in a SCoP!"); + assert(!isa<PHINode>(UI) && "Non synthesizable PHINode found in a SCoP!"); // Use the def instruction as base address of the IRAccess, so that it will // become the name of the scalar access in the polyhedral form. IRAccess ScalarAccess(IRAccess::SCALARREAD, Inst, ZeroOffset, 1, true); - AccFuncMap[UseParent].push_back(std::make_pair(ScalarAccess, U)); + AccFuncMap[UseParent].push_back(std::make_pair(ScalarAccess, UI)); } return AnyCrossStmtUse; |