Skip to content

Commit f51bfea

Browse files
committed
Merge branch 'users/kparzysz/spr/d09-recurse' into users/kparzysz/spr/d10-noclauses
2 parents 9e19906 + f7b776f commit f51bfea

File tree

1,627 files changed

+50557
-30417
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,627 files changed

+50557
-30417
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function add-dependencies() {
9191
echo "${project}"
9292
case ${project} in
9393
bolt)
94-
for p in lld llvm; do
94+
for p in clang lld llvm; do
9595
echo $p
9696
done
9797
;;

.ci/monolithic-linux.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4848
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --timeout=1200 --time-tests" \
4949
-D LLVM_ENABLE_LLD=ON \
5050
-D CMAKE_CXX_FLAGS=-gmlt \
51-
-D BOLT_CLANG_EXE=/usr/bin/clang \
5251
-D LLVM_CCACHE_BUILD=ON \
5352
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
5453

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
clang/lib/AST/Interp/ @tbaederr
3636
clang/test/AST/Interp/ @tbaederr
3737

38+
/clang/include/clang/CIR @lanza @bcardosolopes
39+
/clang/lib/CIR @lanza @bcardosolopes
40+
/clang/tools/cir-* @lanza @bcardosolopes
41+
3842
/lldb/ @JDevlieghere
3943

4044
# MLIR Interfaces.

.github/new-prs-labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
BOLT:
2+
- bolt/**/*
3+
14
ClangIR:
25
- clang/include/clang/CIR/**/*
36
- clang/lib/CIR/**/*

bolt/include/bolt/Passes/BinaryPasses.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,7 @@ class PrintProfileStats : public BinaryFunctionPass {
400400
/// dyno stats categories.
401401
class PrintProgramStats : public BinaryFunctionPass {
402402
public:
403-
explicit PrintProgramStats(const cl::opt<bool> &PrintPass)
404-
: BinaryFunctionPass(PrintPass) {}
403+
explicit PrintProgramStats() : BinaryFunctionPass(false) {}
405404

406405
const char *getName() const override { return "print-stats"; }
407406
bool shouldPrint(const BinaryFunction &) const override { return false; }

bolt/include/bolt/Rewrite/RewriteInstance.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,13 @@ class RewriteInstance {
422422
/// Section name used for extra BOLT code in addition to .text.
423423
static StringRef getBOLTTextSectionName() { return ".bolt.text"; }
424424

425+
/// Symbol markers for BOLT reserved area.
426+
static StringRef getBOLTReservedStart() { return "__bolt_reserved_start"; }
427+
static StringRef getBOLTReservedEnd() { return "__bolt_reserved_end"; }
428+
425429
/// Common section names.
426430
static StringRef getEHFrameSectionName() { return ".eh_frame"; }
431+
static StringRef getEHFrameHdrSectionName() { return ".eh_frame_hdr"; }
427432
static StringRef getRelaDynSectionName() { return ".rela.dyn"; }
428433

429434
/// FILE symbol name used for local fragments of global functions.
@@ -493,6 +498,9 @@ class RewriteInstance {
493498
/// Store all non-zero symbols in this map for a quick address lookup.
494499
std::map<uint64_t, llvm::object::SymbolRef> FileSymRefs;
495500

501+
/// FILE symbols used for disambiguating split function parents.
502+
std::vector<ELFSymbolRef> FileSymbols;
503+
496504
std::unique_ptr<DWARFRewriter> DebugInfoRewriter;
497505

498506
std::unique_ptr<BoltAddressTranslation> BAT;

bolt/include/bolt/Utils/NameResolver.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,23 @@ class NameResolver {
2828
static constexpr char Sep = '/';
2929

3030
public:
31-
/// Return unique version of the \p Name in the form "Name<Sep><Number>".
31+
/// Return the number of uniquified versions of a given \p Name.
32+
uint64_t getUniquifiedNameCount(StringRef Name) const {
33+
if (Counters.contains(Name))
34+
return Counters.at(Name);
35+
return 0;
36+
}
37+
38+
/// Return unique version of the \p Name in the form "Name<Sep><ID>".
39+
std::string getUniqueName(StringRef Name, const uint64_t ID) const {
40+
return (Name + Twine(Sep) + Twine(ID)).str();
41+
}
42+
43+
/// Register new version of \p Name and return unique version in the form
44+
/// "Name<Sep><Number>".
3245
std::string uniquify(StringRef Name) {
3346
const uint64_t ID = ++Counters[Name];
34-
return (Name + Twine(Sep) + Twine(ID)).str();
47+
return getUniqueName(Name, ID);
3548
}
3649

3750
/// For uniquified \p Name, return the original form (that may no longer be

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "bolt/Profile/DataAggregator.h"
1515
#include "bolt/Core/BinaryContext.h"
1616
#include "bolt/Core/BinaryFunction.h"
17+
#include "bolt/Passes/BinaryPasses.h"
1718
#include "bolt/Profile/BoltAddressTranslation.h"
1819
#include "bolt/Profile/Heatmap.h"
1920
#include "bolt/Profile/YAMLProfileWriter.h"
@@ -611,6 +612,7 @@ Error DataAggregator::readProfile(BinaryContext &BC) {
611612
if (std::error_code EC = writeBATYAML(BC, opts::SaveProfile))
612613
report_error("cannot create output data file", EC);
613614
}
615+
BC.logBOLTErrorsAndQuitOnFatal(PrintProgramStats().runOnFunctions(BC));
614616
}
615617

616618
return Error::success();

bolt/lib/Rewrite/BinaryPassManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
356356
// order they're registered.
357357

358358
// Run this pass first to use stats for the original functions.
359-
Manager.registerPass(std::make_unique<PrintProgramStats>(NeverPrint));
359+
Manager.registerPass(std::make_unique<PrintProgramStats>());
360360

361361
if (opts::PrintProfileStats)
362362
Manager.registerPass(std::make_unique<PrintProfileStats>(NeverPrint));

bolt/lib/Rewrite/BoltDiff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class RewriteInstanceDiff {
292292
}
293293
}
294294
}
295-
PrintProgramStats PPS(opts::NeverPrint);
295+
PrintProgramStats PPS;
296296
outs() << "* BOLT-DIFF: Starting print program stats pass for binary 1\n";
297297
RI1.BC->logBOLTErrorsAndQuitOnFatal(PPS.runOnFunctions(*RI1.BC));
298298
outs() << "* BOLT-DIFF: Starting print program stats pass for binary 2\n";

0 commit comments

Comments
 (0)