[llvm] r189179 - Check if in set on insertion instead of separately
Matt Arsenault
Matthew.Arsenault at amd.com
Sat Aug 24 12:55:38 PDT 2013
Author: arsenm
Date: Sat Aug 24 14:55:38 2013
New Revision: 189179
URL: http://llvm.org/viewvc/llvm-project?rev=189179&view=rev
Log:
Check if in set on insertion instead of separately
Modified:
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=189179&r1=189178&r2=189179&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Sat Aug 24 14:55:38 2013
@@ -1161,13 +1161,11 @@ Value *BoUpSLP::vectorizeTree(TreeEntry
ValueList Operands;
BasicBlock *IBB = PH->getIncomingBlock(i);
- if (VisitedBBs.count(IBB)) {
+ if (!VisitedBBs.insert(IBB)) {
NewPhi->addIncoming(NewPhi->getIncomingValueForBlock(IBB), IBB);
continue;
}
- VisitedBBs.insert(IBB);
-
// Prepare the operand vector.
for (unsigned j = 0; j < E->Scalars.size(); ++j)
Operands.push_back(cast<PHINode>(E->Scalars[j])->
@@ -1851,9 +1849,8 @@ bool SLPVectorizer::vectorizeChainsInBlo
break;
// We may go through BB multiple times so skip the one we have checked.
- if (VisitedInstrs.count(instr))
+ if (!VisitedInstrs.insert(instr))
continue;
- VisitedInstrs.insert(instr);
// Stop constructing the list when you reach a different type.
if (Incoming.size() && P->getType() != Incoming[0]->getType()) {
@@ -1879,9 +1876,8 @@ bool SLPVectorizer::vectorizeChainsInBlo
for (BasicBlock::iterator it = BB->begin(), e = BB->end(); it != e; it++) {
// We may go through BB multiple times so skip the one we have checked.
- if (VisitedInstrs.count(it))
+ if (!VisitedInstrs.insert(it))
continue;
- VisitedInstrs.insert(it);
if (isa<DbgInfoIntrinsic>(it))
continue;
More information about the llvm-commits
mailing list