Skip to content

Commit 1602c08

Browse files
committed
Merge branch 'main' into remove_is_nullptr
2 parents fbc9ebb + 91450f1 commit 1602c08

File tree

3,382 files changed

+153210
-63231
lines changed

Some content is hidden

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

3,382 files changed

+153210
-63231
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,6 @@ b9079baaddfed5e604fbfaa1d81a7a1c38e78c26
8484

8585
# [libc++][NFC] Run clang-format on libcxx/include again (#95874)
8686
e2c2ffbe7a1b5d9e32a2ce64279475b50c4cba5b
87+
88+
# [lldb][nfc] Deindent ProcessGDBRemote::SetThreadStopInfo by two levels
89+
b32931c5b32eb0d2cf37d688b34f8548c9674c19

.github/CODEOWNERS

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ clang/test/AST/Interp/ @tbaederr
6767
/mlir/include/mlir/Dialect/Linalg @dcaballe @nicolasvasilache @rengolin
6868
/mlir/lib/Dialect/Linalg @dcaballe @nicolasvasilache @rengolin
6969
/mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp @MaheshRavishankar @nicolasvasilache
70-
/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp @MaheshRavishankar @nicolasvasilache
70+
/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp @dcaballe @MaheshRavishankar @nicolasvasilache
7171
/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp @MaheshRavishankar @nicolasvasilache
7272
/mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp @hanhanW @nicolasvasilache
73-
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @hanhanW @nicolasvasilache
74-
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @hanhanW @nicolasvasilache
73+
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @dcaballe @hanhanW @nicolasvasilache
74+
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @hanhanW @nicolasvasilache
7575

7676
# MemRef Dialect in MLIR.
7777
/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp @MaheshRavishankar @nicolasvasilache
@@ -85,10 +85,11 @@ clang/test/AST/Interp/ @tbaederr
8585
/mlir/**/*VectorToSCF* @banach-space @dcaballe @matthias-springer @nicolasvasilache
8686
/mlir/**/*VectorToLLVM* @banach-space @dcaballe @nicolasvasilache
8787
/mlir/**/*X86Vector* @aartbik @dcaballe @nicolasvasilache
88-
/mlir/include/mlir/Dialect/Vector @dcaballe @nicolasvasilache
89-
/mlir/lib/Dialect/Vector @dcaballe @nicolasvasilache
90-
/mlir/lib/Dialect/Vector/Transforms/* @hanhanW @nicolasvasilache
91-
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @MaheshRavishankar @nicolasvasilache
88+
/mlir/include/mlir/Dialect/Vector @banach-space @dcaballe @nicolasvasilache
89+
/mlir/include/mlir/Dialect/Vector/IR @kuhar
90+
/mlir/lib/Dialect/Vector @banach-space @dcaballe @nicolasvasilache
91+
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @hanhanW @nicolasvasilache
92+
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @banach-space @dcaballe @MaheshRavishankar @nicolasvasilache
9293
/mlir/**/*EmulateNarrowType* @dcaballe @hanhanW
9394

9495
# Presburger library in MLIR

.github/workflows/issue-write.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,21 @@ jobs:
2424
github.event.workflow_run.conclusion == 'failure'
2525
)
2626
steps:
27+
- name: Fetch Sources
28+
uses: actions/checkout@v4
29+
with:
30+
sparse-checkout: |
31+
.github/workflows/unprivileged-download-artifact/action.yml
32+
sparse-checkout-cone-mode: false
2733
- name: 'Download artifact'
28-
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
34+
uses: ./.github/workflows/unprivileged-download-artifact
35+
id: download-artifact
2936
with:
30-
github-token: ${{ secrets.ISSUE_WRITE_DOWNLOAD_ARTIFACT }}
3137
run-id: ${{ github.event.workflow_run.id }}
32-
name: workflow-args
38+
artifact-name: workflow-args
3339

