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])->
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()) {
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;