Skip to content

Commit

Permalink
Merge branch 'intel:sycl' into sycl
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiZibrov authored Jul 5, 2024
2 parents 0dd949f + ea7751c commit 29d99a9
Show file tree
Hide file tree
Showing 9,209 changed files with 604,735 additions and 185,226 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
25 changes: 17 additions & 8 deletions .ci/generate-buildkite-pipeline-premerge
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ echo "Directories modified:" >&2
echo "$modified_dirs" >&2

function compute-projects-to-test() {
isForWindows=$1
shift
projects=${@}
for project in ${projects}; do
echo "${project}"
Expand All @@ -63,20 +65,28 @@ function compute-projects-to-test() {
done
;;
llvm)
for p in bolt clang clang-tools-extra flang lld lldb mlir polly; do
for p in bolt clang clang-tools-extra lld lldb mlir polly; do
echo $p
done
# Flang is not stable in Windows CI at the moment
if [[ $isForWindows == 0 ]]; then
echo flang
fi
;;
clang)
for p in clang-tools-extra compiler-rt lldb cross-project-tests; do
# lldb is temporarily removed to alleviate Linux pre-commit CI waiting times
for p in clang-tools-extra compiler-rt cross-project-tests; do
echo $p
done
;;
clang-tools-extra)
echo libc
;;
mlir)
echo flang
# Flang is not stable in Windows CI at the moment
if [[ $isForWindows == 0 ]]; then
echo flang
fi
;;
*)
# Nothing to do
Expand Down Expand Up @@ -144,7 +154,6 @@ function exclude-linux() {
for project in ${projects}; do
case ${project} in
cross-project-tests) ;; # tests failing
lldb) ;; # tests failing
openmp) ;; # https://github.com/google/llvm-premerge-checks/issues/410
*)
echo "${project}"
Expand All @@ -161,7 +170,7 @@ function exclude-windows() {
compiler-rt) ;; # tests taking too long
openmp) ;; # TODO: having trouble with the Perl installation
libc) ;; # no Windows support
lldb) ;; # tests failing
lldb) ;; # custom environment requirements (https://github.com/llvm/llvm-project/pull/94208#issuecomment-2146256857)
bolt) ;; # tests are not supported yet
*)
echo "${project}"
Expand Down Expand Up @@ -204,7 +213,7 @@ function check-targets() {
echo "check-unwind"
;;
lldb)
echo "check-all" # TODO: check-lldb may not include all the LLDB tests?
echo "check-lldb"
;;
pstl)
echo "check-all"
Expand Down Expand Up @@ -241,15 +250,15 @@ fi
all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
modified_projects="$(keep-modified-projects ${all_projects})"

linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_projects}))
linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects}))
linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq)
linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)

linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test})
linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq)
linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq)

windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects}))
windows_projects_to_test=$(exclude-windows $(compute-projects-to-test 1 ${modified_projects}))
windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq)
windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq)

Expand Down
1 change: 1 addition & 0 deletions .ci/monolithic-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ targets="${2}"

echo "--- cmake"
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_ENABLE_PROJECTS="${projects}" \
-G Ninja \
Expand Down
6 changes: 5 additions & 1 deletion .ci/monolithic-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
# see https://github.com/llvm/llvm-project/pull/82393 and
# https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
# for further information.
# We limit the number of parallel compile jobs to 24 control memory
# consumption and improve build reliability.
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_ENABLE_PROJECTS="${projects}" \
-G Ninja \
Expand All @@ -58,7 +60,9 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
-D LLVM_PARALLEL_COMPILE_JOBS=16 \
-D LLVM_PARALLEL_LINK_JOBS=4

echo "--- ninja"
# Targets are not escaped as they are passed as separate arguments.
Expand Down
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ f6d557ee34b6bbdb1dc32f29e34b4a4a8ad35e81

# [NFC] clang-format utils/TableGen (#80973)
b9079baaddfed5e604fbfaa1d81a7a1c38e78c26

# [libc++][NFC] Run clang-format on libcxx/include again (#95874)
e2c2ffbe7a1b5d9e32a2ce64279475b50c4cba5b
29 changes: 28 additions & 1 deletion .github/new-prs-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ llvm-lit:
- llvm/utils/lit/**/*

