Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions external/llvm-project/.ci/compute_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
DEPENDENT_RUNTIMES_TO_TEST = {
"clang": {"compiler-rt"},
"clang-tools-extra": {"libc"},
"libc": {"libc"},
".ci": {"compiler-rt", "libc"},
}
DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {
Expand Down
12 changes: 11 additions & 1 deletion external/llvm-project/.ci/compute_projects_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_top_level_file(self):
self.assertEqual(env_variables["runtimes_check_targets"], "")
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")

def test_exclude_runtiems_in_projects(self):
def test_exclude_libcxx_in_projects(self):
env_variables = compute_projects.get_env_variables(
["libcxx/CMakeLists.txt"], "Linux"
)
Expand All @@ -197,6 +197,16 @@ def test_exclude_runtiems_in_projects(self):
self.assertEqual(env_variables["runtimes_check_targets"], "")
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")

def test_include_libc_in_runtimes(self):
env_variables = compute_projects.get_env_variables(
["libc/CMakeLists.txt"], "Linux"
)
self.assertEqual(env_variables["projects_to_build"], "clang;lld")
self.assertEqual(env_variables["project_check_targets"], "")
self.assertEqual(env_variables["runtimes_to_build"], "libc")
self.assertEqual(env_variables["runtimes_check_targets"], "check-libc")
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")

def test_exclude_docs(self):
env_variables = compute_projects.get_env_variables(
["llvm/docs/CIBestPractices.rst"], "Linux"
Expand Down
25 changes: 18 additions & 7 deletions external/llvm-project/.ci/monolithic-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ runtime_targets_needs_reconfig="${5}"

lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"

echo "--- cmake"
echo "::group::cmake"
export PIP_BREAK_SYSTEM_PACKAGES=1
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt

Expand Down Expand Up @@ -85,38 +85,49 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"

echo "--- ninja"
echo "::endgroup::"
echo "::group::ninja"

# Targets are not escaped as they are passed as separate arguments.
ninja -C "${BUILD_DIR}" -k 0 ${targets}

echo "::endgroup::"

if [[ "${runtime_targets}" != "" ]]; then
echo "--- ninja runtimes"
echo "::group::ninja runtimes"

ninja -C "${BUILD_DIR}" ${runtime_targets}

echo "::endgroup::"
fi

# Compiling runtimes with just-built Clang and running their tests
# as an additional testing for Clang.
if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
echo "--- cmake runtimes C++26"
echo "::group::cmake runtimes C++26"

cmake \
-D LIBCXX_TEST_PARAMS="std=c++26" \
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
"${BUILD_DIR}"

echo "--- ninja runtimes C++26"
echo "::endgroup::"
echo "::group::ninja runtimes C++26"

ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}

echo "--- cmake runtimes clang modules"
echo "::endgroup::"
echo "::group::cmake runtimes clang modules"

cmake \
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
"${BUILD_DIR}"

echo "--- ninja runtimes clang modules"
echo "::endgroup::"
echo "::group::ninja runtimes clang modules"

ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}

echo "::endgroup::"
fi
8 changes: 6 additions & 2 deletions external/llvm-project/.ci/monolithic-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ trap at-exit EXIT
projects="${1}"
targets="${2}"

echo "--- cmake"
echo "::group::cmake"
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt

export CC=cl
Expand Down Expand Up @@ -78,6 +78,10 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_PARALLEL_COMPILE_JOBS=${MAX_PARALLEL_COMPILE_JOBS} \
-D LLVM_PARALLEL_LINK_JOBS=${MAX_PARALLEL_LINK_JOBS}

echo "--- ninja"
echo "::endgroup::"
echo "::group::ninja"

# Targets are not escaped as they are passed as separate arguments.
ninja -C "${BUILD_DIR}" -k 0 ${targets}

