Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] [NATIVECPU] Integrate OneAPI Construction Kit vectorizer #12659

Merged
merged 59 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a623d24
Support barriers on Native CPU
PietroGhg Oct 20, 2023
aed012f
formatting
PietroGhg Oct 20, 2023
798e2d1
formatting
PietroGhg Oct 20, 2023
4233cf8
Remove def for fixUpKernelNameAfterBarrier
PietroGhg Oct 20, 2023
5d76bd6
Licence header
PietroGhg Oct 23, 2023
509447c
Update lit test
PietroGhg Oct 23, 2023
9586b39
formatting
PietroGhg Oct 23, 2023
c297e24
formatting
PietroGhg Oct 23, 2023
de9506d
Merge branch 'sycl' into pietro/barriers
PietroGhg Oct 25, 2023
5a62505
formatting
PietroGhg Oct 25, 2023
0b140ef
[wip] vecz integration
PietroGhg Oct 31, 2023
c5697e7
Better defaults
PietroGhg Oct 31, 2023
af3abd1
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 1, 2023
986e37a
Consistent naming for cmake var
PietroGhg Nov 1, 2023
5188f8c
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 2, 2023
85bcbc6
Merge branch 'pietro/barriers' into pietro/vecz
PietroGhg Nov 6, 2023
f07433f
Enable vectorization by default
PietroGhg Nov 7, 2023
9f4a6b9
formatting
PietroGhg Nov 7, 2023
277f6a9
Merge branch 'sycl' into pietro/vecz
PietroGhg Nov 8, 2023
f2b634e
Remove debug print
PietroGhg Nov 8, 2023
b744997
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 9, 2023
6529479
Test updated OCK branch
PietroGhg Nov 9, 2023
9023de6
Restore real ock tag
PietroGhg Nov 9, 2023
06634f3
Merge branch 'pietro/barriers' of github.com:PietroGhg/llvm into piet…
PietroGhg Nov 9, 2023
8e3b25d
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 15, 2023
989da9c
Merge branch 'pietro/barriers' into pietro/vecz
PietroGhg Nov 15, 2023
8fc2392
Move utily functions to UtilsSYCLNativeCPU.h
PietroGhg Nov 16, 2023
11de7b3
Consistent naming in docs
PietroGhg Nov 16, 2023
376556d
change fixCallingConv name
PietroGhg Nov 17, 2023
93690b6
Check after dyn_cast
PietroGhg Nov 17, 2023
ab3e154
remove libclc-relatd cmake from native cpu cmake
PietroGhg Nov 17, 2023
ef1e920
Put back O2 in lit test
PietroGhg Nov 17, 2023
e8d7e3b
Update docs
PietroGhg Nov 17, 2023
e638b88
check after dyn cast
PietroGhg Nov 17, 2023
49ed3e7
Use llvm::cast where appropriate
PietroGhg Nov 20, 2023
8f6eab3
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 20, 2023
27f5177
Merge branch 'sycl' into pietro/barriers
PietroGhg Nov 28, 2023
27936cd
typo
PietroGhg Nov 28, 2023
36189e2
Merge branch 'pietro/barriers' into pietro/vecz
PietroGhg Nov 28, 2023
91c9b77
use llvm option for disabling vecz
PietroGhg Dec 1, 2023
a67fa2b
Merge branch 'sycl' into pietro/vecz
PietroGhg Dec 6, 2023
26bff15
Merge branch 'sycl' into pietro/vecz
PietroGhg Jan 31, 2024
b1f3fcd
Update OCK tag
PietroGhg Jan 31, 2024
db4612e
Formatting
PietroGhg Jan 31, 2024
69c83b6
Change vecz width option name and location
PietroGhg Feb 2, 2024
4abfb0e
Update docs
PietroGhg Feb 2, 2024
9ae8a21
Update docs
PietroGhg Feb 2, 2024
05ae105
New line in docs
PietroGhg Feb 2, 2024
432681e
Link to section
PietroGhg Feb 2, 2024
fc6e1d3
Link to section
PietroGhg Feb 2, 2024
50ea60c
Merge branch 'sycl' into pietro/vecz
PietroGhg Feb 5, 2024
94d849c
Update lit tests
PietroGhg Feb 5, 2024
263d58f
Use llvm::OptimiaztionLevel
PietroGhg Feb 6, 2024
cf584d2
Updated vector add test
PietroGhg Feb 6, 2024
17b541f
Merge branch 'sycl' into pietro/vecz
PietroGhg Feb 7, 2024
9ad5e36
Update docs
PietroGhg Feb 7, 2024
7349939
Formatting
PietroGhg Feb 8, 2024
5957645
Mark vectorization test are require native_cpu_be
PietroGhg Feb 8, 2024
655afa6
Remove unnecessary include
PietroGhg Feb 9, 2024
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.
17 changes: 8 additions & 9 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ sycl/doc/design/ @intel/llvm-reviewers-runtime
sycl/doc/design/spirv-extensions/ @intel/dpcpp-spirv-doc-reviewers
sycl/doc/extensions/ @intel/dpcpp-specification-reviewers

