Skip to content

Commit fc280dd

Browse files
committed
Rebase on main and update commit message
Created using spr 1.3.6-beta.1
2 parents 7ffa3dd + 813bacf commit fc280dd

File tree

1,891 files changed

+94533
-43386
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,891 files changed

+94533
-43386
lines changed

.github/workflows/commit-access-review.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,47 @@ def check_manual_requests(
6767
) -> list[str]:
6868
"""
6969
Return a list of users who have been asked since ``start_date`` if they
70-
want to keep their commit access.
70+
want to keep their commit access or if they have applied for commit
71+
access since ``start_date``
7172
"""
73+
7274
query = """
73-
query ($query: String!) {
74-
search(query: $query, type: ISSUE, first: 100) {
75+
query ($query: String!, $after: String) {
76+
search(query: $query, type: ISSUE, first: 100, after: $after) {
7577
nodes {
7678
... on Issue {
77-
body
78-
comments (first: 100) {
79-
nodes {
80-
author {
81-
login
82-
}
83-
}
79+
author {
80+
login
8481
}
82+
body
8583
}
8684
}
85+
pageInfo {
86+
hasNextPage
87+
endCursor
88+
}
8789
}
8890
}
8991
"""
9092
formatted_start_date = start_date.strftime("%Y-%m-%dT%H:%M:%S")
9193
variables = {
92-
"query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access"
94+
"query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access,infra:commit-access-request"
9395
}
9496

95-
res_header, res_data = gh._Github__requester.graphql_query(
96-
query=query, variables=variables
97-
)
98-
data = res_data["data"]
97+
has_next_page = True
9998
users = []
100-
for issue in data["search"]["nodes"]:
101-
users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])])
102-
99+
while has_next_page:
100+
res_header, res_data = gh._Github__requester.graphql_query(
101+
query=query, variables=variables
102+
)
103+
data = res_data["data"]
104+
for issue in data["search"]["nodes"]:
105+
users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])])
106+
if issue["author"]:
107+
users.append(issue["author"]["login"])
108+
has_next_page = data["search"]["pageInfo"]["hasNextPage"]
109+
if has_next_page:
110+
variables["after"] = data["search"]["pageInfo"]["endCursor"]
103111
return users
104112

105113

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ RUN apt-get update && \
5757
nodejs \
5858
perl-modules \
5959
python3-psutil \
60+
sudo \
6061

6162
# These are needed by the premerge pipeline. Pip is used to install
6263
# dependent python packages and ccache is used for build caching. File and
@@ -66,12 +67,28 @@ RUN apt-get update && \
6667
file \
6768
tzdata
6869

70+
# Install sccache as it is needed by most of the project test workflows and
71+
# cannot be installed by the ccache action when executing as a non-root user.
72+
# TODO(boomanaiden154): This should be switched to being installed with apt
73+
# once we bump to Ubuntu 24.04.
74+
RUN curl -L 'https://github.com/mozilla/sccache/releases/download/v0.7.6/sccache-v0.7.6-x86_64-unknown-linux-musl.tar.gz' > /tmp/sccache.tar.gz && \
75+
echo "2902a5e44c3342132f07b62e70cca75d9b23252922faf3b924f449808cc1ae58 /tmp/sccache.tar.gz" | sha256sum -c && \
76+
tar xzf /tmp/sccache.tar.gz -O --wildcards '*/sccache' > '/usr/local/bin/sccache' && \
77+
rm /tmp/sccache.tar.gz && \
78+
chmod +x /usr/local/bin/sccache
79+
6980
ENV LLVM_SYSROOT=$LLVM_SYSROOT
7081
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
7182

7283
# Create a new user to avoid test failures related to a lack of expected
7384
# permissions issues in some tests. Set the user id to 1001 as that is the
7485
# user id that Github Actions uses to perform the checkout action.
7586
RUN useradd gha -u 1001 -m -s /bin/bash
87+
88+
# Also add the user to passwordless sudoers so that we can install software
89+
# later on without having to rebuild the container.
90+
RUN adduser gha sudo
91+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
92+
7693
USER gha
7794

