Skip to content

Commit f157afc

Browse files
committed
rebase
Created using spr 1.3.4
2 parents 0a2a94a + c79d77f commit f157afc

File tree

1,341 files changed

+116312
-58558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,341 files changed

+116312
-58558
lines changed

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ RUN choco install -y handle
108108
109109
RUN pip3 install pywin32 buildbot-worker==2.8.4
110110
111-
ARG RUNNER_VERSION=2.323.0
111+
ARG RUNNER_VERSION=2.324.0
112112
ENV RUNNER_VERSION=$RUNNER_VERSION
113113
114114
RUN powershell -Command \

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM docker.io/library/ubuntu:24.04 as base
22
ENV LLVM_SYSROOT=/opt/llvm
33

44
FROM base as stage1-toolchain
5-
ENV LLVM_VERSION=20.1.1
5+
ENV LLVM_VERSION=20.1.4
66

77
RUN apt-get update && \
88
apt-get install -y \
@@ -86,7 +86,7 @@ WORKDIR /home/gha
8686

8787
FROM ci-container as ci-container-agent
8888

89-
ENV GITHUB_RUNNER_VERSION=2.323.0
89+
ENV GITHUB_RUNNER_VERSION=2.324.0
9090

9191
RUN mkdir actions-runner && \
9292
cd actions-runner && \

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ class BinaryFunction {
142142
/// Types of profile the function can use. Could be a combination.
143143
enum {
144144
PF_NONE = 0, /// No profile.
145-
PF_LBR = 1, /// Profile is based on last branch records.
146-
PF_IP = 2, /// Non-LBR sample-based profile.
145+
PF_BRANCH = 1, /// Profile is based on branches or branch stacks.
146+
PF_BASIC = 2, /// Non-branch IP sample-based profile.
147147
PF_MEMEVENT = 4, /// Profile has mem events.
148148
};
149149

bolt/include/bolt/Profile/ProfileYAMLMapping.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ LLVM_YAML_STRONG_TYPEDEF(uint16_t, PROFILE_PF)
230230

231231
template <> struct ScalarBitSetTraits<PROFILE_PF> {
232232
static void bitset(IO &io, PROFILE_PF &value) {
233-
io.bitSetCase(value, "lbr", BinaryFunction::PF_LBR);
234-
io.bitSetCase(value, "sample", BinaryFunction::PF_IP);
233+
io.bitSetCase(value, "lbr", BinaryFunction::PF_BRANCH);
234+
io.bitSetCase(value, "sample", BinaryFunction::PF_BASIC);
235235
io.bitSetCase(value, "memevent", BinaryFunction::PF_MEMEVENT);
236236
}
237237
};

bolt/lib/Core/BinaryFunctionProfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void BinaryFunction::postProcessProfile() {
7070
return;
7171
}
7272

73-
if (!(getProfileFlags() & PF_LBR))
73+
if (!(getProfileFlags() & PF_BRANCH))
7474
return;
7575

7676
// If we have at least some branch data for the function indicate that it

bolt/lib/Passes/MCF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,15 @@ void EstimateEdgeCounts::runOnFunction(BinaryFunction &BF) {
458458
Error EstimateEdgeCounts::runOnFunctions(BinaryContext &BC) {
459459
if (llvm::none_of(llvm::make_second_range(BC.getBinaryFunctions()),
460460
[](const BinaryFunction &BF) {
461-
return BF.getProfileFlags() == BinaryFunction::PF_IP;
461+
return BF.getProfileFlags() == BinaryFunction::PF_BASIC;
462462
}))
463463
return Error::success();
464464

465465
ParallelUtilities::WorkFuncTy WorkFun = [&](BinaryFunction &BF) {
466466
runOnFunction(BF);
467467
};
468468
ParallelUtilities::PredicateTy SkipFunc = [&](const BinaryFunction &BF) {
469-
return BF.getProfileFlags() != BinaryFunction::PF_IP;
469+
return BF.getProfileFlags() != BinaryFunction::PF_BASIC;
470470
};
471471

472472
ParallelUtilities::runOnEachFunction(

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,11 @@ void DataAggregator::processProfile(BinaryContext &BC) {
571571
for (auto &BFI : BC.getBinaryFunctions()) {
572572
BinaryFunction &BF = BFI.second;
573573
if (FuncBranchData *FBD = getBranchData(BF)) {
574-
BF.markProfiled(BinaryFunction::PF_LBR);
574+
BF.markProfiled(BinaryFunction::PF_BRANCH);
575575
BF.RawSampleCount = FBD->getNumExecutedBranches();
576576
} else if (FuncBasicSampleData *FSD =
577577
getFuncBasicSampleData(BF.getNames())) {
578-
BF.markProfiled(BinaryFunction::PF_IP);
578+
BF.markProfiled(BinaryFunction::PF_BASIC);
579579
BF.RawSampleCount = FSD->getSamples();
580580
}
581581
}
@@ -2229,8 +2229,8 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
22292229
for (const StringMapEntry<std::nullopt_t> &EventEntry : EventNames)
22302230
EventNamesOS << LS << EventEntry.first().str();
22312231

2232-
BP.Header.Flags =
2233-
opts::BasicAggregation ? BinaryFunction::PF_IP : BinaryFunction::PF_LBR;
2232+
BP.Header.Flags = opts::BasicAggregation ? BinaryFunction::PF_BASIC
2233+
: BinaryFunction::PF_BRANCH;
22342234

22352235
// Add probe inline tree nodes.
22362236
YAMLProfileWriter::InlineTreeDesc InlineTree;

bolt/lib/Profile/DataReader.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,12 @@ void DataReader::readProfile(BinaryFunction &BF) {
358358
return;
359359

360360
if (!hasLBR()) {
361-
BF.ProfileFlags = BinaryFunction::PF_IP;
361+
BF.ProfileFlags = BinaryFunction::PF_BASIC;
362362
readBasicSampleData(BF);
363363
return;
364364
}
365365

366-
BF.ProfileFlags = BinaryFunction::PF_LBR;
366+
BF.ProfileFlags = BinaryFunction::PF_BRANCH;
367367

368368
// Possibly assign/re-assign branch profile data.
369369
matchProfileData(BF);
@@ -1035,9 +1035,8 @@ ErrorOr<BasicSampleInfo> DataReader::parseSampleInfo() {
10351035
}
10361036

10371037
ErrorOr<bool> DataReader::maybeParseNoLBRFlag() {
1038-
if (ParsingBuf.size() < 6 || ParsingBuf.substr(0, 6) != "no_lbr")
1038+
if (!ParsingBuf.consume_front("no_lbr"))
10391039
return false;
1040-
ParsingBuf = ParsingBuf.drop_front(6);
10411040
Col += 6;
10421041

10431042
if (ParsingBuf.size() > 0 && ParsingBuf[0] == ' ')
@@ -1058,9 +1057,8 @@ ErrorOr<bool> DataReader::maybeParseNoLBRFlag() {
10581057
}
10591058

10601059
ErrorOr<bool> DataReader::maybeParseBATFlag() {
1061-
if (ParsingBuf.size() < 16 || ParsingBuf.substr(0, 16) != "boltedcollection")
1060+
if (!ParsingBuf.consume_front("boltedcollection"))
10621061
return false;
1063-
ParsingBuf = ParsingBuf.drop_front(16);
10641062
Col += 16;
10651063

10661064
if (!checkAndConsumeNewLine()) {

bolt/lib/Profile/YAMLProfileReader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ bool YAMLProfileReader::parseFunctionProfile(
221221

222222
// Basic samples profile (without LBR) does not have branches information
223223
// and needs a special processing.
224-
if (YamlBP.Header.Flags & BinaryFunction::PF_IP) {
224+
if (YamlBP.Header.Flags & BinaryFunction::PF_BASIC) {
225225
if (!YamlBB.EventCount) {
226226
BB.setExecutionCount(0);
227227
continue;
@@ -338,7 +338,7 @@ bool YAMLProfileReader::parseFunctionProfile(
338338
if (BB.getExecutionCount() == BinaryBasicBlock::COUNT_NO_PROFILE)
339339
BB.setExecutionCount(0);
340340

341-
if (YamlBP.Header.Flags & BinaryFunction::PF_IP)
341+
if (YamlBP.Header.Flags & BinaryFunction::PF_BASIC)
342342
BF.setExecutionCount(FunctionExecutionCount);
343343

344344
ProfileMatched &= !MismatchedBlocks && !MismatchedCalls && !MismatchedEdges;
@@ -887,7 +887,7 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) {
887887
}
888888

889889
bool YAMLProfileReader::usesEvent(StringRef Name) const {
890-
return YamlBP.Header.EventNames.find(std::string(Name)) != StringRef::npos;
890+
return StringRef(YamlBP.Header.EventNames).contains(Name);
891891
}
892892

893893
} // end namespace bolt

bolt/lib/Profile/YAMLProfileWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ YAMLProfileWriter::convert(const BinaryFunction &BF, bool UseDFS,
215215
const MCPseudoProbeDecoder *PseudoProbeDecoder =
216216
opts::ProfileWritePseudoProbes ? BC.getPseudoProbeDecoder() : nullptr;
217217

218-
const uint16_t LBRProfile = BF.getProfileFlags() & BinaryFunction::PF_LBR;
218+
const uint16_t LBRProfile = BF.getProfileFlags() & BinaryFunction::PF_BRANCH;
219219

220220
// Prepare function and block hashes
221221
BF.computeHash(UseDFS);

0 commit comments

Comments
 (0)