Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sycl' into fix-buffer-shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
kbenzie committed Jan 15, 2025
2 parents be62615 + 48297df commit f0ab972
Show file tree
Hide file tree
Showing 1,656 changed files with 62,188 additions and 24,443 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-ci-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ jobs:

- name: Test Container
run: |
for image in ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name }}; do
podman run --rm -it $image /usr/bin/bash -x -c 'cd $HOME && printf '\''#include <iostream>\nint main(int argc, char **argv) { std::cout << "Hello\\n"; }'\'' | clang++ -x c++ - && ./a.out | grep Hello'
for image in ${{ steps.vars.outputs.container-name-tag }}; do
# Use --pull=never to ensure we are testing the just built image.
podman run --pull=never --rm -it $image /usr/bin/bash -x -c 'cd $HOME && printf '\''#include <iostream>\nint main(int argc, char **argv) { std::cout << "Hello\\n"; }'\'' | clang++ -x c++ - && ./a.out | grep Hello'
done
push-ci-container:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/new-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: llvm/actions/issue-labeler@main
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}
configuration-path: .github/new-issues-labeler.yml
include-title: 1
include-body: 0
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
shell: bash
run: |
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user ${{ github.actor }} --user-token "$USER_TOKEN" check-permissions
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user "$GITHUB_ACTOR" --user-token "$USER_TOKEN" check-permissions
- name: Collect Variables
id: vars
Expand All @@ -102,8 +102,8 @@ jobs:
release_version="$trimmed"
ref="llvmorg-$release_version"
else
release_version="${{ (github.event_name == 'pull_request' && format('PR{0}', github.event.pull_request.number)) || 'CI'}}-${{ github.sha }}"
ref=${{ github.sha }}
release_version="${{ (github.event_name == 'pull_request' && format('PR{0}', github.event.pull_request.number)) || 'CI'}}-$GITHUB_SHA"
ref="$GITHUB_SHA"
fi
if [ -n "${{ inputs.upload }}" ]; then
upload="${{ inputs.upload }}"
Expand All @@ -114,20 +114,20 @@ jobs:
echo "ref=$ref" >> $GITHUB_OUTPUT
echo "upload=$upload" >> $GITHUB_OUTPUT
release_binary_basename="LLVM-$release_version-${{ runner.os }}-${{ runner.arch }}"
release_binary_basename="LLVM-$release_version-$RUNNER_OS-$RUNNER_ARCH"
echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT
echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT
# Detect necessary CMake flags
target="${{ runner.os }}-${{ runner.arch }}"
target="$RUNNER_OS-$RUNNER_ARCH"
echo "enable-pgo=false" >> $GITHUB_OUTPUT
target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF"
# The macOS builds try to cross compile some libraries so we need to
# add extra CMake args to disable them.
# See https://github.com/llvm/llvm-project/issues/99767
if [ "${{ runner.os }}" = "macOS" ]; then
if [ "$RUNNER_OS" = "macOS" ]; then
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_COMPILER_RT_ENABLE_IOS=OFF"
if [ "${{ runner.arch }}" = "ARM64" ]; then
if [ "$RUNNER_ARCH" = "ARM64" ]; then
arches=arm64
else
arches=x86_64
Expand All @@ -137,7 +137,7 @@ jobs:
build_flang="true"
if [ "${{ runner.os }}" = "Windows" ]; then
if [ "$RUNNER_OS" = "Windows" ]; then
# The build times out on Windows, so we need to disable LTO.
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
fi
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ on:
description: 'Artifacts retention period'
type: string
default: 3
ref:
type: string
required: false

outputs:
build_conclusion:
Expand Down Expand Up @@ -146,7 +143,6 @@ jobs:
with:
sparse-checkout: |
devops/actions
ref: ${{ inputs.ref || github.sha }}
# Cleanup will be run after all actions are completed.
- name: Register cleanup after job is finished
uses: ./devops/actions/cleanup
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- '.github/workflows/sycl-windows-*.yml'
- '.github/workflows/sycl-macos-*.yml'
- '.github/workflows/sycl-nightly.yml'
- '.github/workflows/sycl-rel-nightly.yml'
- 'devops/containers/**'
- 'devops/actions/build_container/**'