.github/workflows/hlsl-matrix.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: HLSL Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
branches:
10+
- main
11+
paths:
12+
- llvm/**/DirectX/**
13+
- .github/workflows/hlsl*
14+
- clang/*HLSL*/**/*
15+
- clang/**/*HLSL*
16+
- llvm/**/Frontend/HLSL/**/*
17+
18+
jobs:
19+
HLSL-Tests:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
runs-on:
24+
- hlsl-macos
25+
26+
uses: ./.github/workflows/hlsl-test-all.yaml
27+
with:
28+
SKU: hlsl-macos
29+
TestTarget: check-hlsl-clang-mtl # TODO: This target changes based on SKU
30+
LLVM-ref: ${{ github.ref }}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: HLSL Test
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
OffloadTest-branch:
10+
description: 'Test Suite Branch'
11+
required: false
12+
default: 'main'
13+
type: string
14+
LLVM-ref:
15+
description: 'LLVM Branch'
16+
required: false
17+
default: 'main'
18+
type: string
19+
SKU:
20+
required: true
21+
type: string
22+
TestTarget:
23+
required: false
24+
default: 'check-hlsl'
25+
type: string
26+
27+
jobs:
28+
build:
29+
runs-on: ${{ inputs.SKU }}
30+
steps:
31+
- name: Checkout DXC
32+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
33+
with:
34+
repository: Microsoft/DirectXShaderCompiler
35+
ref: main
36+
path: DXC
37+
submodules: true
38+
- name: Checkout LLVM
39+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
40+
with:
41+
ref: ${{ inputs.LLVM-branch }}
42+
path: llvm-project
43+
- name: Checkout OffloadTest
44+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
with:
46+
repository: llvm-beanz/offload-test-suite
47+
ref: main
48+
path: OffloadTest
49+
- name: Checkout Golden Images
50+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
51+
with:
52+
repository: llvm-beanz/offload-golden-images
53+
ref: main
54+
path: golden-images
55+
- name: Setup Windows
56+
if: runner.os == 'Windows'
57+
uses: llvm/actions/setup-windows@main
58+
with:
59+
arch: amd64
60+
- name: Build DXC
61+
run: |
62+
cd DXC
63+
mkdir build
64+
cd build
65+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -C ${{ github.workspace }}/DXC/cmake/caches/PredefinedParams.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DHLSL_DISABLE_SOURCE_GENERATION=On ${{ github.workspace }}/DXC/
66+
ninja dxv llvm-dis
67+
- name: Build LLVM
68+
run: |
69+
cd llvm-project
70+
mkdir build
71+
cd build
72+
cmake -G Ninja -DDXIL_DIS=${{ github.workspace }}/DXC/build/bin/llvm-dis -DLLVM_INCLUDE_DXIL_TESTS=On -DCMAKE_BUILD_TYPE=Release -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images ${{ github.workspace }}/llvm-project/llvm/
73+
ninja hlsl-test-depends llvm-test-depends clang-test-depends
74+
- name: Run HLSL Tests
75+
run: |
76+
cd llvm-project
77+
cd build
78+
ninja check-llvm
79+
ninja check-clang
80+
ninja check-hlsl-unit
81+
ninja ${{ inputs.TestTarget }}
82+
- name: Publish Test Results
83+
uses: EnricoMi/publish-unit-test-result-action/macos@170bf24d20d201b842d7a52403b73ed297e6645b # v2
84+
if: always() && runner.os == 'macOS'
85+
with:
86+
comment_mode: off
87+
files: llvm-project/build/**/testresults.xunit.xml

.github/workflows/libclang-python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jobs:
3737
projects: clang
3838
# There is an issue running on "windows-2019".
3939
# See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
40-
os_list: '["ubuntu-latest"]'
40+
os_list: '["ubuntu-22.04"]'
4141
python_version: ${{ matrix.python-version }}

.github/workflows/llvm-project-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ on:
3939
type: string
4040
# Use windows-2019 due to:
4141
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
42-
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
42+
# Use ubuntu-22.04 rather than ubuntu-latest to match the ubuntu
43+
# version in the CI container. Without this, setup-python tries
44+
# to install a python version linked against a newer version of glibc.
45+
# TODO(boomanaiden154): Bump the Ubuntu version once the version in the
46+
# container is bumped.
47+
default: '["ubuntu-22.04", "windows-2019", "macOS-13"]'
4348

4449
python_version:
4550
required: false
@@ -113,7 +118,8 @@ jobs:
113118
run: |
114119
if [ "${{ runner.os }}" == "Linux" ]; then
115120
builddir="/mnt/build/"
116-
mkdir -p $builddir
121+
sudo mkdir -p $builddir
122+
sudo chown gha $builddir
117123
extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
118124
else
119125
builddir="$(pwd)"/build

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Install clang-format
6161
uses: aminya/setup-cpp@v1
6262
with:
63-
clangformat: 18.1.7
63+
clangformat: 19.1.6
6464