# Level Zero plugin
sycl/plugins/level_zero/ @intel/dpcpp-l0-pi-reviewers
sycl/test-e2e/Plugin/*level-zero* @intel/dpcpp-l0-pi-reviewers

# Unified Runtime plugin
sycl/plugins/unified_runtime/ @intel/dpcpp-l0-pi-reviewers

# ESIMD CPU emulator plug-in
sycl/plugins/esimd_emulator/ @intel/dpcpp-esimd-reviewers
# Unified Runtime
sycl/plugins @intel/unified-runtime-reviewers
sycl/test-e2e/Plugin/ @intel/unified-runtime-reviewers

# Win Proxy Loader
sycl/pi_win_proxy_loader @intel/llvm-reviewers-runtime
sycl/plugins/common_win_pi_trace @intel/llvm-reviewers-runtime
sycl/test-e2e/Plugin/dll-detach-order.cpp @intel/llvm-reviewers-runtime

# CUDA and HIP plugins
sycl/plugins/**/cuda/ @intel/llvm-reviewers-cuda
Expand Down
91 changes: 78 additions & 13 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,60 @@ on:
paths:
- 'llvm/docs/**'
- 'clang/docs/**'
- 'clang-tools-extra/docs/**'
- 'lldb/docs/**'
- 'libunwind/docs/**'
- 'libcxx/docs/**'
- 'libc/docs/**'
- 'lld/docs/**'
pull_request:
paths:
- 'llvm/docs/**'
- 'clang/docs/**'
- 'clang-tools-extra/docs/**'
- 'lldb/docs/**'
- 'libunwind/docs/**'
- 'libcxx/docs/**'
- 'libc/docs/**'
- 'lld/docs/**'

jobs:
check-docs-build:
name: "Test documentation build"
runs-on: ubuntu-latest
steps:
- name: Fetch LLVM sources
# Don't fetch before checking for file changes to force the file changes
# action to use the Github API in pull requests. If it's a push to a
# branch we can't use the Github API to get the diff, so we need to have
# a local checkout beforehand.
- name: Fetch LLVM sources (Push)
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get subprojects that have doc changes
id: docs-changed-subprojects
uses: tj-actions/changed-files@v39
with:
files_yaml: |
llvm:
- 'llvm/docs/**'
clang:
- 'clang/docs/**'
clang-tools-extra:
- 'clang-tools-extra/docs/**'
lldb:
- 'lldb/docs/**'
libunwind:
- 'libunwind/docs/**'
libcxx:
- 'libcxx/docs/**'
libc:
- 'libc/docs/**'
lld:
- 'lld/docs/**'
- name: Fetch LLVM sources (PR)
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
with:
fetch-depth: 1
Expand All @@ -40,24 +83,46 @@ jobs:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
- name: Get subprojects that have doc changes
id: docs-changed-subprojects
uses: tj-actions/changed-files@v39
with:
files_yaml: |
llvm:
- 'llvm/docs/**'
clang:
- 'clang/docs/**'
# swig and graphviz are lldb specific dependencies
sudo apt-get install -y cmake ninja-build swig graphviz
- name: Build LLVM docs
if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
run: |
cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_HTML=ON -DSPHINX_OUTPUT_MAN=ON ./llvm
cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C llvm-build docs-llvm-html docs-llvm-man
- name: Build Clang docs
if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
run: |
cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_HTML=ON -DSPHINX_OUTPUT_MAN=ON ./llvm
cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C clang-build docs-clang-html docs-clang-man
- name: Build clang-tools-extra docs
if: steps.docs-changed-subprojects.outputs.clang-tools-extra_any_changed == 'true'
run: |
cmake -B clang-tools-extra-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C clang-tools-extra-build docs-clang-tools-html docs-clang-tools-man
- name: Build LLDB docs
if: steps.docs-changed-subprojects.outputs.lldb_any_changed == 'true'
run: |
cmake -B lldb-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C lldb-build docs-lldb-html docs-lldb-man
- name: Build libunwind docs
if: steps.docs-changed-subprojects.outputs.libunwind_any_changed == 'true'
run: |
cmake -B libunwind-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libunwind-build docs-libunwind-html
- name: Build libcxx docs
if: steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true'
run: |
cmake -B libcxx-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libcxx-build docs-libcxx-html
- name: Build libc docs
if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
run: |
cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libc-build docs-libc-html
- name: Build LLD docs
if: steps.docs-changed-subprojects.outputs.lld_any_changed == 'true'
run: |
cmake -B lld-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C lld-build docs-lld-html