PGO:
- llvm/**/ProfileData/**/*
- llvm/**/SampleProfile*
- llvm/**/CodeGen/MIRSampleProfile*
- llvm/lib/Transforms/Instrumentation/CGProfile.cpp
- llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
- llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
Expand All @@ -62,9 +65,9 @@ PGO:
- llvm/lib/Transforms/Instrumentation/ValueProfile*
- llvm/test/Instrumentation/InstrProfiling/**/*
- llvm/test/Transforms/PGOProfile/**/*
- llvm/test/Transforms/SampleProfile/**/*
- llvm/**/llvm-profdata/**/*
- llvm/**/llvm-profgen/**/*
- llvm/unittests/ProfileData/**/*

vectorization:
- llvm/lib/Transforms/Vectorize/**/*
Expand Down Expand Up @@ -714,6 +717,16 @@ backend:AMDGPU:
- '**/*amdgpu*/**'
- '**/*AMDGPU*/**'

backend:NVPTX:
- 'llvm/**/*nvvm*'
- 'llvm/**/*NVVM*'
- 'llvm/**/*nvptx*'
- 'llvm/**/*NVPTX*'
- 'llvm/**/*nvvm*/**'
- 'llvm/**/*NVVM*/**'
- 'llvm/**/*nvptx*/**'
- 'llvm/**/*NVPTX*/**'

