Skip to content

Commit

Permalink
Merge commit 'c012e487b724' into bump_to_4bce2701
Browse files Browse the repository at this point in the history
  • Loading branch information
mgehre-amd committed Aug 29, 2024
2 parents 7090d09 + c012e48 commit 2f8092a
Show file tree
Hide file tree
Showing 4,645 changed files with 158,147 additions and 75,999 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 2 additions & 3 deletions .ci/generate-buildkite-pipeline-premerge
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,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 @@ -170,7 +169,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 @@ -213,7 +212,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
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
24 changes: 24 additions & 0 deletions .github/new-prs-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -717,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 @@ -749,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 @@ -760,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 @@ -770,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 @@ -817,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 @@ -836,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 @@ -860,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 @@ -880,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
4 changes: 3 additions & 1 deletion .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ jobs:
rm build.tar.zst
- name: Build Stage 2
# Re-enable once PGO builds are supported.
if: false
run: |
ninja -C /mnt/build stage2-instrumented
Expand Down Expand Up @@ -214,7 +216,7 @@ jobs:
- id: package-info
run: |
filename="LLVM-${{ needs.prepare.outputs.release-version }}-Linux.tar.gz"
filename="LLVM-${{ needs.prepare.outputs.release-version }}-Linux.tar.xz"
echo "filename=$filename" >> $GITHUB_OUTPUT
echo "path=/mnt/build/tools/clang/stage2-bins/$filename" >> $GITHUB_OUTPUT
Expand Down
41 changes: 35 additions & 6 deletions .github/workflows/restart-preempted-libcxx-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: "Restart Job"
permissions:
statuses: read
checks: read
checks: write
actions: write
runs-on: ubuntu-latest
steps:
Expand All @@ -35,11 +35,36 @@ jobs:
const failure_regex = /Process completed with exit code 1./
const preemption_regex = /The runner has received a shutdown signal/
const wf_run = context.payload.workflow_run
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
async function create_check_run(conclusion, message) {
// Create a check run on the given workflow run to indicate if
// we are restarting the workflow or not.
if (conclusion != 'success' && conclusion != 'skipped' && conclusion != 'neutral') {
core.setFailed('Invalid conclusion: ' + conclusion)
}
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Restart Preempted Job',
head_sha: wf_run.head_sha,
status: 'completed',
conclusion: conclusion,
output: {
title: 'Restarted Preempted Job',
summary: message
}
})
}
console.log('Listing check runs for suite')
const check_suites = await github.rest.checks.listForSuite({
owner: context.repo.owner,
repo: context.repo.repo,
check_suite_id: context.payload.workflow_run.check_suite_id
check_suite_id: context.payload.workflow_run.check_suite_id,
per_page: 100 // FIXME: We don't have 100 check runs yet, but we should handle this better.
})
check_run_ids = [];
Expand Down Expand Up @@ -83,23 +108,27 @@ jobs:
if (failure_match != null) {
// We only want to restart the workflow if all of the failures were due to preemption.
// We don't want to restart the workflow if there were other failures.
console.log('Choosing not to rerun workflow because we found a non-preemption failure');
console.log('Failure message: ' + annotation.message);
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
'Failure message: "' + annotation.message + '"');
await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
+ 'Failure message: ' + annotation.message)
return;
}
}
}
if (!has_preempted_job) {
console.log('No preempted jobs found. Not restarting workflow.');
core.notice('No preempted jobs found. Not restarting workflow.');
await create_check_run('neutral', 'No preempted jobs found. Not restarting workflow.')
return;
}
console.log("Restarted workflow: " + context.payload.workflow_run.id);
core.notice("Restarted workflow: " + context.payload.workflow_run.id);
await github.rest.actions.reRunWorkflowFailedJobs({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id
})
await create_check_run('success', 'Restarted workflow run due to preempted job')
Loading

0 comments on commit 2f8092a

Please sign in to comment.