Skip to content

Commit 0555347

Browse files
authored
Merge branch 'users/kparzysz/r05-declare-reduction' into users/kparzysz/r06-unparse-noeol
2 parents 672c1ad + 8a5d871 commit 0555347

File tree

1,074 files changed

+33501
-16164
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,074 files changed

+33501
-16164
lines changed

.ci/monolithic-linux.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ enable_cir="${6}"
3232
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests --succinct"
3333

3434
start-group "CMake"
35-
export PIP_BREAK_SYSTEM_PACKAGES=1
36-
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
3735

3836
# Set the system llvm-symbolizer as preferred.
3937
export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`

.ci/utils.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,10 @@ function start-group {
5252
echo "Starting $groupname"
5353
fi
5454
}
55+
56+
export PIP_BREAK_SYSTEM_PACKAGES=1
57+
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
58+
59+
if [[ "$GITHUB_ACTIONS" != "" ]]; then
60+
python .ci/cache_lit_timing_files.py download
61+
fi

.github/CODEOWNERS

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
/mlir/**/BufferizableOpInterfaceImpl.* @matthias-springer
6060
/mlir/Dialect/*/Transforms/Bufferize.cpp @matthias-springer
6161

62+
# DLTI Dialect in MLIR
63+
/mlir/**/Dialect/DLTI @rolfmorel
64+
/mlir/**/DataLayoutInterfaces.* @rolfmorel
65+
6266
# Linalg Dialect in MLIR.
6367
/mlir/include/mlir/Dialect/Linalg @dcaballe @nicolasvasilache @rengolin
6468
/mlir/lib/Dialect/Linalg @dcaballe @nicolasvasilache @rengolin
@@ -96,9 +100,9 @@
96100
/mlir/lib/Dialect/Tensor/Transforms/* @hanhanW @nicolasvasilache
97101

98102
# Transform Dialect in MLIR.
99-
/mlir/include/mlir/Dialect/Transform/* @ftynse @nicolasvasilache
100-
/mlir/lib/Dialect/Transform/* @ftynse @nicolasvasilache
101-
/mlir/**/*TransformOps* @ftynse @nicolasvasilache
103+
/mlir/include/mlir/Dialect/Transform/* @ftynse @nicolasvasilache @rolfmorel
104+
/mlir/lib/Dialect/Transform/* @ftynse @nicolasvasilache @rolfmorel
105+
/mlir/**/*TransformOps* @ftynse @nicolasvasilache @rolfmorel
102106

103107
# SPIR-V Dialect in MLIR.
104108
/mlir/**/SPIRV/ @antiagainst @kuhar

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

Lines changed: 1 addition & 1 deletion
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=21.1.0
5+
ENV LLVM_VERSION=21.1.1
66

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

.github/workflows/pr-code-format.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@ jobs:
3232
base_sha: 'HEAD~1'
3333
sha: 'HEAD'
3434

35-
# We need to pull the script from the main branch, so that we ensure
36-
# we get the latest version of this script.
37-
- name: Fetch code formatting utils
38-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
39-
with:
40-
repository: ${{ github.repository }}
41-
ref: ${{ github.base_ref }}
42-
sparse-checkout: |
43-
llvm/utils/git/requirements_formatting.txt
44-
llvm/utils/git/code-format-helper.py
45-
sparse-checkout-cone-mode: false
46-
path: code-format-tools
47-
4835
- name: "Listed files"
4936
env:
5037
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
@@ -65,10 +52,10 @@ jobs:
6552
with:
6653
python-version: '3.11'
6754
cache: 'pip'
68-
cache-dependency-path: 'code-format-tools/llvm/utils/git/requirements_formatting.txt'
55+
cache-dependency-path: 'llvm/utils/git/requirements_formatting.txt'
6956

7057
- name: Install python dependencies
71-
run: pip install -r code-format-tools/llvm/utils/git/requirements_formatting.txt
58+
run: pip install -r llvm/utils/git/requirements_formatting.txt
7259

7360
- name: Run code formatter
7461
env:
@@ -77,7 +64,7 @@ jobs:
7764
# Create an empty comments file so the pr-write job doesn't fail.
7865
run: |
7966
echo "[]" > comments &&
80-
python ./code-format-tools/llvm/utils/git/code-format-helper.py \
67+
python ./llvm/utils/git/code-format-helper.py \
8168
--write-comment-to-file \
8269
--token ${{ secrets.GITHUB_TOKEN }} \
8370
--issue-number $GITHUB_PR_NUMBER \

.github/workflows/pr-code-lint.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- 'users/**'
1111
paths:
1212
- 'clang-tools-extra/clang-tidy/**'
13+
- '.github/workflows/pr-code-lint.yml'
1314

1415
jobs:
1516
code_linter:
@@ -32,7 +33,7 @@ jobs:
3233

3334
- name: Get changed files
3435
id: changed-files
35-
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
36+
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
3637
with:
3738
separator: ","
3839
skip_initial_fetch: true
@@ -45,18 +46,6 @@ jobs:
4546
run: |
4647
echo "Changed files:"
4748
echo "$CHANGED_FILES"
48-
49-
- name: Fetch code linting utils
50-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
51-
with:
52-
repository: ${{ github.repository }}
53-
ref: ${{ github.base_ref }}
54-
sparse-checkout: |
55-
llvm/utils/git/code-lint-helper.py
56-
llvm/utils/git/requirements_linting.txt
57-
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
58-
sparse-checkout-cone-mode: false
59-
path: code-lint-tools
6049
6150
- name: Install clang-tidy
6251
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
@@ -69,7 +58,7 @@ jobs:
6958
python-version: '3.12'
7059

7160
- name: Install Python dependencies
72-
run: python3 -m pip install -r code-lint-tools/llvm/utils/git/requirements_linting.txt
61+
run: python3 -m pip install -r llvm/utils/git/requirements_linting.txt
7362

7463
# TODO: create special mapping for 'codegen' targets, for now build predefined set
7564
# TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies
@@ -106,7 +95,7 @@ jobs:
10695
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
10796
run: |
10897
echo "[]" > comments &&
109-
python3 ./code-lint-tools/llvm/utils/git/code-lint-helper.py \
98+
python3 llvm/utils/git/code-lint-helper.py \
11099
--token ${{ secrets.GITHUB_TOKEN }} \
111100
--issue-number $GITHUB_PR_NUMBER \
112101
--start-rev HEAD~1 \

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ class BinaryContext {
326326
/// Returns true if DWARF4 or lower is used.
327327
bool isDWARFLegacyUsed() const { return ContainsDwarfLegacy; }
328328

329+
/// Returns true if DWARFUnit is valid.
330+
bool isValidDwarfUnit(DWARFUnit &DU) const;
331+
329332
std::map<unsigned, DwarfLineTable> &getDwarfLineTables() {
330333
return DwarfLineTablesCUMap;
331334
}

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ class DIEBuilder {
217217
std::optional<BOLTDWARF5AccelTableData *> Parent,
218218
uint32_t NumberParentsInChain);
219219

220-
void registerUnit(DWARFUnit &DU, bool NeedSort);
220+
/// Returns true if DWARFUnit is registered successfully.
221+
bool registerUnit(DWARFUnit &DU, bool NeedSort);
221222

222223
/// \return the unique ID of \p U if it exists.
223224
std::optional<uint32_t> getUnitId(const DWARFUnit &DU);

bolt/lib/Core/BinaryContext.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,10 +1624,26 @@ DWARFContext *BinaryContext::getDWOContext() const {
16241624
return &DWOCUs.begin()->second->getContext();
16251625
}
16261626

1627+
bool BinaryContext::isValidDwarfUnit(DWARFUnit &DU) const {
1628+
// Invalid DWARF unit with a DWOId but lacking a dwo_name.
1629+
if (DU.getDWOId() && !DU.isDWOUnit() &&
1630+
!DU.getUnitDIE().find(
1631+
{dwarf::DW_AT_dwo_name, dwarf::DW_AT_GNU_dwo_name})) {
1632+
this->outs() << "BOLT-ERROR: broken DWARF found in CU at offset 0x"
1633+
<< Twine::utohexstr(DU.getOffset()) << " (DWOId=0x"
1634+
<< Twine::utohexstr(*(DU.getDWOId()))
1635+
<< ", missing DW_AT_dwo_name / DW_AT_GNU_dwo_name)\n";
1636+
return false;
1637+
}
1638+
return true;
1639+
}
1640+
16271641
/// Handles DWO sections that can either be in .o, .dwo or .dwp files.
16281642
void BinaryContext::preprocessDWODebugInfo() {
16291643
for (const std::unique_ptr<DWARFUnit> &CU : DwCtx->compile_units()) {
16301644
DWARFUnit *const DwarfUnit = CU.get();
1645+
if (!isValidDwarfUnit(*DwarfUnit))
1646+
continue;
16311647
if (std::optional<uint64_t> DWOId = DwarfUnit->getDWOId()) {
16321648
std::string DWOName = dwarf::toString(
16331649
DwarfUnit->getUnitDIE().find(

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@ DWARFDie DIEBuilder::resolveDIEReference(
584584
if ((RefCU =
585585
getUnitForOffset(*this, *DwarfContext, TmpRefOffset, AttrSpec))) {
586586
/// Trying to add to current working set in case it's cross CU reference.
587-
registerUnit(*RefCU, true);
587+
if (!registerUnit(*RefCU, true))
588+
return DWARFDie();
588589
DWARFDataExtractor DebugInfoData = RefCU->getDebugInfoExtractor();
589590
if (DwarfDebugInfoEntry.extractFast(*RefCU, &TmpRefOffset, DebugInfoData,
590591
RefCU->getNextUnitOffset(), 0)) {
@@ -1008,12 +1009,14 @@ static uint64_t getHash(const DWARFUnit &DU) {
10081009
return DU.getOffset();
10091010
}
10101011

1011-
void DIEBuilder::registerUnit(DWARFUnit &DU, bool NeedSort) {
1012+
bool DIEBuilder::registerUnit(DWARFUnit &DU, bool NeedSort) {
1013+
if (!BC.isValidDwarfUnit(DU))
1014+
return false;
10121015
auto IterGlobal = AllProcessed.insert(getHash(DU));
10131016
// If DU is already in a current working set or was already processed we can
10141017
// skip it.
10151018
if (!IterGlobal.second)
1016-
return;
1019+
return true;
10171020
if (getState().Type == ProcessingType::DWARF4TUs) {
10181021
getState().DWARF4TUVector.push_back(&DU);
10191022
} else if (getState().Type == ProcessingType::DWARF5TUs) {
@@ -1034,6 +1037,7 @@ void DIEBuilder::registerUnit(DWARFUnit &DU, bool NeedSort) {
10341037
if (getState().DUList.size() == getState().CloneUnitCtxMap.size())
10351038
getState().CloneUnitCtxMap.emplace_back();
10361039
getState().DUList.push_back(&DU);
1040+
return true;
10371041
}
10381042

10391043
std::optional<uint32_t> DIEBuilder::getUnitId(const DWARFUnit &DU) {

0 commit comments

Comments
 (0)