2 changes: 1 addition & 1 deletion .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install deps
run: |
sudo apt-get install -y doxygen graphviz ssh ninja-build
sudo pip3 install 'sphinx==4.2.0' 'myst-parser==0.15.1' 'recommonmark==0.7.1'
sudo pip3 install -r repo/llvm/docs/requirements.txt
- name: Build Docs
run: |
mkdir -p $GITHUB_WORKSPACE/build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/libcxx-check-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
paths:
- 'libcxx/**'

permissions:
contents: read

jobs:
check_generated_files:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
./llvm/utils/release/github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} upload --files ./*doxygen*.tar.xz

- name: Create Release Notes Artifact
uses: actions/download-artifact@v3
uses: actions/upload-artifact@v3
with:
name: release-notes
path: docs-build/html-export/
Expand Down
50 changes: 35 additions & 15 deletions bolt/include/bolt/Core/AddressMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
//
//===----------------------------------------------------------------------===//
//
// Helper class to create a mapping from input to output addresses needed for
// updating debugging symbols and BAT. We emit an MCSection containing
// <Input address, Output MCSymbol> pairs to the object file and JITLink will
// transform this in <Input address, Output address> pairs. The linker output
// can then be parsed and used to establish the mapping.
// This file contains the declaration of the AddressMap class used for looking
// up addresses in the output object.
//
//===----------------------------------------------------------------------===//
//

#ifndef BOLT_CORE_ADDRESS_MAP_H
#define BOLT_CORE_ADDRESS_MAP_H

#include "llvm/ADT/StringRef.h"
#include "llvm/MC/MCSymbol.h"

#include <optional>
#include <unordered_map>
Expand All @@ -30,26 +28,48 @@ namespace bolt {

class BinaryContext;

/// Helper class to create a mapping from input entities to output addresses
/// needed for updating debugging symbols and BAT. We emit a section containing
/// <Input entity, Output MCSymbol> pairs to the object file and JITLink will
/// transform this in <Input entity, Output address> pairs. The linker output
/// can then be parsed and used to establish the mapping.
///
/// The entities that can be mapped to output address are input addresses and
/// labels (MCSymbol). Input addresses support one-to-many mapping.
class AddressMap {
using MapTy = std::unordered_multimap<uint64_t, uint64_t>;
MapTy Map;
static const char *const AddressSectionName;
static const char *const LabelSectionName;

public:
static const char *const SectionName;
/// Map multiple <input address> to <output address>.
using Addr2AddrMapTy = std::unordered_multimap<uint64_t, uint64_t>;
Addr2AddrMapTy Address2AddressMap;

/// Map MCSymbol to its output address. Normally used for temp symbols that
/// are not updated by the linker.
using Label2AddrMapTy = DenseMap<const MCSymbol *, uint64_t>;
Label2AddrMapTy Label2AddrMap;

public:
static void emit(MCStreamer &Streamer, BinaryContext &BC);
static AddressMap parse(StringRef Buffer, const BinaryContext &BC);
static std::optional<AddressMap> parse(BinaryContext &BC);

std::optional<uint64_t> lookup(uint64_t InputAddress) const {
auto It = Map.find(InputAddress);
if (It != Map.end())
auto It = Address2AddressMap.find(InputAddress);
if (It != Address2AddressMap.end())
return It->second;
return std::nullopt;
}

std::optional<uint64_t> lookup(const MCSymbol *Symbol) const {
auto It = Label2AddrMap.find(Symbol);
if (It != Label2AddrMap.end())
return It->second;
return std::nullopt;
}

std::pair<MapTy::const_iterator, MapTy::const_iterator>
std::pair<Addr2AddrMapTy::const_iterator, Addr2AddrMapTy::const_iterator>
lookupAll(uint64_t InputAddress) const {
return Map.equal_range(InputAddress);
return Address2AddressMap.equal_range(InputAddress);
}
};

Expand Down
9 changes: 1 addition & 8 deletions bolt/include/bolt/Core/BinaryFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -1721,14 +1721,7 @@ class BinaryFunction {
// Align data in code BFs minimum to CI alignment
if (!size() && hasIslandsInfo())
return getConstantIslandAlignment();

// Minimal code alignment on AArch64 and RISCV is 4
if (BC.isAArch64() || BC.isRISCV())
return 4;

// We have to use at least 2-byte alignment for functions because
// of C++ ABI.
return 2;
return BC.MIB->getMinFunctionAlignment();
}

Align getMinAlign() const { return Align(getMinAlignment()); }
Expand Down
6 changes: 6 additions & 0 deletions bolt/include/bolt/Core/MCPlusBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,12 @@ class MCPlusBuilder {
return BlocksVectorTy();
}

virtual uint16_t getMinFunctionAlignment() const {
// We have to use at least 2-byte alignment for functions because of C++
// ABI.
return 2;
}

// AliasMap caches a mapping of registers to the set of registers that
// alias (are sub or superregs of itself, including itself).
std::vector<BitVector> AliasMap;
Expand Down
Loading