backend:RISC-V:
- clang/**/*riscv*
- clang/**/*RISCV*
Expand Down Expand Up @@ -746,6 +759,8 @@ backend:ARM:
- clang/lib/CodeGen/Targets/ARM.cpp
- clang/include/clang/Basic/BuiltinsARM*
- llvm/test/MC/DisasemblerARM/**
- clang/include/clang/Sema/SemaARM.h
- clang/lib/Sema/SemaARM.cpp

backend:AArch64:
- llvm/include/llvm/IR/IntrinsicsAArch64.td
Expand All @@ -757,6 +772,8 @@ backend:AArch64:
- clang/lib/CodeGen/Targets/AArch64.cpp
- clang/include/clang/Basic/BuiltinsAArch64*
- llvm/test/MC/Disassembler/AArch64/**
- clang/include/clang/Sema/SemaARM.h
- clang/lib/Sema/SemaARM.cpp

backend:loongarch:
- llvm/include/llvm/IR/IntrinsicsLoongArch.td
Expand All @@ -767,6 +784,8 @@ backend:loongarch:
- clang/lib/Driver/ToolChains/Arch/LoongArch.*
- clang/lib/CodeGen/Targets/LoongArch.cpp
- clang/include/clang/Basic/BuiltinsLoongArch*
- clang/include/clang/Sema/SemaLoongArch.h
- clang/lib/Sema/SemaLoongArch.cpp

backend:MSP430:
- llvm/include/llvm/IR/IntrinsicsMSP430.td
Expand Down Expand Up @@ -814,6 +833,8 @@ backend:WebAssembly:
- llvm/unittests/Target/WebAssembly/**
- llvm/test/DebugInfo/WebAssembly/**
- llvm/test/MC/WebAssembly/**
- clang/include/clang/Sema/SemaWasm.h
- clang/lib/Sema/SemaLoongWasm.cpp

backend:X86:
- llvm/include/llvm/IR/IntrinsicsX86.td
Expand All @@ -833,6 +854,8 @@ backend:X86:
- llvm/include/llvm/TargetParser/X86*
- llvm/lib/TargetParser/X86*
- llvm/utils/TableGen/X86*
- clang/include/clang/Sema/SemaX86.h
- clang/lib/Sema/SemaX86.cpp

backend:PowerPC:
- llvm/include/llvm/BinaryFormat/ELFRelocs/PowerPC*
Expand All @@ -857,6 +880,8 @@ backend:PowerPC:
- clang/lib/Driver/ToolChains/AIX*
- clang/lib/Driver/ToolChains/Arch/PPC.*
- clang/test/CodeGen/PowerPC/**
- clang/include/clang/Sema/SemaPPC.h
- clang/lib/Sema/SemaPPC.cpp

backend:SystemZ:
- llvm/include/llvm/BinaryFormat/ELFRelocs/SystemZ*
Expand All @@ -877,6 +902,8 @@ backend:SystemZ:
- clang/lib/Driver/ToolChains/ZOS*
- clang/lib/Driver/ToolChains/Arch/SystemZ.*
- clang/test/CodeGen/SystemZ/**
- clang/include/clang/Sema/SemaSystemZ.h
- clang/lib/Sema/SemaSystemZ.cpp

third-party:unittests:
- third-party/unittests/**
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/ci-post-commit-analyzer-run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import json
import multiprocessing
import os
import re
import subprocess
import sys


def run_analyzer(data):
os.chdir(data["directory"])
command = (
data["command"]
+ f" --analyze --analyzer-output html -o analyzer-results -Xclang -analyzer-config -Xclang max-nodes=75000"
)
print(command)
subprocess.run(command, shell=True, check=True)


def pool_error(e):
print("Error analyzing file:", e)


def main():
db_path = sys.argv[1]
database = json.load(open(db_path))

with multiprocessing.Pool() as pool:
pool.map_async(run_analyzer, [k for k in database], error_callback=pool_error)
pool.close()
pool.join()


if __name__ == "__main__":
main()
95 changes: 95 additions & 0 deletions .github/workflows/ci-post-commit-analyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Post-Commit Static Analyzer

permissions:
contents: read

on:
push:
branches:
- 'release/**'
paths:
- 'clang/**'
- 'llvm/**'
- '.github/workflows/ci-post-commit-analyzer.yml'
pull_request:
types:
- opened
- synchronize
- reopened
- closed
paths:
- '.github/workflows/ci-post-commit-analyzer.yml'
- '.github/workflows/ci-post-commit-analyzer-run.py'
schedule:
- cron: '30 0 * * *'

concurrency:
group: >-
llvm-project-${{ github.workflow }}-${{ github.event_name == 'pull_request' &&
( github.event.pull_request.number || github.ref) }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
post-commit-analyzer:
if: >-
github.repository_owner == 'llvm' &&
github.event.action != 'closed'
runs-on: ubuntu-22.04
container:
image: 'ghcr.io/llvm/ci-ubuntu-22.04:latest'
env:
LLVM_VERSION: 18
steps:
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
# A full build of llvm, clang, lld, and lldb takes about 250MB
# of ccache space. There's not much reason to have more than this,
# because we usually won't need to save cache entries from older
# builds. Also, there is an overall 10GB cache limit, and each
# run creates a new cache entry so we want to ensure that we have
# enough cache space for all the tests to run at once and still
# fit under the 10 GB limit.
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
max-size: 2G
key: post-commit-analyzer
variant: sccache

- name: Configure
run: |
cmake -B build -S llvm -G Ninja \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLLVM_INCLUDE_TESTS=OFF \
-DCLANG_INCLUDE_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
# FIXME: We need to build all the generated header files in order to be able to run
# the analyzer on every file. Building libLLVM and libclang is probably overkill for
# this, but it's better than building every target.
ninja -v -C build libLLVM.so libclang.so
# Run the analyzer.
python3 .github/workflows/ci-post-commit-analyzer-run.py build/compile_commands.json
scan-build --generate-index-only build/analyzer-results
- name: Upload Results
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
if: always()
with:
name: analyzer-results
path: 'build/analyzer-results/*'

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN cmake -B ./build -G Ninja ./llvm \
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
-DCMAKE_INSTALL_PREFIX="$LLVM_SYSROOT" \
-DLLVM_ENABLE_PROJECTS="bolt;clang;lld;clang-tools-extra" \
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format" \
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format;scan-build" \
-DCLANG_DEFAULT_LINKER="lld" \
-DBOOTSTRAP_CLANG_PGO_TRAINING_DATA_SOURCE_DIR=/llvm-project-llvmorg-$LLVM_VERSION/llvm

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/libclang-python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.11"]
python-version: ["3.8", "3.11"]
uses: ./.github/workflows/llvm-project-tests.yml
with:
build_target: check-clang-python
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,16 @@ jobs:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
choco install -y ninja wget
choco install -y ninja
pip install psutil
- name: Install a current LLVM
if: ${{ matrix.mingw != true }}
run: |
choco install -y llvm --version=17.0.6
choco install -y llvm --version=18.1.6 --allow-downgrade
- name: Install llvm-mingw
if: ${{ matrix.mingw == true }}
run: |
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-x86_64.zip
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20240606/llvm-mingw-20240606-ucrt-x86_64.zip
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
del llvm-mingw*.zip
mv llvm-mingw* c:\llvm-mingw
Expand Down
Loading

0 comments on commit 29d99a9

Please sign in to comment.