1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[Analysis] Use llvm::append_range (NFC)

This commit is contained in:
Kazu Hirata 2021-01-22 23:25:01 -08:00
parent 5ecc45d24f
commit 94106f21e8
9 changed files with 13 additions and 27 deletions

View File

@ -652,8 +652,7 @@ bool BasicAAResult::pointsToConstantMemory(const MemoryLocation &Loc,
Visited.clear();
return AAResultBase::pointsToConstantMemory(Loc, AAQI, OrLocal);
}
for (Value *IncValue : PN->incoming_values())
Worklist.push_back(IncValue);
append_range(Worklist, PN->incoming_values());
continue;
}

View File

@ -190,8 +190,7 @@ DataDependenceGraph::DataDependenceGraph(Function &F, DependenceInfo &D)
// directions.
BasicBlockListType BBList;
for (auto &SCC : make_range(scc_begin(&F), scc_end(&F)))
for (BasicBlock * BB : SCC)
BBList.push_back(BB);
append_range(BBList, SCC);
std::reverse(BBList.begin(), BBList.end());
DDGBuilder(*this, D, BBList).populate();
}
@ -207,8 +206,7 @@ DataDependenceGraph::DataDependenceGraph(Loop &L, LoopInfo &LI,
LoopBlocksDFS DFS(&L);
DFS.perform(&LI);
BasicBlockListType BBList;
for (BasicBlock *BB : make_range(DFS.beginRPO(), DFS.endRPO()))
BBList.push_back(BB);
append_range(BBList, make_range(DFS.beginRPO(), DFS.endRPO()));
DDGBuilder(*this, D, BBList).populate();
}

View File

@ -498,8 +498,7 @@ void AbstractDependenceGraphBuilder<G>::sortNodesTopologically() {
size_t OldSize = Graph.Nodes.size();
Graph.Nodes.clear();
for (NodeType *N : reverse(NodesInPO))
Graph.Nodes.push_back(N);
append_range(Graph.Nodes, reverse(NodesInPO));
if (Graph.Nodes.size() != OldSize)
assert(false &&
"Expected the number of nodes to stay the same after the sort");

View File

@ -331,8 +331,7 @@ TrainingLogger::TrainingLogger(StringRef LogFileName,
FT.push_back(
{TensorSpec::createSpec<int64_t>(FeatureNameMap.at(I), {1}), None});
if (MUTR && MUTR->outputLoggedFeatureSpecs().size() > 1)
FT.insert(FT.end(), MUTR->outputLoggedFeatureSpecs().begin() + 1,
MUTR->outputLoggedFeatureSpecs().end());
append_range(FT, drop_begin(MUTR->outputLoggedFeatureSpecs()));
DefaultDecisionPos = FT.size();
FT.push_back(
@ -465,8 +464,7 @@ ModelUnderTrainingRunner::ModelUnderTrainingRunner(LLVMContext &Ctx,
for (size_t I = 0; I < NumberOfFeatures; ++I)
InputSpecs.push_back(
TensorSpec::createSpec<int64_t>(TFFeedPrefix + FeatureNameMap[I], {1}));
InputSpecs.insert(InputSpecs.end(), TrainingOnlyFeatures.begin(),
TrainingOnlyFeatures.end());
append_range(InputSpecs, TrainingOnlyFeatures);
if (auto MaybeOutSpecs =
loadOutputSpecs(Ctx, DecisionName, ModelPath, TFOutputSpecOverride))
OutputSpecs = std::move(*MaybeOutSpecs);

View File

@ -505,8 +505,7 @@ CacheCost::getCacheCost(Loop &Root, LoopStandardAnalysisResults &AR,
}
LoopVectorTy Loops;
for (Loop *L : breadth_first(&Root))
Loops.push_back(L);
append_range(Loops, breadth_first(&Root));
if (!getInnerMostLoop(Loops)) {
LLVM_DEBUG(dbgs() << "Cannot compute cache cost of loop nest with more "

View File

@ -42,8 +42,7 @@ static bool checkLoopsStructure(const Loop &OuterLoop, const Loop &InnerLoop,
LoopNest::LoopNest(Loop &Root, ScalarEvolution &SE)
: MaxPerfectDepth(getMaxPerfectDepth(Root, SE)) {
for (Loop *L : breadth_first(&Root))
Loops.push_back(L);
append_range(Loops, breadth_first(&Root));
}
std::unique_ptr<LoopNest> LoopNest::getLoopNest(Loop &Root,

View File

@ -752,8 +752,7 @@ MemoryDependenceResults::getNonLocalCallDependency(CallBase *QueryCall) {
} else {
// Seed DirtyBlocks with each of the preds of QueryInst's block.
BasicBlock *QueryBB = QueryCall->getParent();
for (BasicBlock *Pred : PredCache.get(QueryBB))
DirtyBlocks.push_back(Pred);
append_range(DirtyBlocks, PredCache.get(QueryBB));
++NumUncacheNonLocal;
}
@ -838,8 +837,7 @@ MemoryDependenceResults::getNonLocalCallDependency(CallBase *QueryCall) {
// If the block *is* completely transparent to the load, we need to check
// the predecessors of this block. Add them to our worklist.
for (BasicBlock *Pred : PredCache.get(DirtyBB))
DirtyBlocks.push_back(Pred);
append_range(DirtyBlocks, PredCache.get(DirtyBB));
}
}

View File

@ -631,8 +631,7 @@ MustBeExecutedContextExplorer::findForwardJoinPoint(const BasicBlock *InitBB) {
if (!TransfersExecution)
return nullptr;
for (const BasicBlock *AdjacentBB : successors(ToBB))
Worklist.push_back(AdjacentBB);
append_range(Worklist, successors(ToBB));
}
}

View File

@ -509,9 +509,7 @@ static bool isEphemeralValueOf(const Instruction *I, const Value *E) {
if (V == I || isSafeToSpeculativelyExecute(V)) {
EphValues.insert(V);
if (const User *U = dyn_cast<User>(V))
for (User::const_op_iterator J = U->op_begin(), JE = U->op_end();
J != JE; ++J)
WorkSet.push_back(*J);
append_range(WorkSet, U->operands());
}
}
}
@ -4209,8 +4207,7 @@ void llvm::getUnderlyingObjects(const Value *V,
// underlying objects.
if (!LI || !LI->isLoopHeader(PN->getParent()) ||
isSameUnderlyingObjectInLoop(PN, LI))
for (Value *IncValue : PN->incoming_values())
Worklist.push_back(IncValue);
append_range(Worklist, PN->incoming_values());
continue;
}