3440
- name: 'Comment on PR'
41+
if: steps.download-artifact.outputs.artifact-id != ''
3542
uses: actions/github-script@v3
3643
with:
3744
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -144,5 +151,7 @@ jobs:
144151
});
145152
146153
- name: Dump comments file
147-
if: always()
154+
if: >-
155+
always() &&
156+
steps.download-artifact.outputs.artifact-id != ''
148157
run: cat comments
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Unprivileged Download Artifact
2+
description: >-
3+
Download artifacts from another workflow run without using an access token.
4+
inputs:
5+
run-id:
6+
description: >-
7+
The run-id for the workflow run that you want to download the artifact
8+
from. If ommitted it will download the most recently created artifact
9+
from the repo with the artifact-name.
10+
required: false
11+
artifact-name:
12+
desciption: The name of the artifact to download.
13+
required: true
14+
15+
16+
outputs:
17+
filename:
18+
description: >-
19+
The filename of the downloaded artifact or the empty string if the
20+
artifact was not found.
21+
value: ${{ steps.download-artifact.outputs.filename }}
22+
artifact-id:
23+
description: "The id of the artifact being downloaded."
24+
value: ${{ steps.artifact-url.outputs.id }}
25+
26+
27+
runs:
28+
using: "composite"
29+
steps:
30+
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
31+
id: artifact-url
32+
with:
33+
script: |
34+
var response;
35+
if (!"${{ inputs.run-id }}") {
36+
response = await github.rest.actions.listArtifactsForRepo({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
name: "${{ inputs.artifact-name }}"
40+
})
41+
} else {
42+
response = await github.rest.actions.listWorkflowRunArtifacts({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
run_id: "${{ inputs.run-id }}",
46+
name: "${{ inputs.artifact-name }}"
47+
})
48+
}
49+
50+
console.log(response)
51+
52+
for (artifact of response.data.artifacts) {
53+
console.log(artifact);
54+
}
55+
56+
if (response.data.artifacts.length == 0) {
57+
console.log("Could not find artifact ${{ inputs.artifact-name }} for workflow run ${{ inputs.run-id }}")
58+
return;
59+
}
60+
61+
const url_response = await github.rest.actions.downloadArtifact({
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
artifact_id: response.data.artifacts[0].id,
65+
archive_format: "zip"
66+
})
67+
68+
core.setOutput("url", url_response.url);
69+
core.setOutput("id", response.data.artifacts[0].id);
70+
71+
- shell: bash
72+
if: steps.artifact-url.outputs.url != ''
73+
id: download-artifact
74+
run: |
75+
curl -L -o ${{ inputs.artifact-name }}.zip "${{ steps.artifact-url.outputs.url }}"
76+
echo "filename=${{ inputs.artifact-name }}.zip" >> $GITHUB_OUTPUT
77+
78+
- shell: bash
79+
if: steps.download-artifact.outputs.filename != ''
80+
run: |
81+
unzip ${{ steps.download-artifact.outputs.filename }}

.github/workflows/version-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ jobs:
2727
2828
- name: Version Check
2929
run: |
30-
version=$(grep -o 'LLVM_VERSION_\(MAJOR\|MINOR\|PATCH\) [0-9]\+' llvm/CMakeLists.txt | cut -d ' ' -f 2 | tr "\n" "." | sed 's/.$//g')
30+
version=$(grep -o 'LLVM_VERSION_\(MAJOR\|MINOR\|PATCH\) [0-9]\+' cmake/Modules/LLVMVersion.cmake | cut -d ' ' -f 2 | tr "\n" "." | sed 's/.$//g')
3131
.github/workflows/version-check.py "$version"

bolt/docs/CommandLineArgumentReference.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888

8989
- `--comp-dir-override=<string>`
9090

91-
Overrides DW_AT_comp_dir, and provides an alterantive base location, which is
91+
Overrides DW_AT_comp_dir, and provides an alternative base location, which is
9292
used with DW_AT_dwo_name to construct a path to *.dwo files.
9393

9494
- `--create-debug-names-section`
@@ -113,11 +113,6 @@
113113

114114
Prints out offsets for abbrev and debug_info of Skeleton CUs that get patched.
115115

116-
- `--deterministic-debuginfo`
117-
118-
Disables parallel execution of tasks that may produce nondeterministic debug
119-
info
120-
121116
- `--dot-tooltip-code`
122117

123118
Add basic block instructions as tool tips on nodes
@@ -686,6 +681,10 @@
686681
threshold means fewer functions to process. E.g threshold of 90 means only top
687682
10 percent of functions with profile will be processed.
688683

684+
- `--match-with-call-graph`
685+
686+
Match functions with call graph
687+
689688
- `--memcpy1-spec=<func1,func2:cs1:cs2,func3:cs1,...>`
690689

691690
List of functions with call sites for which to specialize memcpy() for size 1