Expand Down Expand Up @@ -157,13 +158,13 @@ jobs:
- name: E2E tests on Intel Ponte Vecchio GPU
runner: '["Linux", "pvc"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu;opencl:gpu
extra_lit_opts: -j 50
- name: E2E tests with dev igc on Intel Ponte Vecchio GPU
runner: '["Linux", "pvc"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu;opencl:gpu
use_igc_dev: true
extra_lit_opts: -j 50
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sycl-linux-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
merge_ref: ${{ inputs.merge_ref }}
cache_path: "/__w/repo_cache/"
- name: Checkout SYCL CTS tests
if: inputs.tests_selector == 'cts'
if: inputs.tests_selector == 'cts' && inputs.cts_testing_mode != 'run-only'
uses: ./devops/actions/cached_checkout
with:
path: khronos_sycl_cts
Expand All @@ -231,7 +231,7 @@ jobs:
default_branch: 'main'
cache_path: "/__w/repo_cache/"
- name: SYCL CTS GIT submodules init
if: inputs.tests_selector == 'cts'
if: inputs.tests_selector == 'cts' && inputs.cts_testing_mode != 'run-only'
run: |
git -C khronos_sycl_cts submodule update --init
- name: Install drivers
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,12 @@ jobs:
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
target_devices: opencl:cpu
tests_selector: cts

- name: SYCL-CTS on L0 gen12
runner: '["Linux", "gen12"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu
tests_selector: cts
uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
name: ${{ matrix.name }}
Expand All @@ -202,9 +200,8 @@ jobs:
image: ${{ matrix.image }}
image_options: ${{ matrix.image_options }}
target_devices: ${{ matrix.target_devices }}
tests_selector: ${{ matrix.tests_selector }}
tests_selector: cts
ref: ${{ github.sha }}
merge_ref: ''
sycl_toolchain_artifact: sycl_linux_default
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/sycl-rel-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ jobs:
secrets: inherit
with:
build_cache_root: "/__w/"
build_artifact_suffix: v6
build_artifact_suffix: default
build_configure_extra_args: '--hip --cuda'
build_image: ghcr.io/intel/llvm/ubuntu2204_build:latest
merge_ref: ''
ref: sycl-rel-6_0_0
build_ref: sycl-rel-6_0_0

# We upload the build for people to download/use, override its name and
# prefer widespread gzip compression.
Expand Down Expand Up @@ -118,10 +119,12 @@ jobs:
if: ${{ github.repository == 'intel/llvm' && needs.check_for_new_commits.outputs.is_new_commit != 'false' }}
uses: ./.github/workflows/sycl-windows-build.yml
with:
merge_ref: ''
build_ref: sycl-rel-6_0_0

# We upload both Linux/Windows build via Github's "Releases"
# functionality, make sure Linux/Windows names follow the same pattern.
artifact_archive_name: sycl_windows.tar.gz
build_ref: sycl-rel-6_0_0

e2e-win:
needs: build-win
Expand Down Expand Up @@ -154,7 +157,7 @@ jobs:
with:
name: CUDA E2E
runner: '["aws_cuda-${{ github.run_id }}-${{ github.run_attempt }}"]'
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
target_devices: cuda:gpu
ref: sycl-rel-6_0_0
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/sycl-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ on:
description: 'Filter matches for the changed files in the PR'
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
required: false
merge_ref:
description: |
Commit-ish to merge post-checkout if non-empty. Must be reachable from
the default_branch input paramter.
type: string
default: 'FETCH_HEAD'
artifact_archive_name:
type: string
default: llvm_sycl.tar.gz
Expand Down Expand Up @@ -100,6 +106,7 @@ jobs:
with:
path: src
ref: ${{ inputs.build_ref || github.sha }}
merge_ref: ${{ inputs.merge_ref }}
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
- name: Configure
shell: cmd
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sycl-windows-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- '.github/workflows/sycl-precommit-aws.yml'
- '.github/workflows/sycl-macos-*.yml'
- '.github/workflows/sycl-nightly.yml'
- '.github/workflows/sycl-rel-nightly.yml'
- 'devops/containers/**'
- 'devops/actions/build_container/**'

Expand Down
20 changes: 16 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Reporting LLVM Security Issues
# Security Policy

