diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp | 6 | 
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp index 776b8f9b966..f8f18b21735 100644 --- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -735,13 +735,11 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr,      worklist.pop_back();      // Break use-def graph loops. -    if (Visited.count(V)) { +    if (!Visited.insert(V)) {        Consensus = 0;        break;      } -    Visited.insert(V); -          // For a PHI node, push all of its incoming values.      if (PHINode *P = dyn_cast<PHINode>(V)) {        for (unsigned i = 0, e = P->getNumIncomingValues(); i != e; ++i) @@ -752,7 +750,7 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr,      // For non-PHIs, determine the addressing mode being computed.      SmallVector<Instruction*, 16> NewAddrModeInsts;      ExtAddrMode NewAddrMode = -      AddressingModeMatcher::Match(V, AccessTy,MemoryInst, +      AddressingModeMatcher::Match(V, AccessTy, MemoryInst,                                     NewAddrModeInsts, *TLI);      // This check is broken into two cases with very similar code to avoid using  | 

