mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 15:39:06 +00:00
Reduce double set lookups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219505 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
836ca75dd7
commit
d62c4bac66
@ -172,9 +172,7 @@ ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
|
||||
DomSetType &S = this->Frontiers[currentBB];
|
||||
|
||||
// Visit each block only once.
|
||||
if (visited.count(currentBB) == 0) {
|
||||
visited.insert(currentBB);
|
||||
|
||||
if (visited.insert(currentBB)) {
|
||||
// Loop over CFG successors to calculate DFlocal[currentNode]
|
||||
for (auto SI = BlockTraits::child_begin(currentBB),
|
||||
SE = BlockTraits::child_end(currentBB);
|
||||
|
@ -165,10 +165,10 @@ private:
|
||||
//
|
||||
bool ProcessInterval(NodeTy *Node) {
|
||||
BasicBlock *Header = getNodeHeader(Node);
|
||||
if (Visited.count(Header)) return false;
|
||||
if (!Visited.insert(Header).second)
|
||||
return false;
|
||||
|
||||
Interval *Int = new Interval(Header);
|
||||
Visited.insert(Header); // The header has now been visited!
|
||||
|
||||
// Check all of our successors to see if they are in the interval...
|
||||
for (typename GT::ChildIteratorType I = GT::child_begin(Node),
|
||||
|
@ -257,11 +257,8 @@ static void AntiDepEdges(const SUnit *SU, std::vector<const SDep*>& Edges) {
|
||||
for (SUnit::const_pred_iterator P = SU->Preds.begin(), PE = SU->Preds.end();
|
||||
P != PE; ++P) {
|
||||
if ((P->getKind() == SDep::Anti) || (P->getKind() == SDep::Output)) {
|
||||
unsigned Reg = P->getReg();
|
||||
if (RegSet.count(Reg) == 0) {
|
||||
if (RegSet.insert(P->getReg()))
|
||||
Edges.push_back(&*P);
|
||||
RegSet.insert(Reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -615,8 +612,7 @@ bool AggressiveAntiDepBreaker::FindSuitableFreeRegisters(
|
||||
|
||||
DEBUG(dbgs() << "\tFind Registers:");
|
||||
|
||||
if (RenameOrder.count(SuperRC) == 0)
|
||||
RenameOrder.insert(RenameOrderType::value_type(SuperRC, Order.size()));
|
||||
RenameOrder.insert(RenameOrderType::value_type(SuperRC, Order.size()));
|
||||
|
||||
unsigned OrigR = RenameOrder[SuperRC];
|
||||
unsigned EndR = ((OrigR == Order.size()) ? 0 : OrigR);
|
||||
|
@ -410,9 +410,9 @@ std::error_code readCoverageMappingData(
|
||||
// function name.
|
||||
// This is useful to ignore the redundant records for the functions
|
||||
// with ODR linkage.
|
||||
if (UniqueFunctionMappingData.count(MappingRecord.FunctionNamePtr))
|
||||
if (!UniqueFunctionMappingData.insert(MappingRecord.FunctionNamePtr)
|
||||
.second)
|
||||
continue;
|
||||
UniqueFunctionMappingData.insert(MappingRecord.FunctionNamePtr);
|
||||
StringRef FunctionName;
|
||||
if (auto Err =
|
||||
ProfileNames.get(MappingRecord.FunctionNamePtr,
|
||||
|
@ -88,12 +88,9 @@ void VisitGlobalVariableForEmission(
|
||||
return;
|
||||
|
||||
// Do we have a circular dependency?
|
||||
if (Visiting.count(GV))
|
||||
if (!Visiting.insert(GV).second)
|
||||
report_fatal_error("Circular dependency found in global variable set");
|
||||
|
||||
// Start visiting this global
|
||||
Visiting.insert(GV);
|
||||
|
||||
// Make sure we visit all dependents first
|
||||
DenseSet<const GlobalVariable *> Others;
|
||||
for (unsigned i = 0, e = GV->getNumOperands(); i != e; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user