llvm.org GIT mirror llvm / 9f9dcf8
Reduce double set lookups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230798 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 5 years ago
3 changed file(s) with 3 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
112112 while (It != GT::child_end(Node)) {
113113 NodeType *Next = *It++;
114114 // Has our next sibling been visited?
115 if (Next && !this->Visited.count(Next)) {
115 if (Next && this->Visited.insert(Next).second) {
116116 // No, do it now.
117 this->Visited.insert(Next);
118117 VisitStack.push_back(std::make_pair(PointerIntTy(Next, 0),
119118 GT::child_begin(Next)));
120119 return;
345345 /// Push BV onto BlockValueStack unless it's already in there.
346346 /// Returns true on success.
347347 bool pushBlockValue(const std::pair &BV) {
348 if (BlockValueSet.count(BV))
348 if (!BlockValueSet.insert(BV).second)
349349 return false; // It's already in the stack.
350350
351351 BlockValueStack.push(BV);
352 BlockValueSet.insert(BV);
353352 return true;
354353 }
355354
621621 void removeValue(const Value *V) {
622622 // This is to support hack in lowerCallFromStatepoint
623623 // Should be removed when hack is resolved
624 if (NodeMap.count(V))
625 NodeMap.erase(V);
624 NodeMap.erase(V);
626625 }
627626
628627 void setUnusedArgValue(const Value *V, SDValue NewN) {