Skip to content

Commit 3d9a40e

Browse files
committed
Merge branch 'main' into improve_ballot_ne_zero_selection
2 parents 50ab573 + cc2fbc6 commit 3d9a40e

File tree

5,084 files changed

+250319
-88992
lines changed

Some content is hidden

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

5,084 files changed

+250319
-88992
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ set -eu
2121
set -o pipefail
2222

2323
# Environment variables script works with:
24+
25+
# Fetch origin/main to have an up to date merge base for main...HEAD diff.
26+
git fetch origin main:main
2427
# List of files affected by this commit
25-
: ${MODIFIED_FILES:=$(git diff --name-only HEAD~1)}
28+
: ${MODIFIED_FILES:=$(git diff --name-only main...HEAD)}
2629
# Filter rules for generic windows tests
2730
: ${WINDOWS_AGENTS:='{"queue": "windows"}'}
2831
# Filter rules for generic linux tests

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
/clang/test/CXX/drs/ @Endilll
3131
/clang/www/cxx_dr_status.html @Endilll
3232
/clang/www/make_cxx_dr_status @Endilll
33+
34+
/lldb/ @JDevlieghere

.github/new-prs-labeler.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,3 +794,35 @@ llvm:binary-utilities:
794794
- llvm/tools/llvm-size/**
795795
- llvm/tools/llvm-strings/**
796796
- llvm/tools/llvm-symbolizer/**
797+
798+
clang:openmp:
799+
- clang/include/clang/Basic/OpenMP*
800+
- clang/include/clang/AST/OpenMPClause.h
801+
- clang/include/clang/AST/DeclOpenMP.h
802+
- clang/include/clang/AST/ExprOpenMP.h
803+
- clang/include/clang/AST/StmtOpenMP.h
804+
- clang/lib/AST/DeclOpenMP.cpp
805+
- clang/lib/AST/OpenMPClause.cpp
806+
- clang/lib/AST/StmtOpenMP.cpp
807+
- clang/lib/Headers/openmp_wrappers/**
808+
- clang/lib/Parse/ParseOpenMP.cpp
809+
- clang/lib/Basic/OpenMPKinds.cpp
810+
- clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
811+
- clang/lib/Driver/ToolChains/AMDGPUOpenMP.h
812+
- clang/lib/CodeGen/CgStmtOpenMP.cpp
813+
- clang/lib/CodeGen/CGOpenMP*
814+
- clang/lib/Sema/SemaOpenMP.cpp
815+
- clang/test/OpenMP/**
816+
- clang/test/AST/ast-dump-openmp-*
817+
- llvm/lib/Frontend/OpenMP/**
818+
- llvm/lib/Transforms/IPO/OpenMPOpt.cpp
819+
- llvm/include/llvm/Frontend/OpenMP/**
820+
- llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
821+
- llvm/unittests/Frontend/OpenMP*
822+
- llvm/test/Transforms/OpenMP/**
823+
824+
openmp:libomp:
825+
- any: ['openmp/**', '!openmp/libomptarget/**']
826+
827+
openmp:libomptarget:
828+
- any: ['openmp/**', '!openmp/runtime/**']

.github/workflows/docs.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# LLVM Documentation CI
2+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3+
# See https://llvm.org/LICENSE.txt for license information.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
name: "Test documentation build"
7+
8+
permissions:
9+
contents: read
10+
11+
on:
12+
push:
13+
branches:
14+
- 'main'
15+
paths:
16+
- 'llvm/docs/**'
17+
- 'clang/docs/**'
18+
- 'clang-tools-extra/docs/**'
19+
- 'lldb/docs/**'
20+
- 'libunwind/docs/**'
21+
- 'libcxx/docs/**'
22+
- 'libc/docs/**'
23+
pull_request:
24+
paths:
25+
- 'llvm/docs/**'
26+
- 'clang/docs/**'
27+
- 'clang-tools-extra/docs/**'
28+
- 'lldb/docs/**'
29+
- 'libunwind/docs/**'
30+
- 'libcxx/docs/**'
31+
- 'libc/docs/**'
32+
33+
jobs:
34+
check-docs-build:
35+
name: "Test documentation build"
36+
runs-on: ubuntu-latest
37+
steps:
38+
# Don't fetch before checking for file changes to force the file changes
39+
# action to use the Github API in pull requests. If it's a push to a
40+
# branch we can't use the Github API to get the diff, so we need to have
41+
# a local checkout beforehand.
42+
- name: Fetch LLVM sources (Push)
43+
if: ${{ github.event_name == 'push' }}
44+
uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 1
47+
- name: Get subprojects that have doc changes
48+
id: docs-changed-subprojects
49+
uses: tj-actions/changed-files@v39
50+
with:
51+
files_yaml: |
52+
llvm:
53+
- 'llvm/docs/**'
54+
clang:
55+
- 'clang/docs/**'
56+
clang-tools-extra:
57+
- 'clang-tools-extra/docs/**'
58+
lldb:
59+
- 'lldb/docs/**'
60+
libunwind:
61+
- 'libunwind/docs/**'
62+
libcxx:
63+
- 'libcxx/docs/**'
64+
libc:
65+
- 'libc/docs/**'
66+
- name: Fetch LLVM sources (PR)
67+
if: ${{ github.event_name == 'pull_request' }}
68+
uses: actions/checkout@v4
69+
with:
70+
fetch-depth: 1
71+
- name: Setup Python env
72+
uses: actions/setup-python@v4
73+
with:
74+
python-version: '3.11'
75+
cache: 'pip'
76+
cache-dependency-path: 'llvm/docs/requirements.txt'
77+
- name: Install python dependencies
78+
run: pip install -r llvm/docs/requirements.txt
79+
- name: Install system dependencies
80+
run: |
81+
sudo apt-get update
82+
# swig and graphviz are lldb specific dependencies
83+
sudo apt-get install -y cmake ninja-build swig graphviz
84+
- name: Build LLVM docs
85+
if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
86+
run: |
87+
cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON ./llvm
88+
TZ=UTC ninja -C llvm-build docs-llvm-html docs-llvm-man
89+
- name: Build Clang docs
90+
if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
91+
run: |
92+
cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON ./llvm
93+
TZ=UTC ninja -C clang-build docs-clang-html docs-clang-man
94+
- name: Build clang-tools-extra docs
95+
if: steps.docs-changed-subprojects.outputs.clang-tools-extra_any_changed == 'true'
96+
run: |
97+
cmake -B clang-tools-extra-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_SPHINX=ON ./llvm
98+
TZ=UTC ninja -C clang-tools-extra-build docs-clang-tools-html docs-clang-tools-man
99+
- name: Build LLDB docs
100+
if: steps.docs-changed-subprojects.outputs.lldb_any_changed == 'true'
101+
run: |
102+
cmake -B lldb-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_SPHINX=ON ./llvm
103+
TZ=UTC ninja -C lldb-build docs-lldb-html docs-lldb-man
104+
- name: Build libunwind docs
105+
if: steps.docs-changed-subprojects.outputs.libunwind_any_changed == 'true'
106+
run: |
107+
cmake -B libunwind-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
108+
TZ=UTC ninja -C libunwind-build docs-libunwind-html
109+
- name: Build libcxx docs
110+
if: steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true'
111+
run: |
112+
cmake -B libcxx-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx" -DLLVM_ENABLE_SPHINX=ON ./runtimes
113+
TZ=UTC ninja -C libcxx-build docs-libcxx-html
114+
- name: Build libc docs
115+
if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
116+
run: |
117+
cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
118+
TZ=UTC ninja -C docs-libc-html
119+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Check libc++ generated files"
2+
on:
3+
pull_request:
4+
paths:
5+
- 'libcxx/**'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
check_generated_files:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Fetch LLVM sources
15+
uses: actions/checkout@v4
16+
17+
- name: Install dependencies
18+
uses: aminya/setup-cpp@v1
19+
with:
20+
clangformat: 17.0.1
21+
ninja: true
22+
23+
- name: Check generated files
24+
run: libcxx/utils/ci/run-buildbot check-generated-output

.github/workflows/release-tasks.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
./llvm/utils/release/github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} upload --files ./*doxygen*.tar.xz
4949
5050
- name: Create Release Notes Artifact
51-
uses: actions/download-artifact@v3
51+
uses: actions/upload-artifact@v3
5252
with:
5353
name: release-notes
5454
path: docs-build/html-export/
@@ -104,16 +104,18 @@ jobs:
104104
run: |
105105
cd llvm/utils/lit
106106
# Remove 'dev' suffix from lit version.
107-
sed -i "s/ + 'dev'//g" lit/__init__.py
107+
sed -i 's/ + "dev"//g' lit/__init__.py
108108
python3 setup.py sdist
109109
110110
- name: Upload lit to test.pypi.org
111111
uses: pypa/gh-action-pypi-publish@release/v1
112112
with:
113113
password: ${{ secrets.LLVM_LIT_TEST_PYPI_API_TOKEN }}
114114
repository-url: https://test.pypi.org/legacy/
115+
packages-dir: llvm/utils/lit/dist/
115116

116117
- name: Upload lit to pypi.org
117118
uses: pypa/gh-action-pypi-publish@release/v1
118119
with:
119120
password: ${{ secrets.LLVM_LIT_PYPI_API_TOKEN }}
121+
packages-dir: llvm/utils/lit/dist/

bolt/include/bolt/Core/AddressMap.h

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// Helper class to create a mapping from input to output addresses needed for
10-
// updating debugging symbols and BAT. We emit an MCSection containing
11-
// <Input address, Output MCSymbol> pairs to the object file and JITLink will
12-
// transform this in <Input address, Output address> pairs. The linker output
13-
// can then be parsed and used to establish the mapping.
9+
// This file contains the declaration of the AddressMap class used for looking
10+
// up addresses in the output object.
1411
//
1512
//===----------------------------------------------------------------------===//
16-
//
13+
1714
#ifndef BOLT_CORE_ADDRESS_MAP_H
1815
#define BOLT_CORE_ADDRESS_MAP_H
1916

2017
#include "llvm/ADT/StringRef.h"
18+
#include "llvm/MC/MCSymbol.h"
2119

2220
#include <optional>
2321
#include <unordered_map>
@@ -30,26 +28,48 @@ namespace bolt {
3028

3129
class BinaryContext;
3230

31+
/// Helper class to create a mapping from input entities to output addresses
32+
/// needed for updating debugging symbols and BAT. We emit a section containing
33+
/// <Input entity, Output MCSymbol> pairs to the object file and JITLink will
34+
/// transform this in <Input entity, Output address> pairs. The linker output
35+
/// can then be parsed and used to establish the mapping.
36+
///
37+
/// The entities that can be mapped to output address are input addresses and
38+
/// labels (MCSymbol). Input addresses support one-to-many mapping.
3339
class AddressMap {
34-
using MapTy = std::unordered_multimap<uint64_t, uint64_t>;
35-
MapTy Map;
40+
static const char *const AddressSectionName;
41+
static const char *const LabelSectionName;
3642

37-
public:
38-
static const char *const SectionName;
43+
/// Map multiple <input address> to <output address>.
44+
using Addr2AddrMapTy = std::unordered_multimap<uint64_t, uint64_t>;
45+
Addr2AddrMapTy Address2AddressMap;
3946

47+
/// Map MCSymbol to its output address. Normally used for temp symbols that
48+
/// are not updated by the linker.
49+
using Label2AddrMapTy = DenseMap<const MCSymbol *, uint64_t>;
50+
Label2AddrMapTy Label2AddrMap;
51+
52+
public:
4053
static void emit(MCStreamer &Streamer, BinaryContext &BC);
41-
static AddressMap parse(StringRef Buffer, const BinaryContext &BC);
54+
static std::optional<AddressMap> parse(BinaryContext &BC);
4255

4356
std::optional<uint64_t> lookup(uint64_t InputAddress) const {
44-
auto It = Map.find(InputAddress);
45-
if (It != Map.end())
57+
auto It = Address2AddressMap.find(InputAddress);
58+
if (It != Address2AddressMap.end())
59+
return It->second;
60+
return std::nullopt;
61+
}
62+
63+
std::optional<uint64_t> lookup(const MCSymbol *Symbol) const {
64+
auto It = Label2AddrMap.find(Symbol);
65+
if (It != Label2AddrMap.end())
4666
return It->second;
4767
return std::nullopt;
4868
}
4969

50-
std::pair<MapTy::const_iterator, MapTy::const_iterator>
70+
std::pair<Addr2AddrMapTy::const_iterator, Addr2AddrMapTy::const_iterator>
5171
lookupAll(uint64_t InputAddress) const {
52-
return Map.equal_range(InputAddress);
72+
return Address2AddressMap.equal_range(InputAddress);
5373
}
5474
};
5575

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,6 @@ class BinaryFunction {
192192
static constexpr uint64_t COUNT_NO_PROFILE =
193193
BinaryBasicBlock::COUNT_NO_PROFILE;
194194

195-
/// We have to use at least 2-byte alignment for functions because of C++ ABI.
196-
static constexpr unsigned MinAlign = 2;
197-
198195
static const char TimerGroupName[];
199196
static const char TimerGroupDesc[];
200197

@@ -1720,8 +1717,17 @@ class BinaryFunction {
17201717
return *this;
17211718
}
17221719

1723-
Align getAlign() const { return Align(Alignment); }
1720+
uint16_t getMinAlignment() const {
1721+
// Align data in code BFs minimum to CI alignment
1722+
if (!size() && hasIslandsInfo())
1723+
return getConstantIslandAlignment();
1724+
return BC.MIB->getMinFunctionAlignment();
1725+
}
1726+
1727+
Align getMinAlign() const { return Align(getMinAlignment()); }
1728+
17241729
uint16_t getAlignment() const { return Alignment; }
1730+
Align getAlign() const { return Align(getAlignment()); }
17251731

17261732
BinaryFunction &setMaxAlignmentBytes(uint16_t MaxAlignBytes) {
17271733
MaxAlignmentBytes = MaxAlignBytes;

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ class MCPlusBuilder {
11851185

11861186
/// Set the label of \p Inst. This label will be emitted right before \p Inst
11871187
/// is emitted to MCStreamer.
1188-
bool setLabel(MCInst &Inst, MCSymbol *Label);
1188+
bool setLabel(MCInst &Inst, MCSymbol *Label, AllocatorIdTy AllocatorId = 0);
11891189

11901190
/// Return MCSymbol that represents a target of this instruction at a given
11911191
/// operand number \p OpNum. If there's no symbol associated with
@@ -2077,6 +2077,12 @@ class MCPlusBuilder {
20772077
return BlocksVectorTy();
20782078
}
20792079

2080+
virtual uint16_t getMinFunctionAlignment() const {
2081+
// We have to use at least 2-byte alignment for functions because of C++
2082+
// ABI.
2083+
return 2;
2084+
}
2085+
20802086
// AliasMap caches a mapping of registers to the set of registers that
20812087
// alias (are sub or superregs of itself, including itself).
20822088
std::vector<BitVector> AliasMap;

0 commit comments

Comments
 (0)