Skip to content

Commit a17903f

Browse files
committed
rebase
Created using spr 1.3.4
2 parents a54e4f1 + bf07578 commit a17903f

File tree

10,709 files changed

+709162
-172100
lines changed

Some content is hidden

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

10,709 files changed

+709162
-172100
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp @MaheshRavishankar @nicolasvasilache
6969
/mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp @hanhanW @nicolasvasilache
7070
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @dcaballe @hanhanW @nicolasvasilache
71-
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @hanhanW @nicolasvasilache
71+
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @hanhanW @nicolasvasilache @Groverkss
7272

7373
# MemRef Dialect in MLIR.
7474
/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp @MaheshRavishankar @nicolasvasilache
@@ -82,9 +82,9 @@
8282
/mlir/**/*VectorToSCF* @banach-space @dcaballe @matthias-springer @nicolasvasilache
8383
/mlir/**/*VectorToLLVM* @banach-space @dcaballe @nicolasvasilache
8484
/mlir/**/*X86Vector* @aartbik @dcaballe @nicolasvasilache
85-
/mlir/include/mlir/Dialect/Vector @banach-space @dcaballe @nicolasvasilache
85+
/mlir/include/mlir/Dialect/Vector @banach-space @dcaballe @nicolasvasilache @Groverkss
8686
/mlir/include/mlir/Dialect/Vector/IR @kuhar
87-
/mlir/lib/Dialect/Vector @banach-space @dcaballe @nicolasvasilache
87+
/mlir/lib/Dialect/Vector @banach-space @dcaballe @nicolasvasilache @Groverkss
8888
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @hanhanW @nicolasvasilache
8989
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @banach-space @dcaballe @MaheshRavishankar @nicolasvasilache
9090
/mlir/**/*EmulateNarrowType* @dcaballe @hanhanW
@@ -141,7 +141,7 @@
141141
/clang/tools/clang-installapi/ @cyndyishida
142142

143143
# ExtractAPI
144-
/clang/**/ExtractAPI @daniel-grumberg
144+
/clang/**/ExtractAPI @daniel-grumberg @QuietMisdreavus
145145

146146
# DWARFLinker, dwarfutil, dsymutil
147147
/llvm/**/DWARFLinker/ @JDevlieghere

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

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

44
FROM base as stage1-toolchain
5-
ENV LLVM_VERSION=18.1.8
5+
ENV LLVM_VERSION=19.1.2
66

