Skip to content

Commit

Permalink
merge main into amd-staging
Browse files Browse the repository at this point in the history
revert: breaks spirv
4a0d53a PatternMatch: migrate to CmpPredicate (llvm#118534)

Change-Id: I0311c30089f70d9f063cc1e0af8379e406168f40
  • Loading branch information
Jenkins authored and ronlieb committed Dec 13, 2024
2 parents 422a454 + 2135bab commit e1c56fc
Show file tree
Hide file tree
Showing 233 changed files with 13,154 additions and 9,755 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-ci-container-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build Windows CI Container

permissions:
contents: read

on:
push:
branches:
- main
paths:
- .github/workflows/build-ci-container-windows.yml
- '.github/workflows/containers/github-action-ci-windows/**'
pull_request:
branches:
- main
paths:
- .github/workflows/build-ci-container-windows.yml
- '.github/workflows/containers/github-action-ci-windows/**'

jobs:
build-ci-container-windows:
if: github.repository_owner == 'llvm'
runs-on: windows-2019
outputs:
container-name: ${{ steps.vars.outputs.container-name }}
container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
container-filename: ${{ steps.vars.outputs.container-filename }}
steps:
- name: Checkout LLVM
uses: actions/checkout@v4
with:
sparse-checkout: .github/workflows/containers/github-action-ci-windows
- name: Write Variables
id: vars
run: |
$tag = [int64](Get-Date -UFormat %s)
$container_name="ghcr.io/$env:GITHUB_REPOSITORY_OWNER/ci-windows-2019"
echo "container-name=${container_name}" >> $env:GITHUB_OUTPUT
echo "container-name-tag=${container_name}:${tag}" >> $env:GITHUB_OUTPUT
echo "container-filename=ci-windows-${tag}.tar" >> $env:GITHUB_OUTPUT
- name: Build Container
working-directory: .github/workflows/containers/github-action-ci-windows
run: |
docker build -t ${{ steps.vars.outputs.container-name-tag }} .
- name: Save container image
run: |
docker save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }}
- name: Upload container image
uses: actions/upload-artifact@v4
with:
name: container
path: ${{ steps.vars.outputs.container-filename }}
retention-days: 14

push-ci-container:
if: github.event_name == 'push'
needs:
- build-ci-container-windows
permissions:
packages: write
runs-on: windows-2019
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Download container
uses: actions/download-artifact@v4
with:
name: container
- name: Push Container
run: |
docker load -i ${{ needs.build-ci-container.outptus.container-filename }}
docker tag ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name }}:latest
docker login -u ${{ github.actor }} -p $env:GITHUB_TOKEN ghcr.io
docker push ${{ needs.build-ci-container.outputs.container-name-tag }}
docker push ${{ needs.build-ci-container.outputs.container-name }}:latest
118 changes: 118 additions & 0 deletions .github/workflows/containers/github-action-ci-windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Agent image for LLVM org cluster.
# .net 4.8 is required by chocolately package manager.
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019

# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]

# Download the Build Tools bootstrapper.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe /TEMP/vs_buildtools.exe

RUN powershell -Command Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

# Download channel for fixed install.
ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel
ADD ${CHANNEL_URL} /TEMP/VisualStudio.chman

# Install Build Tools with C++ workload.
# - Documentation for docker installation
# https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019
# - Documentation on workloads
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019#c-build-tools
# - Documentation on flags
# https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2019
RUN /TEMP/vs_buildtools.exe --quiet --wait --norestart --nocache \
--channelUri C:\TEMP\VisualStudio.chman \
--installChannelUri C:\TEMP\VisualStudio.chman \
--installPath C:\BuildTools \
--add Microsoft.VisualStudio.Workload.VCTools \
--add Microsoft.VisualStudio.Component.VC.ATL \
--includeRecommended \
|| IF "%ERRORLEVEL%"=="3010" EXIT 0

# Register DIA dll (Debug Interface Access) so it can be used to symbolize
# the stack traces. Register dll for 32 and 64 bit.
# see https://developercommunity.visualstudio.com/content/problem/290674/msdia140dll-is-not-registered-on-vs2017-hosts.html

RUN regsvr32 /S "C:\BuildTools\DIA SDK\bin\amd64\msdia140.dll" & \
regsvr32 /S "C:\BuildTools\DIA SDK\bin\msdia140.dll"

# install tools as described in https://llvm.org/docs/GettingStartedVS.html
# and a few more that were not documented...
RUN choco install -y ninja git
# Pin an older version of Python; the current Python 3.10 fails when
# doing "pip install" for the other dependencies, as it fails to find libxml
# while compiling some package.
RUN choco install -y python3 --version 3.9.7

