From e3b557809604d036af6e00c60f012c2025b59a5e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 11 Feb 2023 13:38:04 +0100 Subject: Vendor import of llvm-project main llvmorg-16-init-18548-gb0daacf58f41, the last commit before the upstream release/17.x branch was created. --- llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp') diff --git a/llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp b/llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp index c2fa4466eab6..0388725dfb63 100644 --- a/llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp +++ b/llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp @@ -67,7 +67,7 @@ void SpeculateQuery::findCalles(const BasicBlock *BB, } bool SpeculateQuery::isStraightLine(const Function &F) { - return llvm::all_of(F.getBasicBlockList(), [](const BasicBlock &BB) { + return llvm::all_of(F, [](const BasicBlock &BB) { return BB.getSingleSuccessor() != nullptr; }); } @@ -97,7 +97,7 @@ BlockFreqQuery::ResultTy BlockFreqQuery::operator()(Function &F) { auto IBBs = findBBwithCalls(F); if (IBBs.empty()) - return None; + return std::nullopt; auto &BFI = FAM.getResult(F); @@ -136,7 +136,7 @@ SequenceBBQuery::BlockListTy SequenceBBQuery::rearrangeBB(const Function &F, const BlockListTy &BBList) { BlockListTy RearrangedBBSet; - for (auto &Block : F.getBasicBlockList()) + for (auto &Block : F) if (llvm::is_contained(BBList, &Block)) RearrangedBBSet.push_back(&Block); @@ -288,14 +288,14 @@ SpeculateQuery::ResultTy SequenceBBQuery::operator()(Function &F) { CallerBlocks = findBBwithCalls(F); if (CallerBlocks.empty()) - return None; + return std::nullopt; if (isStraightLine(F)) SequencedBlocks = rearrangeBB(F, CallerBlocks); else SequencedBlocks = queryCFG(F, CallerBlocks); - for (auto BB : SequencedBlocks) + for (const auto *BB : SequencedBlocks) findCalles(BB, Calles); CallerAndCalles.insert({F.getName(), std::move(Calles)}); -- cgit v1.2.3