diff options
-rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Target/TargetRecip.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 10 |
7 files changed, 15 insertions, 25 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index e23cd819f07..9f96cbaf8a5 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -365,9 +365,8 @@ MemoryDependenceResults::getInvariantGroupPointerDependency(LoadInst *LI, continue; if (auto *BCI = dyn_cast<BitCastInst>(Ptr)) { - if (!Seen.count(BCI->getOperand(0))) { + if (Seen.insert(BCI->getOperand(0)).second) { LoadOperandsQueue.push_back(BCI->getOperand(0)); - Seen.insert(BCI->getOperand(0)); } } @@ -377,9 +376,8 @@ MemoryDependenceResults::getInvariantGroupPointerDependency(LoadInst *LI, continue; if (auto *BCI = dyn_cast<BitCastInst>(U)) { - if (!Seen.count(BCI)) { + if (Seen.insert(BCI).second) { LoadOperandsQueue.push_back(BCI); - Seen.insert(BCI); } continue; } diff --git a/llvm/lib/CodeGen/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues.cpp index 1297273ee5b..4ff88d52810 100644 --- a/llvm/lib/CodeGen/LiveDebugValues.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues.cpp @@ -487,8 +487,7 @@ bool LiveDebugValues::ExtendRanges(MachineFunction &MF) { if (OLChanged) { OLChanged = false; for (auto s : MBB->successors()) - if (!OnPending.count(s)) { - OnPending.insert(s); + if (OnPending.insert(s).second) { Pending.push(BBToOrder[s]); } } diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 9be0daada50..5ada72f9f94 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -1604,7 +1604,8 @@ protected: E = SortedCategories.end(); Category != E; ++Category) { // Hide empty categories for -help, but show for -help-hidden. - bool IsEmptyCategory = CategorizedOptions[*Category].size() == 0; + const auto &CategoryOptions = CategorizedOptions[*Category]; + bool IsEmptyCategory = CategoryOptions.empty(); if (!ShowHidden && IsEmptyCategory) continue; @@ -1625,11 +1626,8 @@ protected: continue; } // Loop over the options in the category and print. - for (std::vector<Option *>::const_iterator - Opt = CategorizedOptions[*Category].begin(), - E = CategorizedOptions[*Category].end(); - Opt != E; ++Opt) - (*Opt)->printOptionInfo(MaxArgLen); + for (const Option *Opt : CategoryOptions) + Opt->printOptionInfo(MaxArgLen); } } }; diff --git a/llvm/lib/Target/TargetRecip.cpp b/llvm/lib/Target/TargetRecip.cpp index 97662f72afe..183fa5062ea 100644 --- a/llvm/lib/Target/TargetRecip.cpp +++ b/llvm/lib/Target/TargetRecip.cpp @@ -156,9 +156,10 @@ void TargetRecip::parseIndividualParams(const std::vector<std::string> &Args) { // If the precision was not specified, the double entry is also initialized. if (Val.back() != 'f' && Val.back() != 'd') { - RecipMap[Val.str() + 'd'].Enabled = !IsDisabled; + RecipParams &Params = RecipMap[Val.str() + 'd']; + Params.Enabled = !IsDisabled; if (!RefStepString.empty()) - RecipMap[Val.str() + 'd'].RefinementSteps = RefSteps; + Params.RefinementSteps = RefSteps; } } } diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp index 1cadab625b0..029178388b7 100644 --- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp +++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -277,9 +277,8 @@ static void scanOneBB(Instruction *Start, Instruction *End, if (BBI->isTerminator()) { BasicBlock *BB = BBI->getParent(); for (BasicBlock *Succ : successors(BB)) { - if (Seen.count(Succ) == 0) { + if (Seen.insert(Succ).second) { Worklist.push_back(Succ); - Seen.insert(Succ); } } } diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 21c0c9d97ab..fe15d17212c 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -2616,9 +2616,8 @@ static void recomputeLiveInValues(GCPtrLivenessData &RevisedLivenessData, // We may have base pointers which are now live that weren't before. We need // to update the PointerToBase structure to reflect this. for (auto V : Updated) - if (!Info.PointerToBase.count(V)) { + if (Info.PointerToBase.insert(std::make_pair(V, V)).second) { assert(Bases.count(V) && "can't find base for unexpected live value"); - Info.PointerToBase[V] = V; continue; } diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp index 675614dca95..802b3e476aa 100644 --- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp +++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp @@ -311,11 +311,7 @@ void StructurizeCFG::orderNodes() { for (RegionNode *RN : TempOrder) { BasicBlock *BB = RN->getEntry(); Loop *Loop = LI->getLoopFor(BB); - if (!LoopBlocks.count(Loop)) { - LoopBlocks[Loop] = 1; - continue; - } - LoopBlocks[Loop]++; + ++LoopBlocks[Loop]; } unsigned CurrentLoopDepth = 0; @@ -333,11 +329,11 @@ void StructurizeCFG::orderNodes() { // the outer loop. RNVector::iterator LoopI = I; - while(LoopBlocks[CurrentLoop]) { + while (unsigned &BlockCount = LoopBlocks[CurrentLoop]) { LoopI++; BasicBlock *LoopBB = (*LoopI)->getEntry(); if (LI->getLoopFor(LoopBB) == CurrentLoop) { - LoopBlocks[CurrentLoop]--; + --BlockCount; Order.push_back(*LoopI); } } |