77
RUN apt-get update && \
88
apt-get install -y \

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ env:
4949
jobs:
5050
stage1:
5151
if: github.repository_owner == 'llvm'
52-
runs-on: libcxx-runners-8-set
52+
runs-on: libcxx-runners-set
53+
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
5354
continue-on-error: false
5455
strategy:
5556
fail-fast: false
@@ -79,12 +80,14 @@ jobs:
7980
path: |
8081
**/test-results.xml
8182
**/*.abilist
83+
**/CMakeConfigureLog.yaml
8284
**/CMakeError.log
8385
**/CMakeOutput.log
8486
**/crash_diagnostics/*
8587
stage2:
8688
if: github.repository_owner == 'llvm'
87-
runs-on: libcxx-runners-8-set
89+
runs-on: libcxx-runners-set
90+
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
8891
needs: [ stage1 ]
8992
continue-on-error: false
9093
strategy:
@@ -123,6 +126,7 @@ jobs:
123126
path: |
124127
**/test-results.xml
125128
**/*.abilist
129+
**/CMakeConfigureLog.yaml
126130
**/CMakeError.log
127131
**/CMakeOutput.log
128132
**/crash_diagnostics/*
@@ -155,25 +159,23 @@ jobs:
155159
'generic-no-rtti',
156160
'generic-optimized-speed',
157161
'generic-static',
158-
# TODO Find a better place for the benchmark and bootstrapping builds to live. They're either very expensive
159-
# or don't provide much value since the benchmark run results are too noise on the bots.
160-
'benchmarks',
161162
'bootstrapping-build'
162163
]
163-
machine: [ 'libcxx-runners-8-set' ]
164+
machine: [ 'libcxx-runners-set' ]
164165
include:
165166
- config: 'generic-cxx26'
166-
machine: libcxx-runners-8-set
167+
machine: libcxx-runners-set
167168
- config: 'generic-asan'
168-
machine: libcxx-runners-8-set
169+
machine: libcxx-runners-set
169170
- config: 'generic-tsan'
170-
machine: libcxx-runners-8-set
171+
machine: libcxx-runners-set
171172
- config: 'generic-ubsan'
172-
machine: libcxx-runners-8-set
173+
machine: libcxx-runners-set
173174
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
174175
- config: 'generic-msan'
175-
machine: libcxx-runners-8-set
176+
machine: libcxx-runners-set
176177
runs-on: ${{ matrix.machine }}
178+
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
177179
steps:
178180
- uses: actions/checkout@v4
179181
- name: ${{ matrix.config }}
@@ -188,6 +190,7 @@ jobs:
188190
path: |
189191
**/test-results.xml
190192
**/*.abilist
193+
**/CMakeConfigureLog.yaml
191194
**/CMakeError.log
192195
**/CMakeOutput.log
193196
**/crash_diagnostics/*
@@ -230,6 +233,7 @@ jobs:
230233
path: |
231234
**/test-results.xml
232235
**/*.abilist
236+
**/CMakeConfigureLog.yaml
233237
**/CMakeError.log
234238
**/CMakeOutput.log
235239
**/crash_diagnostics/*

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,6 @@ class BinaryContext {
229229
/// Functions injected by BOLT
230230
std::vector<BinaryFunction *> InjectedBinaryFunctions;
231231

232-
/// Thunk functions.
233-
std::vector<BinaryFunction *> ThunkBinaryFunctions;
234-
235-
/// Function that precedes thunks in the binary.
236-
const BinaryFunction *ThunkLocation{nullptr};
237-
238232
/// Jump tables for all functions mapped by address.
239233
std::map<uint64_t, JumpTable *> JumpTables;
240234

@@ -546,16 +540,6 @@ class BinaryContext {
546540
return InjectedBinaryFunctions;
547541
}
548542

549-
BinaryFunction *createThunkBinaryFunction(const std::string &Name);
550-
551-
std::vector<BinaryFunction *> &getThunkBinaryFunctions() {
552-
return ThunkBinaryFunctions;
553-
}
554-
555-
const BinaryFunction *getThunkLocation() const { return ThunkLocation; }
556-
557-
void setThunkLocation(const BinaryFunction *BF) { ThunkLocation = BF; }
558-
559543
/// Return vector with all functions, i.e. include functions from the input
560544
/// binary and functions created by BOLT.
561545
std::vector<BinaryFunction *> getAllBinaryFunctions();
@@ -1355,10 +1339,6 @@ class BinaryContext {
13551339
uint64_t
13561340
computeInstructionSize(const MCInst &Inst,
13571341
const MCCodeEmitter *Emitter = nullptr) const {
1358-
// FIXME: hack for faster size computation on aarch64.
1359-
if (isAArch64())
1360-
return MIB->isPseudo(Inst) ? 0 : 4;
1361-
13621342
if (std::optional<uint32_t> Size = MIB->getSize(Inst))
13631343
return *Size;
13641344

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ class BinaryFunction {
360360
/// True if another function body was merged into this one.
361361
bool HasFunctionsFoldedInto{false};
362362

363-
/// True if the function is used for remapping hot text and shall not be
364-
/// placed on a huge page.
365-
bool IsHotTextMover{false};
366-
367363
/// Name for the section this function code should reside in.
368364
std::string CodeSectionName;
369365

@@ -390,6 +386,9 @@ class BinaryFunction {
390386
/// Raw branch count for this function in the profile.
391387
uint64_t RawBranchCount{0};
392388

389+
/// Dynamically executed function bytes, used for density computation.
390+
uint64_t SampleCountInBytes{0};
391+
393392
/// Indicates the type of profile the function is using.
394393
uint16_t ProfileFlags{PF_NONE};
395394

@@ -909,6 +908,10 @@ class BinaryFunction {
909908
return BB && BB->getOffset() == Offset ? BB : nullptr;
910909
}
911910

911+
const BinaryBasicBlock *getBasicBlockAtOffset(uint64_t Offset) const {
912+
return const_cast<BinaryFunction *>(this)->getBasicBlockAtOffset(Offset);
913+
}
914+
912915
/// Retrieve the landing pad BB associated with invoke instruction \p Invoke
913916
/// that is in \p BB. Return nullptr if none exists
914917
BinaryBasicBlock *getLandingPadBBFor(const BinaryBasicBlock &BB,
@@ -1360,8 +1363,6 @@ class BinaryFunction {
13601363
/// Return true if the original entry point was patched.
13611364
bool isPatched() const { return IsPatched; }
13621365

1363-
bool isHotTextMover() const { return IsHotTextMover; }
1364-
13651366
const JumpTable *getJumpTable(const MCInst &Inst) const {
13661367
const uint64_t Address = BC.MIB->getJumpTable(Inst);
13671368
return getJumpTableContainingAddress(Address);
@@ -1714,8 +1715,6 @@ class BinaryFunction {
17141715

17151716
void setIsPatched(bool V) { IsPatched = V; }
17161717

1717-
void setHotTextMover(bool V) { IsHotTextMover = V; }
1718-
17191718
void setHasIndirectTargetToSplitFragment(bool V) {
17201719
HasIndirectTargetToSplitFragment = V;
17211720
}
@@ -1852,6 +1851,9 @@ class BinaryFunction {
18521851
/// to this function.
18531852
void setRawBranchCount(uint64_t Count) { RawBranchCount = Count; }
18541853

1854+
/// Return the number of dynamically executed bytes, from raw perf data.
1855+
uint64_t getSampleCountInBytes() const { return SampleCountInBytes; }
1856+
18551857
/// Return the execution count for functions with known profile.
18561858
/// Return 0 if the function has no profile.
18571859
uint64_t getKnownExecutionCount() const {

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class DIEBuilder {
314314

315315
BC.errs()
316316
<< "BOLT-ERROR: unable to find TypeUnit for Type Unit at offset 0x"
317-
<< DU.getOffset() << "\n";
317+
<< Twine::utohexstr(DU.getOffset()) << "\n";
318318
return nullptr;
319319
}
320320

bolt/include/bolt/Passes/IdenticalCodeFolding.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ namespace bolt {
2020
///
2121
class IdenticalCodeFolding : public BinaryFunctionPass {
2222
protected:
23-
bool shouldOptimize(const BinaryFunction &BF) const override;
23+
bool shouldOptimize(const BinaryFunction &BF) const override {
24+
if (BF.hasUnknownControlFlow())
25+
return false;
26+
if (BF.isFolded())
27+
return false;
28+
if (BF.hasSDTMarker())
29+
return false;
30+
return BinaryFunctionPass::shouldOptimize(BF);
31+
}
2432

2533
public:
2634
explicit IdenticalCodeFolding(const cl::opt<bool> &PrintPass)

bolt/include/bolt/Passes/LongJmp.h

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,36 +71,11 @@ class LongJmpPass : public BinaryFunctionPass {
7171
static constexpr size_t LongestJumpBits = 28;
7272
static constexpr size_t LongestJumpSpan = 1ULL << (LongestJumpBits - 1);
7373

74-
/// Size of the instruction on AArch64.
75-
static constexpr size_t InstSize = 4;
76-
7774
/// Relax all internal function branches including those between fragments.
78-
/// Assume fragments are placed in different sections but are within 128MB
79-
/// branch span ("medium" code model).
75+
/// Assume that fragments are placed in different sections but are within
76+
/// 128MB of each other.
8077
void relaxLocalBranches(BinaryFunction &BF);
8178

82-
struct FunctionCluster {
83-
std::set<BinaryFunction *> Functions;
84-
85-
// Functions that this cluster of functions is calling. Note that it
86-
// excludes all functions in the cluster itself.
87-
std::set<BinaryFunction *> Callees;
88-
89-
uint64_t Size{0};
90-
91-
// Last function in the cluster.
92-
BinaryFunction *LastBF{nullptr};
93-
};
94-
95-
/// Maximum size of the function cluster. Note that it's less than 128MB
96-
/// as the size of the cluster plus thunk island should be less than 128MB.
97-
static constexpr uint64_t MaxClusterSize = 124 * 1024 * 1024;
98-
99-
/// Relax calls for medium code model where code is < 256MB.
100-
/// A thunk island will be introduced between two clusters of functions to
101-
/// enable calls over 128MB.
102-
void relaxCalls(BinaryContext &BC);
103-
10479
/// -- Layout estimation methods --
10580
/// Try to do layout before running the emitter, by looking at BinaryFunctions
10681
/// and MCInsts -- this is an estimation. To be correct for longjmp inserter

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ class DataAggregator : public DataReader {
266266
uint64_t Mispreds);
267267

268268
/// Register a \p Branch.
269-
bool doBranch(uint64_t From, uint64_t To, uint64_t Count, uint64_t Mispreds);
269+
bool doBranch(uint64_t From, uint64_t To, uint64_t Count, uint64_t Mispreds,
270+
bool IsPreagg);
270271

271272
/// Register a trace between two LBR entries supplied in execution order.
272273
bool doTrace(const LBREntry &First, const LBREntry &Second,

bolt/include/bolt/Profile/YAMLProfileReader.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class YAMLProfileReader : public ProfileReaderBase {
105105
yaml::bolt::BinaryProfile YamlBP;
106106

107107
/// Map a function ID from a YAML profile to a BinaryFunction object.
108-
std::vector<BinaryFunction *> YamlProfileToFunction;
108+
DenseMap<uint32_t, BinaryFunction *> YamlProfileToFunction;
109109

110110
using FunctionSet = std::unordered_set<const BinaryFunction *>;
111111
/// To keep track of functions that have a matched profile before the profile
@@ -162,8 +162,6 @@ class YAMLProfileReader : public ProfileReaderBase {
162162
/// Update matched YAML -> BinaryFunction pair.
163163
void matchProfileToFunction(yaml::bolt::BinaryFunctionProfile &YamlBF,
164164
BinaryFunction &BF) {
165-
if (YamlBF.Id >= YamlProfileToFunction.size())
166-
YamlProfileToFunction.resize(YamlBF.Id + 1);
167165
YamlProfileToFunction[YamlBF.Id] = &BF;
168166
YamlBF.Used = true;
169167

0 commit comments

Comments
 (0)