Skip to content

Commit ea7c58b

Browse files
authored
Merge branch 'llvm:main' into low_trip_memcheck
2 parents a152314 + 97e3220 commit ea7c58b

File tree

3,449 files changed

+195204
-70916
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,449 files changed

+195204
-70916
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@
8282
/mlir/**/*EmulateNarrowType* @hanhanW
8383
/mlir/lib/Dialect/Vector/Transforms/* @hanhanW @nicolasvasilache
8484

85+
# Presburger library in MLIR
86+
/mlir/**/*Presburger* @Groverkss @Superty
87+
8588
# Tensor Dialect in MLIR.
8689
/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp @hanhanW @nicolasvasilache
87-
/mlir/lib/Dialect/Tensor/Transforms/FoldIntoPackAndUnpackPatterns.cpp @hanhanW @nicolasvasilache
90+
/mlir/lib/Dialect/Tensor/Transforms/* @hanhanW @nicolasvasilache
8891

8992
# Transform Dialect in MLIR.
9093
/mlir/include/mlir/Dialect/Transform/* @ftynse @nicolasvasilache

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Github action workflows should be stored in this directrory.
1+
Github action workflows should be stored in this directory.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
name: Build CI Container
3+
4+
permissions:
5+
contents: read
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- .github/workflows/build-ci-container.yml
13+
- '.github/workflows/containers/github-action-ci/**'
14+
pull_request:
15+
branches:
16+
- main
17+
paths:
18+
- .github/workflows/build-ci-container.yml
19+
- '.github/workflows/containers/github-action-ci/**'
20+
21+
jobs:
22+
build-ci-container:
23+
if: github.repository_owner == 'llvm'
24+
runs-on: ubuntu-latest
25+
permissions:
26+
packages: write
27+
steps:
28+
- name: Write Variables
29+
id: vars
30+
run: |
31+
tag=`date +%s`
32+
container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/ci-ubuntu-22.04"
33+
echo "container-name=$container_name" >> $GITHUB_OUTPUT
34+
echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT
35+
36+
- name: Checkout LLVM
37+
uses: actions/checkout@v4
38+
with:
39+
sparse-checkout: .github/workflows/containers/github-action-ci/
40+
41+
- name: Build Container
42+
working-directory: ./.github/workflows/containers/github-action-ci/
43+
run: |
44+
podman build -t ${{ steps.vars.outputs.container-name-tag }} .
45+
podman tag ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name }}:latest
46+
47+
- name: Test Container
48+
run: |
49+
for image in ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name }}; do
50+
podman run --rm -it $image /usr/bin/bash -x -c 'printf '\''#include <iostream>\nint main(int argc, char **argv) { std::cout << "Hello\\n"; }'\'' | clang++ -x c++ - && ./a.out | grep Hello'
51+
done
52+
53+
- name: Push Container
54+
if: github.event_name == 'push'
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
run: |
58+
podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io
59+
podman push ${{ steps.vars.outputs.container-name-tag }}
60+
podman push ${{ steps.vars.outputs.container-name }}:latest
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM docker.io/library/ubuntu:22.04 as base
2+
ENV LLVM_SYSROOT=/opt/llvm/
3+
4+
FROM base as toolchain
5+
ENV LLVM_MAJOR=17
6+
ENV LLVM_VERSION=${LLVM_MAJOR}.0.6
7+
ENV LLVM_DIRNAME=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-22.04
8+
ENV LLVM_FILENAME=${LLVM_DIRNAME}.tar.xz
9+
10+
RUN apt-get update && \
11+
apt-get install -y \
12+
curl \
13+
xz-utils
14+
15+
RUN mkdir -p $LLVM_SYSROOT/bin/ $LLVM_SYSROOT/lib/
16+
17+
RUN curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/$LLVM_FILENAME
18+
19+
RUN tar -C $LLVM_SYSROOT --strip-components=1 -xJf $LLVM_FILENAME \
20+
$LLVM_DIRNAME/bin/clang \
21+
$LLVM_DIRNAME/bin/clang++ \
22+
$LLVM_DIRNAME/bin/clang-cl \
23+
$LLVM_DIRNAME/bin/clang-$LLVM_MAJOR \
24+
$LLVM_DIRNAME/bin/lld \
25+
$LLVM_DIRNAME/bin/ld.lld \
26+
$LLVM_DIRNAME/lib/clang/
27+
28+
29+
FROM base
30+
31+
COPY --from=toolchain $LLVM_SYSROOT $LLVM_SYSROOT
32+
33+
# Need to install curl for hendrikmuhs/ccache-action
34+
# Need nodejs for some of the GitHub actions.
35+
# Need perl-modules for clang analyzer tests.
36+
RUN apt-get update && \
37+
apt-get install -y \
38+
binutils \
39+
cmake \
40+
curl \
41+
libstdc++-11-dev \
42+
ninja-build \
43+
nodejs \
44+
perl-modules \
45+
python3-psutil
46+
47+
ENV LLVM_SYSROOT=$LLVM_SYSROOT
48+
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}

.github/workflows/docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,3 @@ jobs:
167167
run: |
168168
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF ./llvm
169169
TZ=UTC ninja -C flang-build docs-flang-html docs-flang-man
170-
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Libclang Python Binding Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
paths:
10+
- 'clang/bindings/python/**'
11+
- 'clang/tools/libclang/**'
12+
- 'clang/CMakeList.txt'
13+
- '.github/workflows/libclang-python-tests.yml'
14+
- '.github/workflows/llvm-project-tests.yml'
15+
pull_request:
16+
paths:
17+
- 'clang/bindings/python/**'
18+
- 'clang/tools/libclang/**'
19+
- 'clang/CMakeList.txt'
20+
- '.github/workflows/libclang-python-tests.yml'
21+
- '.github/workflows/llvm-project-tests.yml'
22+
23+
concurrency:
24+
# Skip intermediate builds: always.
25+
# Cancel intermediate builds: only if it is a pull request build.
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
28+
29+
jobs:
30+
check-clang-python:
31+
# Build libclang and then run the libclang Python binding's unit tests.
32+
name: Build and run Python unit tests
33+
uses: ./.github/workflows/llvm-project-tests.yml
34+
with:
35+
build_target: check-clang-python
36+
projects: clang
37+
# There is an issue running on "windows-2019".
38+
# See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
39+
os_list: '["ubuntu-latest"]'

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jobs:
185185
std_modules: 'OFF'
186186
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
187187
- config: 'generic-msan'
188-
machine: libcxx-runners-32-set
188+
machine: libcxx-runners-8-set
189189
std_modules: 'OFF'
190190
runs-on: ${{ matrix.machine }}
191191
steps:
@@ -207,4 +207,3 @@ jobs:
207207
**/CMakeError.log
208208
**/CMakeOutput.log
209209
**/crash_diagnostics/*
210-

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
required: false
1515
os_list:
1616
required: false
17-
default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
17+
default: '["ubuntu-latest", "windows-2019", "macOS-12"]'
1818
workflow_call:
1919
inputs:
2020
build_target:
@@ -34,9 +34,7 @@ on:
3434
type: string
3535
# Use windows-2019 due to:
3636
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
37-
# We're using a specific version of macOS due to:
38-
# https://github.com/actions/virtual-environments/issues/5900
39-
default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
37+
default: '["ubuntu-latest", "windows-2019", "macOS-12"]'
4038

4139
concurrency:
4240
# Skip intermediate builds: always.
@@ -87,14 +85,10 @@ jobs:
8785
# enough cache space for all the tests to run at once and still
8886
# fit under the 10 GB limit.
8987
max-size: 500M
90-
key: sccache-${{ matrix.os }}
88+
key: ${{ matrix.os }}
9189
variant: sccache
9290
- name: Build and Test
9391
uses: llvm/actions/build-test-llvm-project@main
94-
env:
95-
# Workaround for https://github.com/actions/virtual-environments/issues/5900.
96-
# This should be a no-op for non-mac OSes
97-
PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
9892
with:
9993
cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ${{ inputs.extra_cmake_args }}'
10094
build_target: '${{ inputs.build_target }}'

.github/workflows/release-binaries.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ jobs:
9393

9494
- name: Build Clang
9595
run: |
96-
cmake -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_ENABLE_ASSERTIONS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DLLVM_ENABLE_PROJECTS=clang -S llvm -B build
97-
ninja -v -C build
96+
cmake -G Ninja -C clang/cmake/caches/Release.cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_POSITION_INDEPENDENT_CODE=ON -S llvm -B build
97+
ninja -v -C build clang
9898
9999
100100
build-binaries:
@@ -152,6 +152,7 @@ jobs:
152152
-triple ${{ matrix.target.triple }} \
153153
-use-ninja \
154154
-no-checkout \
155+
-use-cmake-cache \
155156
-no-test-suite \
156157
-configure-flags "-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
157158

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,11 @@ void DIEBuilder::buildCompileUnits(const bool Init) {
266266
}
267267
void DIEBuilder::buildCompileUnits(const std::vector<DWARFUnit *> &CUs) {
268268
BuilderState.reset(new State());
269-
// Initializing to full size because there could be cross CU references with
270-
// different abbrev offsets. LLVM happens to output CUs that have cross CU
271-
// references with the same abbrev table. So destinations end up in the first
272-
// set, even if they themselves don't have src cross cu ref. We could have
273-
// cases where this is not the case. In which case this container needs to be
274-
// big enough for all.
275-
getState().CloneUnitCtxMap.resize(DwarfContext->getNumCompileUnits());
269+
// Allocating enough for current batch being processed.
270+
// In real use cases we either processing a batch of CUs with no cross
271+
// references, or if they do have them it is due to LTO. With clang they will
272+
// share the same abbrev table. In either case this vector will not grow.
273+
getState().CloneUnitCtxMap.resize(CUs.size());
276274
getState().Type = ProcessingType::CUs;
277275
for (DWARFUnit *CU : CUs)
278276
registerUnit(*CU, false);
@@ -897,6 +895,10 @@ void DIEBuilder::registerUnit(DWARFUnit &DU, bool NeedSort) {
897895
});
898896
}
899897
getState().UnitIDMap[getHash(DU)] = getState().DUList.size();
898+
// This handles the case where we do have cross cu references, but CUs do not
899+
// share the same abbrev table.
900+
if (getState().DUList.size() == getState().CloneUnitCtxMap.size())
901+
getState().CloneUnitCtxMap.emplace_back();
900902
getState().DUList.push_back(&DU);
901903
}
902904

0 commit comments

Comments
 (0)