bolt/docs/OptimizingClang.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ $ cd ${TOPLEV}/stage3
4949
$ CPATH=${TOPLEV}/stage2-prof-use-lto/install/bin/
5050
$ cmake -G Ninja ${TOPLEV}/llvm -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release \
5151
-DCMAKE_C_COMPILER=$CPATH/clang -DCMAKE_CXX_COMPILER=$CPATH/clang++ \
52+
-DLLVM_ENABLE_PROJECTS="clang" \
5253
-DLLVM_USE_LINKER=lld -DCMAKE_INSTALL_PREFIX=${TOPLEV}/stage3/install
5354
$ perf record -e cycles:u -j any,u -- ninja clang
5455
```

bolt/docs/generate_doc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def parse_bolt_options(output):
4545
cleaned_line = line.strip()
4646

4747
if cleaned_line.casefold() in map(str.casefold, section_headers):
48-
if prev_section != None: # Save last option from prev section
48+
if prev_section is not None: # Save last option from prev section
4949
add_info(sections, current_section, option, description)
5050
option, description = None, []
5151

@@ -76,7 +76,7 @@ def parse_bolt_options(output):
7676
description = [descr]
7777
if option.startswith("--print") or option.startswith("--time"):
7878
current_section = "BOLT printing options:"
79-
elif prev_section != None:
79+
elif prev_section is not None:
8080
current_section = prev_section
8181
continue
8282

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "bolt/RuntimeLibs/RuntimeLibrary.h"
2424
#include "llvm/ADT/AddressRanges.h"
2525
#include "llvm/ADT/ArrayRef.h"
26+
#include "llvm/ADT/EquivalenceClasses.h"
2627
#include "llvm/ADT/StringMap.h"
2728
#include "llvm/ADT/iterator.h"
2829
#include "llvm/BinaryFormat/Dwarf.h"
@@ -32,6 +33,7 @@
3233
#include "llvm/MC/MCContext.h"
3334
#include "llvm/MC/MCObjectFileInfo.h"
3435
#include "llvm/MC/MCObjectWriter.h"
36+
#include "llvm/MC/MCPseudoProbe.h"
3537
#include "llvm/MC/MCSectionELF.h"
3638
#include "llvm/MC/MCSectionMachO.h"
3739
#include "llvm/MC/MCStreamer.h"
@@ -240,12 +242,19 @@ class BinaryContext {
240242
/// Function fragments to skip.
241243
std::unordered_set<BinaryFunction *> FragmentsToSkip;
242244

245+
/// Fragment equivalence classes to query belonging to the same "family" in
246+
/// presence of multiple fragments/multiple parents.
247+
EquivalenceClasses<const BinaryFunction *> FragmentClasses;
248+
243249
/// The runtime library.
244250
std::unique_ptr<RuntimeLibrary> RtLibrary;
245251

246252
/// DWP Context.
247253
std::shared_ptr<DWARFContext> DWPContext;
248254

255+
/// Decoded pseudo probes.
256+
std::shared_ptr<MCPseudoProbeDecoder> PseudoProbeDecoder;
257+
249258
/// A map of DWO Ids to CUs.
250259
using DWOIdToCUMapType = std::unordered_map<uint64_t, DWARFUnit *>;
251260
DWOIdToCUMapType DWOCUs;
@@ -377,6 +386,15 @@ class BinaryContext {
377386
RtLibrary = std::move(Lib);
378387
}
379388

389+
const MCPseudoProbeDecoder *getPseudoProbeDecoder() const {
390+
return PseudoProbeDecoder.get();
391+
}
392+
393+
void setPseudoProbeDecoder(std::shared_ptr<MCPseudoProbeDecoder> Decoder) {
394+
assert(!PseudoProbeDecoder && "Cannot set pseudo probe decoder twice.");
395+
PseudoProbeDecoder = Decoder;
396+
}
397+
380398
/// Return BinaryFunction containing a given \p Address or nullptr if
381399
/// no registered function contains the \p Address.
382400
///
@@ -431,6 +449,9 @@ class BinaryContext {
431449
return nullptr;
432450
}
433451

452+
/// Deregister JumpTable registered at a given \p Address and delete it.
453+
void deleteJumpTable(uint64_t Address);
454+
434455
unsigned getDWARFEncodingSize(unsigned Encoding) {
435456
if (Encoding == dwarf::DW_EH_PE_omit)
436457
return 0;
@@ -1016,7 +1037,15 @@ class BinaryContext {
10161037
/// fragment_name == parent_name.cold(.\d+)?
10171038
/// True if the Function is registered, false if the check failed.
10181039
bool registerFragment(BinaryFunction &TargetFunction,
1019-
BinaryFunction &Function) const;
1040+
BinaryFunction &Function);
1041+
1042+
/// Return true if two functions belong to the same "family": are fragments
1043+
/// of one another, or fragments of the same parent, or transitively fragment-
1044+
/// related.
1045+
bool areRelatedFragments(const BinaryFunction *LHS,
1046+
const BinaryFunction *RHS) const {
1047+
return FragmentClasses.isEquivalent(LHS, RHS);
1048+
}
10201049

10211050
/// Add interprocedural reference for \p Function to \p Address
10221051
void addInterproceduralReference(BinaryFunction *Function, uint64_t Address) {
@@ -1436,10 +1465,7 @@ class BinaryContext {
14361465
std::unique_ptr<MCObjectWriter> OW = MAB->createObjectWriter(OS);
14371466
std::unique_ptr<MCStreamer> Streamer(TheTarget->createMCObjectStreamer(
14381467
*TheTriple, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), std::move(OW),
1439-
std::unique_ptr<MCCodeEmitter>(MCE), *STI,
1440-
/* RelaxAll */ false,
1441-
/* IncrementalLinkerCompatible */ false,
1442-
/* DWARFMustBeAtTheEnd */ false));
1468+
std::unique_ptr<MCCodeEmitter>(MCE), *STI));
14431469
return Streamer;
14441470
}
14451471

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,9 @@ class BinaryFunction {
416416
/// different parameters by every pass.
417417
mutable uint64_t Hash{0};
418418

419+
/// Function GUID assigned externally.
420+
uint64_t GUID{0};
421+
419422
/// For PLT functions it contains a symbol associated with a function
420423
/// reference. It is nullptr for non-PLT functions.
421424
const MCSymbol *PLTSymbol{nullptr};
@@ -1790,11 +1793,6 @@ class BinaryFunction {
17901793
return ParentFragments.contains(&Other);
17911794
}
17921795

1793-
/// Returns if this function is a parent of \p Other function.
1794-
bool isParentOf(const BinaryFunction &Other) const {
1795-
return Fragments.contains(&Other);
1796-
}
1797-
17981796
/// Return the child fragment form parent function
17991797
iterator_range<FragmentsSetTy::const_iterator> getFragments() const {
18001798
return iterator_range<FragmentsSetTy::const_iterator>(Fragments.begin(),
@@ -1804,11 +1802,6 @@ class BinaryFunction {
18041802
/// Return the parent function for split function fragments.
18051803
FragmentsSetTy *getParentFragments() { return &ParentFragments; }
18061804

1807-
/// Returns if this function is a parent or child of \p Other function.
1808-
bool isParentOrChildOf(const BinaryFunction &Other) const {
1809-
return isChildOf(Other) || isParentOf(Other);
1810-
}
1811-
18121805
/// Set the profile data for the number of times the function was called.
18131806
BinaryFunction &setExecutionCount(uint64_t Count) {
18141807
ExecutionCount = Count;
@@ -2256,6 +2249,11 @@ class BinaryFunction {
22562249
/// Returns the last computed hash value of the function.
22572250
size_t getHash() const { return Hash; }
22582251

2252+
/// Returns the function GUID.
2253+
uint64_t getGUID() const { return GUID; }
2254+
2255+
void setGUID(uint64_t Id) { GUID = Id; }
2256+
22592257
using OperandHashFuncTy =
22602258
function_ref<typename std::string(const MCOperand &)>;
22612259

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ class DIEBuilder {
135135

136136
/// Returns current state of the DIEBuilder
137137
State &getState() { return *BuilderState.get(); }
138-
/// Resolve the reference in DIE, if target is not loaded into IR,
139-
/// pre-allocate it. \p RefCU will be updated to the Unit specific by \p
140-
/// RefValue.
141-
DWARFDie resolveDIEReference(
142-
const DWARFFormValue &RefValue,
143-
const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec,
144-
DWARFUnit *&RefCU, DWARFDebugInfoEntry &DwarfDebugInfoEntry);
145138

146139
/// Resolve the reference in DIE, if target is not loaded into IR,
147140
/// pre-allocate it. \p RefCU will be updated to the Unit specific by \p
@@ -165,10 +158,9 @@ class DIEBuilder {
165158
const DWARFFormValue &Val);
166159

167160
/// Clone an attribute in reference format.
168-
void cloneDieReferenceAttribute(
161+
void cloneDieOffsetReferenceAttribute(
169162
DIE &Die, const DWARFUnit &U, const DWARFDie &InputDIE,
170-
const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec,
171-
const DWARFFormValue &Val);
163+
const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec, uint64_t Ref);
172164

173165
/// Clone an attribute in block format.
174166
void cloneBlockAttribute(

0 commit comments

Comments
 (0)