To report security issues in LLVM, please follow the steps outlined on the
[LLVM Security Group](https://llvm.org/docs/Security.html#how-to-report-a-security-issue)
page.
Intel is committed to rapidly addressing security vulnerabilities affecting our
customers and providing clear guidance on the solution, impact, severity and
mitigation.

## Reporting a Vulnerability

`intel/llvm` project is based upon the upstream
[`llvm/llvm-project`](https://github.com/llvm/llvm-project) and leverages lots
of functionality provided by it. If an issue you found concerns functionality
which is available in upstream, then it is more efficient to directly report it
there, see corresponding `SECURITY.md` for their policy.

If you are unsure, or if you know that the issue is specific to additions
developed in `intel/llvm`, then please report any security vulnerabilities
[utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
9 changes: 0 additions & 9 deletions bolt/docs/CommandLineArgumentReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -931,15 +931,6 @@

Remove redundant Address-Size override prefix

### BOLT options in relocation mode:

- `--align-macro-fusion=<value>`

Fix instruction alignment for macro-fusion (x86 relocation mode)
- `none`: do not insert alignment no-ops for macro-fusion
- `hot`: only insert alignment no-ops on hot execution paths (default)
- `all`: always align instructions to allow macro-fusion

### BOLT instrumentation options:

`llvm-bolt <executable> -instrument [-o outputfile] <instrumented-executable>`
Expand Down
5 changes: 5 additions & 0 deletions bolt/include/bolt/Core/BinaryData.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ class BinaryData {
return Parent && (Parent == BD || Parent->isAncestorOf(BD));
}

void updateSize(uint64_t N) {
if (N > Size)
Size = N;
}

void setIsMoveable(bool Flag) { IsMoveable = Flag; }
void setSection(BinarySection &NewSection);
void setOutputSection(BinarySection &NewSection) {
Expand Down
1 change: 1 addition & 0 deletions bolt/lib/Core/BinaryContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ MCSymbol *BinaryContext::registerNameAtAddress(StringRef Name, uint64_t Address,
BD = GAI->second;
if (!BD->hasName(Name)) {
GlobalSymbols[Name] = BD;
BD->updateSize(Size);
BD->Symbols.push_back(Symbol);
}
}
Expand Down
59 changes: 59 additions & 0 deletions bolt/lib/Rewrite/LinuxKernelRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorOr.h"
#include <regex>

#define DEBUG_TYPE "bolt-linux"

Expand Down Expand Up @@ -89,6 +91,34 @@ static cl::opt<bool>

} // namespace opts

/// Linux kernel version
struct LKVersion {
LKVersion() {}
LKVersion(unsigned Major, unsigned Minor, unsigned Rev)
: Major(Major), Minor(Minor), Rev(Rev) {}

bool operator<(const LKVersion &Other) const {
return std::make_tuple(Major, Minor, Rev) <
std::make_tuple(Other.Major, Other.Minor, Other.Rev);
}

bool operator>(const LKVersion &Other) const { return Other < *this; }

bool operator<=(const LKVersion &Other) const { return !(*this > Other); }

bool operator>=(const LKVersion &Other) const { return !(*this < Other); }

bool operator==(const LKVersion &Other) const {
return Major == Other.Major && Minor == Other.Minor && Rev == Other.Rev;
}

bool operator!=(const LKVersion &Other) const { return !(*this == Other); }

unsigned Major{0};
unsigned Minor{0};
unsigned Rev{0};
};

/// Linux Kernel supports stack unwinding using ORC (oops rewind capability).
/// ORC state at every IP can be described by the following data structure.
struct ORCState {
Expand Down Expand Up @@ -148,6 +178,8 @@ class AddressExtractor : public DataExtractor {
};

class LinuxKernelRewriter final : public MetadataRewriter {
LKVersion LinuxKernelVersion;

/// Information required for updating metadata referencing an instruction.
struct InstructionFixup {
BinarySection &Section; // Section referencing the instruction.
Expand Down Expand Up @@ -249,6 +281,8 @@ class LinuxKernelRewriter final : public MetadataRewriter {
ErrorOr<BinarySection &> PCIFixupSection = std::errc::bad_address;
static constexpr size_t PCI_FIXUP_ENTRY_SIZE = 16;

Error detectLinuxKernelVersion();

/// Process linux kernel special sections and their relocations.
void processLKSections();

Expand Down Expand Up @@ -314,6 +348,9 @@ class LinuxKernelRewriter final : public MetadataRewriter {
: MetadataRewriter("linux-kernel-rewriter", BC) {}

Error preCFGInitializer() override {
if (Error E = detectLinuxKernelVersion())
return E;

processLKSections();

if (Error E = processSMPLocks())
Expand Down Expand Up @@ -394,6 +431,28 @@ class LinuxKernelRewriter final : public MetadataRewriter {
}
};

Error LinuxKernelRewriter::detectLinuxKernelVersion() {
if (BinaryData *BD = BC.getBinaryDataByName("linux_banner")) {
const BinarySection &Section = BD->getSection();
const std::string S =
Section.getContents().substr(BD->getOffset(), BD->getSize()).str();

const std::regex Re(R"---(Linux version ((\d+)\.(\d+)(\.(\d+))?))---");
std::smatch Match;
if (std::regex_search(S, Match, Re)) {
const unsigned Major = std::stoi(Match[2].str());
const unsigned Minor = std::stoi(Match[3].str());
const unsigned Rev = Match[5].matched ? std::stoi(Match[5].str()) : 0;
LinuxKernelVersion = LKVersion(Major, Minor, Rev);
BC.outs() << "BOLT-INFO: Linux kernel version is " << Match[1].str()
<< "\n";
return Error::success();
}
}
return createStringError(errc::executable_format_error,
"Linux kernel version is unknown");
}

void LinuxKernelRewriter::processLKSections() {
processLKKSymtab();
processLKKSymtab(true);
Expand Down
Loading

0 comments on commit f0ab972

Please sign in to comment.