diff options
author | Chris Lattner <sabre@nondot.org> | 2007-04-17 17:52:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-04-17 17:52:45 +0000 |
commit | 8e8f86522791e0d3c74c72aa9f5040071592ef40 (patch) | |
tree | 151fb4a40c95db6e5c671143c0682c9338fd1821 /lib/Analysis/LoadValueNumbering.cpp | |
parent | a0e1b0e98da65db930dcd40af662e49f0257a269 (diff) |
Remove use of Instruction::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36201 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoadValueNumbering.cpp')
-rw-r--r-- | lib/Analysis/LoadValueNumbering.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp index 5188dae529..16687b0419 100644 --- a/lib/Analysis/LoadValueNumbering.cpp +++ b/lib/Analysis/LoadValueNumbering.cpp @@ -336,15 +336,18 @@ void LoadVN::getEqualNumberNodes(Value *V, // we see any candidate loads, then we know they have the same value # as LI. // bool LoadInvalidatedInBBAfter = false; - for (BasicBlock::iterator I = LI->getNext(); I != LoadBB->end(); ++I) { - // If this instruction is a load, then this instruction returns the same - // value as LI. - if (isa<LoadInst>(I) && cast<LoadInst>(I)->getOperand(0) == LoadPtr) - RetVals.push_back(I); + { + BasicBlock::iterator I = LI; + for (++I; I != LoadBB->end(); ++I) { + // If this instruction is a load, then this instruction returns the same + // value as LI. + if (isa<LoadInst>(I) && cast<LoadInst>(I)->getOperand(0) == LoadPtr) + RetVals.push_back(I); - if (AA.getModRefInfo(I, LoadPtr, LoadSize) & AliasAnalysis::Mod) { - LoadInvalidatedInBBAfter = true; - break; + if (AA.getModRefInfo(I, LoadPtr, LoadSize) & AliasAnalysis::Mod) { + LoadInvalidatedInBBAfter = true; + break; + } } } |