aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Vectorize/SLPVectorizer.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-08-24 19:55:38 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-08-24 19:55:38 +0000
commitecc52e0c5b5a21f606e43febf2f65ca7daab1c97 (patch)
treedadf992ac0e7389277ffc543e3d46b71d7dd6146 /lib/Transforms/Vectorize/SLPVectorizer.cpp
parentf86778a84898b773c54e249a015be183acf13c30 (diff)
downloadexternal_llvm-ecc52e0c5b5a21f606e43febf2f65ca7daab1c97.zip
external_llvm-ecc52e0c5b5a21f606e43febf2f65ca7daab1c97.tar.gz
external_llvm-ecc52e0c5b5a21f606e43febf2f65ca7daab1c97.tar.bz2
Check if in set on insertion instead of separately
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189179 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r--lib/Transforms/Vectorize/SLPVectorizer.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp
index b1f097e..2610e24 100644
--- a/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -1161,13 +1161,11 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
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::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
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::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
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;