# ActivePerl is currently not installable via Chocolatey, see
# http://disq.us/p/2ipditb. Install StrawberryPerl instead. Unfortunately,
# StrawberryPerl not only installs Perl, but also a redundant C/C++ compiler
# toolchain, and a copy of pkg-config which can cause misdetections for other
# built products, see
# https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/11 for further
# details. Remove the redundant and unnecessary parts of the StrawberryPerl
# install.
RUN choco install -y strawberryperl && \
rmdir /q /s c:\strawberry\c && \
del /q c:\strawberry\perl\bin\pkg-config*

# libcxx requires clang(-cl) to be available
RUN choco install -y sccache llvm
RUN pip install psutil

RUN curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/llvm-mingw-20230320-ucrt-x86_64.zip && \
powershell Expand-Archive llvm-mingw-*-ucrt-x86_64.zip -DestinationPath . && \
del llvm-mingw-*-ucrt-x86_64.zip && \
ren llvm-mingw-20230320-ucrt-x86_64 llvm-mingw

# configure Python encoding
ENV PYTHONIOENCODING=UTF-8

# update the path variable
# C:\Program Files\Git\usr\bin contains a usable bash and other unix tools.
# C:\llvm-mingw\bin contains Clang configured for mingw targets and
# corresponding sysroots. Both the 'llvm' package (with Clang defaulting
# to MSVC targets) and this directory contains executables named
# 'clang.exe' - add this last to let the other one have precedence.
# To use these compilers, use the triple prefixed form, e.g.
# x86_64-w64-mingw32-clang.
# C:\buildtools and SDK paths are ones that are set by c:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 -host_arch=amd64
RUN powershell -Command \
[System.Environment]::SetEnvironmentVariable('PATH', \
[System.Environment]::GetEnvironmentVariable('PATH', 'machine') + ';C:\Program Files\Git\usr\bin;C:\llvm-mingw\bin' \
+ ';C:\BuildTools\Common7\IDE\' \
+ ';C:\BuildTools\Common7\IDE\CommonExt ensions\Microsoft\TeamFoundation\Team Explorer' \
+ ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin' \
+ ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja' \
+ ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer' \
+ ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow' \
+ ';C:\BuildTools\Common7\IDE\VC\VCPackages' \
+ ';C:\BuildTools\Common7\Tools\' \
+ ';C:\BuildTools\Common7\Tools\devinit' \
+ ';C:\BuildTools\MSBuild\Current\Bin' \
+ ';C:\BuildTools\MSBuild\Current\bin\Roslyn' \
+ ';C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64' \
+ ';C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\' \
+ ';C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64' \
+ ';C:\Program Files (x86)\Windows Kits\10\bin\x64' \
+ ';C:\Windows\Microsoft.NET\Framework64\v4.0.30319' \
,'machine')
# support long file names during git checkout
RUN git config --system core.longpaths true & \
git config --global core.autocrlf false
# handle for debugging of files beeing locked by some processes.
RUN choco install -y handle
RUN pip3 install pywin32 buildbot-worker==2.8.4
ARG RUNNER_VERSION=2.319.1
ENV RUNNER_VERSION=$RUNNER_VERSION
RUN powershell -Command \
Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v${env:RUNNER_VERSION}/actions-runner-win-x64-${env:RUNNER_VERSION}.zip -OutFile actions-runner-win.zip ; \
Add-Type -AssemblyName System.IO.Compression.FileSystem ; \
[System.IO.Compression.ZipFile]::ExtractToDirectory('actions-runner-win.zip', $PWD) ;\
rm actions-runner-win.zip
2 changes: 1 addition & 1 deletion .github/workflows/containers/github-action-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM docker.io/library/ubuntu:22.04 as base
ENV LLVM_SYSROOT=/opt/llvm

FROM base as stage1-toolchain
ENV LLVM_VERSION=19.1.2
ENV LLVM_VERSION=19.1.5

RUN apt-get update && \
apt-get install -y \
Expand Down
46 changes: 35 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ jobs:
flang:
- 'flang/docs/**'
- 'flang/include/flang/Optimizer/Dialect/FIROps.td'
workflow:
- '.github/workflows/docs.yml'
- name: Fetch LLVM sources (PR)
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
Expand All @@ -115,77 +117,99 @@ jobs:
- name: Setup output folder
run: mkdir built-docs
- name: Build LLVM docs
if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C llvm-build docs-llvm-html docs-llvm-man
mkdir built-docs/llvm
cp -r llvm-build/docs/* built-docs/llvm/
- name: Build Clang docs
if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.clang_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C clang-build docs-clang-html docs-clang-man
mkdir built-docs/clang
cp -r clang-build/docs/* built-docs/clang/
- name: Build clang-tools-extra docs
if: steps.docs-changed-subprojects.outputs.clang-tools-extra_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.clang-tools-extra_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B clang-tools-extra-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C clang-tools-extra-build docs-clang-tools-html docs-clang-tools-man
mkdir built-docs/clang-tools-extra
cp -r clang-tools-extra-build/docs/* built-docs/clang-tools-extra/
- name: Build LLDB docs
if: steps.docs-changed-subprojects.outputs.lldb_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.lldb_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B lldb-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C lldb-build docs-lldb-html docs-lldb-man
mkdir built-docs/lldb
cp -r lldb-build/docs/* built-docs/lldb/
- name: Build libunwind docs
if: steps.docs-changed-subprojects.outputs.libunwind_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.libunwind_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B libunwind-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libunwind-build docs-libunwind-html
mkdir built-docs/libunwind
cp -r libunwind-build/libunwind/docs/* built-docs/libunwind
- name: Build libcxx docs
if: steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B libcxx-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx;libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libcxx-build docs-libcxx-html
mkdir built-docs/libcxx
cp -r libcxx-build/libcxx/docs/* built-docs/libcxx/
- name: Build libc docs
if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.libc_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libc-build docs-libc-html
mkdir built-docs/libc
cp -r libc-build/libc/docs/* built-docs/libc/
- name: Build LLD docs
if: steps.docs-changed-subprojects.outputs.lld_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.lld_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B lld-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C lld-build docs-lld-html
mkdir built-docs/lld
cp -r lld-build/docs/* built-docs/lld/
- name: Build OpenMP docs
if: steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C openmp-build docs-openmp-html
mkdir built-docs/openmp
cp -r openmp-build/docs/* built-docs/openmp/
- name: Build Polly docs
if: steps.docs-changed-subprojects.outputs.polly_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.polly_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
mkdir built-docs/polly
cp -r polly-build/docs/* built-docs/polly/
- name: Build Flang docs
if: steps.docs-changed-subprojects.outputs.flang_any_changed == 'true'
if: |
steps.docs-changed-subprojects.outputs.flang_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C flang-build docs-flang-html
Expand Down
20 changes: 20 additions & 0 deletions bolt/test/merge-fdata-bat-no-lbr.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Check that merge-fdata correctly handles merging two fdata files with both boltedcollection and no_lbr tags.

# REQUIRES: system-linux

# RUN: split-file %s %t
# RUN: merge-fdata %t/a.fdata %t/b.fdata -o %t/merged.fdata
# RUN: FileCheck %s --input-file %t/merged.fdata

# CHECK: boltedcollection
# CHECK: no_lbr
# CHECK: main 2

#--- a.fdata
boltedcollection
no_lbr
main 1
#--- b.fdata
boltedcollection
no_lbr
main 1
15 changes: 15 additions & 0 deletions bolt/test/merge-fdata-lbr-mode.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Check that merge-fdata tool doesn't falsely print no_lbr when not in no-lbr mode

# REQUIRES: system-linux

# RUN: split-file %s %t
# RUN: merge-fdata %t/a.fdata %t/b.fdata -o %t/merged.fdata
# RUN: FileCheck %s --input-file %t/merged.fdata

# CHECK-NOT: no_lbr
# CHECK: main 2

#--- a.fdata
main 1
#--- b.fdata
main 1
16 changes: 16 additions & 0 deletions bolt/test/merge-fdata-mixed-bat-no-lbr.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Check that merge-fdata doesn't incorrectly merge two fdata files with boltedcollection and no_lbr tags.

# REQUIRES: system-linux

# RUN: split-file %s %t
# RUN: not merge-fdata %t/a.fdata %t/b.fdata 2>&1 | FileCheck %s

# CHECK: cannot mix profile collected in BOLT and non-BOLT deployments

#--- a.fdata
boltedcollection
no_lbr
main 1
#--- b.fdata
no_lbr
main 1
15 changes: 15 additions & 0 deletions bolt/test/merge-fdata-mixed-mode.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Check that merge-fdata tool correctly reports error message
## when trying to merge 'no-lbr' and 'lbr' profiles

# REQUIRES: system-linux

# RUN: split-file %s %t
# RUN: not merge-fdata %t/a.fdata %t/b.fdata 2>&1 | FileCheck %s

# CHECK: cannot mix 'no_lbr' and 'lbr' profiles.

#--- a.fdata
no_lbr
main 1
#--- b.fdata
main 1
Loading

0 comments on commit e1c56fc

Please sign in to comment.