echo "::endgroup"
4 changes: 4 additions & 0 deletions external/llvm-project/.github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
When performing a code review, pay close attention to code modifying a function's
control flow. Could the change result in the corruption of performance profile
data? Could the change result in invalid debug information, in particular for
branches and calls?
4 changes: 4 additions & 0 deletions external/llvm-project/.github/new-prs-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ llvm:instcombine:
- llvm/test/Transforms/InstCombine/**
- llvm/test/Transforms/InstSimplify/**

llvm:vectorcombine:
- llvm/lib/Transforms/Vectorize/VectorCombine.cpp
- llvm/test/Transforms/VectorCombine/**

clangd:
- clang-tools-extra/clangd/**

Expand Down
4 changes: 2 additions & 2 deletions external/llvm-project/.github/workflows/hlsl-test-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
- name: Checkout OffloadTest
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: llvm-beanz/offload-test-suite
repository: llvm/offload-test-suite
ref: main
path: OffloadTest
- name: Checkout Golden Images
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: llvm-beanz/offload-golden-images
repository: llvm/offload-golden-images
ref: main
path: golden-images
- name: Setup Windows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ permissions:

jobs:
restart:
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled')
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure')
name: "Restart Job"
permissions:
statuses: read
Expand All @@ -32,7 +32,10 @@ jobs:
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
const failure_regex = /Process completed with exit code 1./
// The "The run was canceled by" message comes from a user manually canceling a workflow
// the "higher priority" message comes from github canceling a workflow because the user updated the change.
// And the "exit code 1" message indicates a genuine failure.
const failure_regex = /(Process completed with exit code 1.)/
const preemption_regex = /(The runner has received a shutdown signal)|(The operation was canceled)/

const wf_run = context.payload.workflow_run
Expand Down Expand Up @@ -74,7 +77,7 @@ jobs:
console.log('Check run was not completed. Skipping.');
continue;
}
if (check_run.conclusion != 'failure' && check_run.conclusion != 'cancelled') {
if (check_run.conclusion != 'failure') {
console.log('Check run had conclusion: ' + check_run.conclusion + '. Skipping.');
continue;
}
Expand Down Expand Up @@ -153,91 +156,3 @@ jobs:
run_id: context.payload.workflow_run.id
})
await create_check_run('success', 'Restarted workflow run due to preempted job')

restart-test:
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled') && github.event.actor.login == 'ldionne' # TESTING ONLY
name: "Restart Job (test)"
permissions:
statuses: read
checks: write
actions: write
runs-on: ubuntu-24.04
steps:
- name: "Restart Job (test)"
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
const FAILURE_REGEX = /Process completed with exit code 1./
const PREEMPTION_REGEX = /(The runner has received a shutdown signal)|(The operation was canceled)/

function log(msg) {
core.notice(msg)
}

const wf_run = context.payload.workflow_run
log(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)

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,
per_page: 100 // FIXME: We don't have 100 check runs yet, but we should handle this better.
})

preemptions = [];
legitimate_failures = [];
for (check_run of check_suites.data.check_runs) {
log(`Checking check run: ${check_run.id}`);
if (check_run.status != 'completed') {
log('Check run was not completed. Skipping.');
continue;
}

if (check_run.conclusion != 'failure' && check_run.conclusion != 'cancelled') {
log(`Check run had conclusion: ${check_run.conclusion}. Skipping.`);
continue;
}

annotations = await github.rest.checks.listAnnotations({
owner: context.repo.owner,
repo: context.repo.repo,
check_run_id: check_run.id
})

preemption_annotation = annotations.data.find(function(annotation) {
return annotation.annotation_level == 'failure' &&
annotation.message.match(PREEMPTION_REGEX) != null;
});
if (preemption_annotation != null) {
log(`Found preemption message: ${preemption_annotation.message}`);
preemptions.push(check_run);
break;
}

failure_annotation = annotations.data.find(function(annotation) {
return annotation.annotation_level == 'failure' &&
annotation.message.match(FAILURE_REGEX) != null;
});
if (failure_annotation != null) {
log(`Found legitimate failure annotation: ${failure_annotation.message}`);
legitimate_failures.push(check_run);
break;
}
}

if (preemptions) {
log('Found some preempted jobs');
if (legitimate_failures) {
log('Also found some legitimate failures, so not restarting the workflow.');
} else {
log('Did not find any legitimate failures. Restarting workflow.');
await github.rest.actions.reRunWorkflowFailedJobs({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id
})
}
} else {
log('Did not find any preempted jobs. Not restarting the workflow.');
}
6 changes: 0 additions & 6 deletions external/llvm-project/amd/comgr/include/amd_comgr.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -1563,9 +1563,6 @@ amd_comgr_action_info_get_working_directory_path(
*
* @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p
* action_info is an invalid action info object.
*
* @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES
* Unable to update action info object as out of resources.
*/
amd_comgr_status_t AMD_COMGR_API
amd_comgr_action_info_set_logging(
Expand All @@ -1584,9 +1581,6 @@ amd_comgr_action_info_set_logging(
*
* @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p
* action_info is an invalid action info object. @p logging is NULL.
*
* @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES
* Unable to update the data object as out of resources.
*/
amd_comgr_status_t AMD_COMGR_API
amd_comgr_action_info_get_logging(
Expand Down
23 changes: 10 additions & 13 deletions external/llvm-project/amd/comgr/src/comgr-compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,16 @@ amd_comgr_status_t AMDGPUCompiler::createTmpDirs() {
return AMD_COMGR_STATUS_SUCCESS;
}

amd_comgr_status_t AMDGPUCompiler::removeTmpDirs() {
if (TmpDir.empty()) {
return AMD_COMGR_STATUS_SUCCESS;
}
ProfilePoint Point("RemoveDir");

#ifdef _WIN32
// On windows fs::remove_directories takes huge time so use fs::remove.
amd_comgr_status_t removeDirectory(const StringRef DirName) {
std::error_code EC;
for (fs::directory_iterator Dir(DirName, EC), DirEnd; Dir != DirEnd && !EC;
for (fs::directory_iterator Dir(TmpDir, EC), DirEnd; Dir != DirEnd && !EC;
Dir.increment(EC)) {
const StringRef Path = Dir->path();

Expand Down Expand Up @@ -843,25 +849,16 @@ amd_comgr_status_t removeDirectory(const StringRef DirName) {
}
}

if (fs::remove(DirName)) {
if (fs::remove(TmpDir)) {
return AMD_COMGR_STATUS_ERROR;
}

return AMD_COMGR_STATUS_SUCCESS;
}

amd_comgr_status_t AMDGPUCompiler::removeTmpDirs() {
if (TmpDir.empty()) {
return AMD_COMGR_STATUS_SUCCESS;
}
ProfilePoint Point("RemoveDir");
#ifndef _WIN32
#else
if (fs::remove_directories(TmpDir)) {
return AMD_COMGR_STATUS_ERROR;
}
return AMD_COMGR_STATUS_SUCCESS;
#else
return removeDirectory(TmpDir);
#endif
}

Expand Down
5 changes: 4 additions & 1 deletion external/llvm-project/amd/comgr/test-lit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_comgr_lit_binary(source-to-bc-with-dev-libs c)
add_comgr_lit_binary(spirv-translator c)
add_comgr_lit_binary(compile-minimal-test c)
add_comgr_lit_binary(compile-opencl-minimal c)
add_comgr_lit_binary(spirv-to-reloc c)
add_comgr_lit_binary(unbundle c)
add_comgr_lit_binary(get-version c)
add_comgr_lit_binary(status-string c)
add_comgr_lit_binary(data-action c)

add_dependencies(check-comgr test-lit)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// RUN: AMD_COMGR_CACHE_DIR=%t.txt \
// RUN: AMD_COMGR_EMIT_VERBOSE_LOGS=1 \
// RUN: AMD_COMGR_REDIRECT_LOGS=%t.log \
// RUN: compile-minimal-test %S/../compile-minimal-test.cl %t.bin
// RUN: compile-opencl-minimal %S/../compile-minimal-test.cl %t.bin 1.2
// RUN: llvm-objdump -d %t.bin | FileCheck %S/../compile-minimal-test.cl
// RUN: FileCheck --check-prefix=BAD %s < %t.log
// BAD: Failed to open cache file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// RUN: AMD_COMGR_CACHE_POLICY="foo=2h" \
// RUN: AMD_COMGR_EMIT_VERBOSE_LOGS=1 \
// RUN: AMD_COMGR_REDIRECT_LOGS=%t.log \
// RUN: compile-minimal-test %S/../compile-minimal-test.cl %t.bin
// RUN: compile-opencl-minimal %S/../compile-minimal-test.cl %t.bin 1.2
// RUN: llvm-objdump -d %t.bin | FileCheck %S/../compile-minimal-test.cl
// RUN: FileCheck --check-prefix=BAD %s < %t.log
// BAD: when parsing the cache policy: Unknown key: 'foo'
Expand Down
Loading