Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/sycl' into sycl_prof_tool
Browse files Browse the repository at this point in the history
* upstream/sycl: (2757 commits)
  [SYCL][Doc] Fixing incorrect merge of community Readme.md with our version (intel#5636)
  [SYCL] Change USM pooling parameters. (intel#5457)
  [CI] Fix cache location on Windows (intel#5603)
  [SYCL][NFC] Fix a warning about uninitialized struct members (intel#5610)
  [Buildbot] Update Windows GPU version to 101.1340 (intel#5620)
  Fix SPIRV -> OCL barrier call argument attributes
  Move SPV_INTEL_memory_access_aliasing tokens from spirv_internal
  [SYCL][ESIMD] Add support for named barrier APIs (intel#5583)
  [SYCL][L0] Remove ZeModule when program build failed (intel#5541)
  [SYCL] Silence "unknown attribute" warning for `device_indirectly_callable` (intel#5591)
  [SYCL][DOC] Introductory material for extensions (intel#5605)
  [SYCL][DOC] Change extension names to lower case (intel#5607)
  [SYCL] Improve get_kernel_bundle performance (intel#5496)
  [SYCL] Do not build device code for sub-devices (intel#5240)
  [sycl-post-link] Fix a crash during spec-constant properties generation (intel#5538)
  [SYCL][DOC] Move SPIR-V and OpenCL extensions (intel#5578)
  [SYCL][ESIMD][EMU] Update memory intrinsics for ESIMD_EMU plugin (intel#4748)
  [CI] Allow stale issue bot to analyze more issues (intel#5602)
  [SYCL][L0] Honor property::queue::enable_profiling (intel#5543)
  [OpenMP] Properly save strings when doing LTO
  ...
  • Loading branch information
alexbatashev committed Feb 23, 2022
2 parents ac51c0a + 890e71e commit 293d48b
Show file tree
Hide file tree
Showing 12,434 changed files with 374,685 additions and 212,856 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .clang-tidy
Expand Up @@ -6,6 +6,10 @@ CheckOptions:
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
# Exclude from scanning as this is an exported symbol used for fuzzing
# throughout the code base.
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: "LLVMFuzzerTestOneInput"
- key: readability-identifier-naming.MemberCase
value: CamelCase
- key: readability-identifier-naming.ParameterCase
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/closed-issues.yml
@@ -0,0 +1,13 @@
name: Labeling closed issues
on:
issues:
types: ['closed']

jobs:
automate-issues-labels:
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
steps:
- uses: andymckay/labeler@1.0.4
with:
remove-labels: "awaiting-review"
84 changes: 84 additions & 0 deletions .github/workflows/issue-release-workflow.yml
@@ -0,0 +1,84 @@
# This contains the workflow definitions that allow users to test backports
# to the release branch using comments on issues.
#
# /cherry-pick <commit> <...>
#
# This comment will attempt to cherry-pick the given commits to the latest
# release branch (release/Y.x) and if successful push the result to a branch
# on github.
#
# /branch <owner>/<repo>/<branch>
#
# This comment will create a pull request from <branch> to the latest release
# branch.

name: Issue Release Workflow

on:
issue_comment:
types:
- created
- edited

env:
COMMENT_BODY: ${{ github.event.comment.body }}

jobs:
backport-commits:
name: Backport Commits
runs-on: ubuntu-20.04
if: >-
(github.repository == 'llvm/llvm-project') &&
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
contains(github.event.comment.body, '/cherry-pick')
steps:
- name: Fetch LLVM sources
uses: actions/checkout@v2
with:
repository: llvm/llvm-project
# GitHub stores the token used for checkout and uses it for pushes
# too, but we want to use a different token for pushing, so we need
# to disable persist-credentials here.
persist-credentials: false
fetch-depth: 0

- name: Setup Environment
run: |
pip install -r ./llvm/utils/git/requirements.txt
./llvm/utils/git/github-automation.py --token ${{ github.token }} setup-llvmbot-git
- name: Backport Commits
run: |
printf "$COMMENT_BODY" |
./llvm/utils/git/github-automation.py \
--repo $GITHUB_REPOSITORY \
--token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
release-workflow \
--issue-number ${{ github.event.issue.number }} \
auto
create-pull-request:
name: Create Pull Request
runs-on: ubuntu-20.04
if: >-
(github.repository == 'llvm/llvm-project') &&
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
contains(github.event.comment.body, '/branch')
steps:
- name: Fetch LLVM sources
uses: actions/checkout@v2

- name: Setup Environment
run: |
pip install -r ./llvm/utils/git/requirements.txt
- name: Create Pull Request
run: |
printf "$COMMENT_BODY" |
./llvm/utils/git/github-automation.py \
--repo $GITHUB_REPOSITORY \
--token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
release-workflow \
--issue-number ${{ github.event.issue.number }} \
auto
3 changes: 2 additions & 1 deletion .github/workflows/issue-subscriber.yml
Expand Up @@ -13,8 +13,9 @@ jobs:
- name: Setup Automation Script
run: |
curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/github-automation.py
curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/requirements.txt
chmod a+x github-automation.py
pip install PyGithub
pip install -r requirements.txt
- name: Update watchers
run: |
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/sycl_containers.yaml
Expand Up @@ -107,6 +107,15 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Get dependencies configuration
id: deps
run: |
DEPS=`cat devops/dependencies.json`
DEPS="${DEPS//'%'/'%25'}"
DEPS="${DEPS//$'\n'/'%0A'}"
DEPS="${DEPS//$'\r'/'%0D'}"
echo $DEPS
echo "::set-output name=deps::$DEPS"
- name: Build and Push Container
uses: ./devops/actions/build_container
with:
Expand All @@ -117,4 +126,10 @@ jobs:
tags: |
ghcr.io/${{ github.repository }}/ubuntu2004_intel_drivers:unstable-${{ github.sha }}
ghcr.io/${{ github.repository }}/ubuntu2004_intel_drivers:unstable
build-args: |
compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.compute_runtime.github_tag}}
igc_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.igc.github_tag}}
tbb_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.tbb.github_tag}}
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.fpgaemu.github_tag}}
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.oclcpu.github_tag}}
17 changes: 9 additions & 8 deletions .github/workflows/sycl_linux_build_and_test.yml
Expand Up @@ -40,7 +40,7 @@ on:
build_configure_extra_args:
type: string
required: false
default: "--hip --hip-amd-arch=gfx906 --cuda"
default: "--hip --cuda"
build_artifact_suffix:
type: string
required: true
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
\"build_cache_root\":\"/__w/\",
\"build_cache_suffix\":\"default\",
\"build_cache_size\":\"2G\",
\"build_configure_extra_args\":\"--hip --hip-amd-arch=gfx906 --cuda\",
\"build_configure_extra_args\":\"--hip --cuda\",
\"build_artifact_suffix\":\"default\",
\"build_upload_artifact\":\"false\",
\"intel_drivers_image\":\"ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest\",
Expand Down Expand Up @@ -150,33 +150,34 @@ jobs:
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" \
--cmake-opt="-DSYCL_PI_TESTS=OFF"
- name: Compile
id: build
run: cmake --build $GITHUB_WORKSPACE/build
# TODO allow to optionally disable in-tree checks
- name: check-llvm
if: always()
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
run: |
cmake --build $GITHUB_WORKSPACE/build --target check-llvm
- name: check-clang
if: always()
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
run: |
export XDG_CACHE_HOME=$GITHUB_WORKSPACE/os_cache
cmake --build $GITHUB_WORKSPACE/build --target check-clang
- name: check-sycl
if: always()
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
run: |
# TODO consider moving this to Dockerfile
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
cmake --build $GITHUB_WORKSPACE/build --target check-sycl
- name: check-llvm-spirv
if: always()
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
run: |
cmake --build $GITHUB_WORKSPACE/build --target check-llvm-spirv
- name: check-xptifw
if: always()
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
run: |
cmake --build $GITHUB_WORKSPACE/build --target check-xptifw
- name: check-libclc
if: always()
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
run: |
cmake --build $GITHUB_WORKSPACE/build --target check-libclc
- name: Install
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/sycl_nightly.yml
Expand Up @@ -18,6 +18,13 @@ jobs:
build_github_cache: true
build_cache_root: "/__w/"
build_artifact_suffix: default
lts_config: "ocl_gen9;ocl_x64;hip_amdgpu"

windows_default:
name: Windows (experimental)
if: github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl_windows_build_and_test.yml

ubuntu2004_docker_build_push:
if: github.repository == 'intel/llvm'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,4 +61,14 @@ jobs:
tags: |
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers-${{ github.sha }}
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers
ubuntu2004_build_test_new_pm:
# Default Linux building and LIT testing using new Pass Manager by default
if: github.repository == 'intel/llvm'
uses: intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@sycl
with:
build_runs_on: build
build_cache_root: "/__w/"
build_cache_suffix: new_pm
build_artifact_suffix: new_pm
build_configure_extra_args: '--hip --cuda --cmake-opt=-DLLVM_ENABLE_NEW_PASS_MANAGER=ON'
lts_config: "hip_amdgpu;ocl_x64"
2 changes: 1 addition & 1 deletion .github/workflows/sycl_precommit.yml
Expand Up @@ -30,4 +30,4 @@ jobs:
build_cache_size: "8G"
build_artifact_suffix: "default"
build_cache_suffix: "default"
lts_config: "hip_amdgpu;ocl_x64"
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9"
21 changes: 21 additions & 0 deletions .github/workflows/sycl_stale_issues.yml
@@ -0,0 +1,21 @@
name: Stale Issues

on:
schedule:
- cron: '30 1 * * *'

jobs:
close-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days.'
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity. Please, re-open if the issue still exists.'
days-before-stale: 180
days-before-close: 30
exempt-issue-labels: 'confirmed,hip,cuda,enhancement,help wanted,upstream'
stale-issue-label: 'stale'
exempt-all-issue-assignees: true
operations-per-run: 200

65 changes: 65 additions & 0 deletions .github/workflows/sycl_windows_build_and_test.yml
@@ -0,0 +1,65 @@
name: SYCL Windows Test

on:
workflow_call:

jobs:
build:
name: Build
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
with:
path: src
fetch-depth: 1
- name: Install dependencies
shell: cmd
run: |
choco install -y cuda --version 11.6.0.51123
choco install -y ninja
choco install -y sccache --version 0.2.15
refreshenv
echo CUDA_PATH=%CUDA_PATH%
echo CUDA_PATH=%CUDA_PATH% >> %GITHUB_ENV%
- uses: ilammy/msvc-dev-cmd@9f8ae839b01883414208f29e3e24524387f48e1f
with:
arch: amd64
- name: Setup Cache
uses: actions/cache@v2
if: ${{ github.event_name != 'pull_request' }}
id: cache
with:
path: cache
key: sycl-win-build-${{ github.sha }}
restore-keys: |
sycl-win-build-
- name: Build
shell: cmd
env:
CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'
CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'
# TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83
# TODO enable sccache, when problems with PDB are resolved
run: |
mkdir build
mkdir install
IF NOT EXIST cache MKDIR cache
set SCCACHE_DIR=%GITHUB_WORKSPACE%\cache
set PATH=C:\ProgramData\chocolatey\lib\sccache\tools\sccache-v0.2.15-x86_64-pc-windows-msvc;%PATH%
python.exe src/buildbot/configure.py -o build ^
--cmake-opt="-DCMAKE_C_COMPILER=cl" ^
--cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
--cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^
--cuda
cmake --build build --target sycl-toolchain
sccache --show-stats
- name: Install
shell: cmd
run: cmake --build build --target deploy-sycl-toolchain
- name: Upload toolchain
uses: actions/upload-artifact@v2
with:
name: sycl_windows_default
path: install/**/*
5 changes: 2 additions & 3 deletions bolt/docs/Heatmaps.md
Expand Up @@ -23,11 +23,10 @@ $ perf record -e cycles:u -j any,u [-p PID|-a] -- sleep <interval>
Note that at the moment running with LBR (`-j any,u` or `-b`) is
a requirement.

Once the run is complete, and `perf.data` is generated, run BOLT in
a heatmap mode:
Once the run is complete, and `perf.data` is generated, run llvm-bolt-heatmap:

```bash
$ llvm-bolt heatmap -p perf.data <executable>
$ llvm-bolt-heatmap -p perf.data <executable>
```

By default the heatmap will be dumped to *stdout*. You can change it
Expand Down
5 changes: 3 additions & 2 deletions bolt/docs/OptimizingClang.md
Expand Up @@ -41,7 +41,7 @@ Collecting accurate profile requires running `perf` on a hardware that
implements taken branch sampling (`-b/-j` flag). For that reason, it may not be possible to
collect the accurate profile in a virtualized environment, e.g. in the cloud.
We do support regular sampling profiles, but the performance
improvements are expected to be more modest.
improvements are expected to be more modest.

```bash
$ mkdir ${TOPLEV}/stage3
Expand Down Expand Up @@ -211,7 +211,8 @@ $ cd ${TOPLEV}/stage1
$ cmake -G Ninja ${TOPLEV}/llvm-project/llvm -DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_ASM_COMPILER=gcc \
-DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
-DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_XRAY=OFF \
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
-DCMAKE_INSTALL_PREFIX=${TOPLEV}/stage1/install
Expand Down
12 changes: 11 additions & 1 deletion bolt/include/bolt/Core/BinaryBasicBlock.h
Expand Up @@ -31,6 +31,7 @@ class MCCodeEmitter;
namespace bolt {

class BinaryFunction;
class JumpTable;

class BinaryBasicBlock {
public:
Expand Down Expand Up @@ -623,6 +624,10 @@ class BinaryBasicBlock {
/// remove the conditional successor and branch instruction.
void removeDuplicateConditionalSuccessor(MCInst *CondBranch);

/// Update successors of the basic block based on the jump table instruction.
/// The block must end with a jump table instruction.
void updateJumpTableSuccessors();

/// Test if BB is a predecessor of this block.
bool isPredecessor(const BinaryBasicBlock *BB) const {
auto Itr = std::find(Predecessors.begin(), Predecessors.end(), BB);
Expand Down Expand Up @@ -909,7 +914,12 @@ class BinaryBasicBlock {
return Index;
}

bool hasJumpTable() const;
/// Return jump table if the block contains a jump table instruction or
/// nullptr otherwise.
const JumpTable *getJumpTable() const;

/// Check if the block has a jump table instruction.
bool hasJumpTable() const { return getJumpTable() != nullptr; }

private:
void adjustNumPseudos(const MCInst &Inst, int Sign);
Expand Down

0 comments on commit 293d48b

Please sign in to comment.