6565
- name: Setup Python env
6666
uses: actions/setup-python@v5

.github/workflows/premerge.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
- name: Setup ccache
3232
uses: hendrikmuhs/[email protected]
3333
- name: Build and Test
34+
# Mark the job as a success even if the step fails so that people do
35+
# not get notified while the new premerge pipeline is in an
36+
# experimental state.
37+
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
38+
# are ready for people to start recieving notifications.
39+
continue-on-error: true
3440
run: |
3541
git config --global --add safe.directory '*'
3642

bolt/lib/Core/BinaryEmitter.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ BreakFunctionNames("break-funcs",
4646
cl::Hidden,
4747
cl::cat(BoltCategory));
4848

49-
cl::list<std::string>
49+
static cl::list<std::string>
5050
FunctionPadSpec("pad-funcs", cl::CommaSeparated,
5151
cl::desc("list of functions to pad with amount of bytes"),
5252
cl::value_desc("func1:pad1,func2:pad2,func3:pad3,..."),
5353
cl::Hidden, cl::cat(BoltCategory));
5454

55-
cl::list<std::string> FunctionPadBeforeSpec(
55+
static cl::list<std::string> FunctionPadBeforeSpec(
5656
"pad-funcs-before", cl::CommaSeparated,
5757
cl::desc("list of functions to pad with amount of bytes"),
5858
cl::value_desc("func1:pad1,func2:pad2,func3:pad3,..."), cl::Hidden,
@@ -74,10 +74,9 @@ X86AlignBranchBoundaryHotOnly("x86-align-branch-boundary-hot-only",
7474
cl::init(true),
7575
cl::cat(BoltOptCategory));
7676

77-
size_t padFunction(const cl::list<std::string> &Spec,
77+
size_t padFunction(std::map<std::string, size_t> &FunctionPadding,
78+
const cl::list<std::string> &Spec,
7879
const BinaryFunction &Function) {
79-
static std::map<std::string, size_t> FunctionPadding;
80-
8180
if (FunctionPadding.empty() && !Spec.empty()) {
8281
for (const std::string &Spec : Spec) {
8382
size_t N = Spec.find(':');
@@ -99,6 +98,15 @@ size_t padFunction(const cl::list<std::string> &Spec,
9998
return 0;
10099
}
101100

101+
size_t padFunctionBefore(const BinaryFunction &Function) {
102+
static std::map<std::string, size_t> CacheFunctionPadding;
103+
return padFunction(CacheFunctionPadding, FunctionPadBeforeSpec, Function);
104+
}
105+
size_t padFunctionAfter(const BinaryFunction &Function) {
106+
static std::map<std::string, size_t> CacheFunctionPadding;
107+
return padFunction(CacheFunctionPadding, FunctionPadSpec, Function);
108+
}
109+
102110
} // namespace opts
103111

104112
namespace {
@@ -324,8 +332,7 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
324332
Streamer.emitCodeAlignment(Function.getAlign(), &*BC.STI);
325333
}
326334

327-
if (size_t Padding =
328-
opts::padFunction(opts::FunctionPadBeforeSpec, Function)) {
335+
if (size_t Padding = opts::padFunctionBefore(Function)) {
329336
// Handle padFuncsBefore after the above alignment logic but before
330337
// symbol addresses are decided.
331338
if (!BC.HasRelocations) {
@@ -404,7 +411,7 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
404411
emitFunctionBody(Function, FF, /*EmitCodeOnly=*/false);
405412

406413
// Emit padding if requested.
407-
if (size_t Padding = opts::padFunction(opts::FunctionPadSpec, Function)) {
414+
if (size_t Padding = opts::padFunctionAfter(Function)) {
408415
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: padding function " << Function << " with "
409416
<< Padding << " bytes\n");
410417
Streamer.emitFill(Padding, MAI->getTextAlignFillValue());

bolt/lib/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ add_llvm_library(LLVMBOLTCore
3535
ParallelUtilities.cpp
3636
Relocation.cpp
3737

38+
NO_EXPORT
3839
DISABLE_LLVM_LINK_LLVM_DYLIB
3940
LINK_LIBS
4041
${LLVM_PTHREAD_LIB}

0 commit comments

Comments
 (0)