Skip to content

Commit 63e8747

Browse files
author
Colin Davidson
committed
Updates since review comments.
1 parent 36dd3ba commit 63e8747

6 files changed

Lines changed: 73 additions & 59 deletions

scripts/PR_text.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Bring Native CPU pipeline files into dpc++ directly.
2+
3+
This brings the Native CPU compiler pipeline files directly under the ownership
4+
of intel/llvm. This removes the direct dependence on the oneAPI Construction
5+
Kit, although the history of those files still exists under intel/llvm and the
6+
originals still exist at
7+
https://github.com/uxlfoundation/oneapi-construction-kit.
8+
9+
This was done as follows:
10+
11+
In the oneAPI Construction Kit repo:
12+
13+
```
14+
git-filter-repo --paths-from-file $script_dir/native_cpu_paths.txt \
15+
--path-rename modules/compiler/compiler_pipeline:llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline \
16+
--path-rename modules/compiler/vecz:llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz \
17+
--path-rename modules/compiler/multi_llvm/include/multi_llvm:llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/include/multi_llvm \
18+
--path-rename doc/modules/vecz/vecz.md:llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/vecz.md \
19+
--path-rename doc/modules/compiler/overview.rst:llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/docs/overview.rst \
20+
--path-rename doc/modules/compiler/utils.rst:llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/docs/utils.rst
21+
```
22+
See https://github.com/uxlfoundation/oneapi-construction-kit/pull/969 for more info.
23+
24+
Under intel/llvm:
25+
26+
```
27+
git checkout sycl
28+
git checkout -b $llvm_branch
29+
git fetch $ock_fork $ock_branch
30+
# Update CMake to be more llvm like
31+
# clang-format-20 on added files
32+
# Add some new documentation to reflect the state of play.
33+
git merge -m "[NATIVE_CPU][SYCL] Merge from oneAPI Construction Kit into native_cpu" --allow-unrelated-histories ock_fork/$ock_branch
34+
```
35+
36+
37+
`llvm/lib/SYCLNativeCPUUtils/CMakeLists.txt` was updated to remove the fetch
38+
content and the ugly install workaround. Missing is the lit tests for the
39+
pipeline tests as these refer to the use of a non-ported tool, `muxc`.
40+
CMakeLists.txt across was updated to use LLVM macros across `compiler_pipeline`
41+
and `vecz` ported code, as well as changing `NATIVECPU_USE_OCK` to be the
42+
default. It also applies clang-format-20 to all the .h and .cpp files brought
43+
in. Other than that the .cpp and .h files are unchanged. The lit tests cfg files
44+
were updated to fit with LLVM, and a small change was made to avoid use of
45+
`undef`.
46+
47+
A brief explanation and limitations of the importing of the files are under
48+
`llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_passes.rst`.

scripts/commit.txt

Lines changed: 0 additions & 33 deletions
This file was deleted.

scripts/create_native_cpu.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if [ "$ock_branch" != "" ]; then
4141
git fetch ock_fork $ock_branch
4242
git merge -m "[NATIVE_CPU][SYCL] Merge from oneAPI Construction Kit into native_cpu" --allow-unrelated-histories ock_fork/$ock_branch
4343
cp $script_dir/native_cpu_CMakeLists.txt $llvm_repo/llvm/lib/SYCLNativeCPUUtils/CMakeLists.txt
44-
sed -i "s/DNATIVECPU_USE_OCK=Off/DNATIVECPU_USE_OCK=ON/" $llvm_repo/.github/workflows/sycl-linux-build.yml
44+
sed -i -e 's/DLLVM_INSTALL_UTILS=ON \\/DLLVM_INSTALL_UTILS=ON/' -e "/DNATIVECPU_USE_OCK=Off/d" $llvm_repo/.github/workflows/sycl-linux-build.yml
4545
sed -i -e "s/config.name = 'Vecz'/config.name = \"Vecz\"/" -e "s/config.suffixes = \['.hlsl', '.ll'\]/config.suffixes = \[\".hlsl\", \".ll\"\]/" $llvm_repo/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/lit.cfg.py
4646
for f in $( find $llvm_repo/llvm/lib/SYCLNativeCPUUtils/compiler_passes -name '*.h' -o -name '*.cpp' -o -name '*.inc'); do
4747
clang-format $f > /tmp/format.txt; cp /tmp/format.txt $f
@@ -57,8 +57,6 @@ if [ "$ock_branch" != "" ]; then
5757
cp $script_dir/native_cpu_vecz_test_lit_lit.cfg.py llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/lit.cfg.py
5858
cp $script_dir/native_cpu_vecz_test_lit_lit.site.cfg.py.in llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/lit.site.cfg.py.in
5959
cp $script_dir/native_cpu_vecz_test_lit_llvm_RISCV_lit.local.cfg llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/RISCV/lit.local.cfg
60-
git rm $llvm_repo/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/partial_linearization22-llvm18.ll
61-
git rm $llvm_repo/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/ScalableVectors/lit.local.cfg
6260
sed -i 's/{{undef|poison}}/poison/g' llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/packetization_debug_info.ll
6361
git add llvm/lib/SYCLNativeCPUUtils .github/workflows/sycl-linux-build.yml
6462
git commit -F $script_dir/native_cpu_commit_message.txt
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[NATIVE_CPU][SYCL] Switch to using native_cpu compiler pipeline inline
22

3-
This brings the native cpu compiler pipeline files directly under the ownership
3+
This brings the Native CPU compiler pipeline files directly under the ownership
44
of intel/llvm. This removes the direct dependence on the oneAPI Construction
55
Kit, although the history of those files still exists under intel/llvm and the
66
originals still exist at
@@ -9,15 +9,15 @@ https://github.com/uxlfoundation/oneapi-construction-kit.
99
This is the post merge update to the the oneAPI Construction Kit move of the compiler
1010
pipeline files for Native CPU and replaces the original FetchContent method.
1111

12-
This updates the CMakeLists.txt to be appropriate for llvm components,
13-
rather in the style of oneAPI Construction Kit. It also applies clang-format-20 to all the
14-
.h and .cpp files brought in. Other than that the .cpp and .h files are unchanged.
15-
16-
A brief explanation and limitations of the importing of the files are under l
17-
lvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_passes.rst.
18-
19-
It also updates the NATIVECPU_USE_OCK to be on in sycl-linux-build.yml. There is also a
20-
check-sycl-vecz target added for the vecz lit tests.
21-
22-
23-
12+
`llvm/lib/SYCLNativeCPUUtils/CMakeLists.txt` was updated to remove the fetch
13+
content and the ugly install workaround. Missing is the lit tests for the
14+
pipeline tests as these refer to the use of a non-ported tool, `muxc`.
15+
CMakeLists.txt across was updated to use LLVM macros across `compiler_pipeline`
16+
and `vecz` ported code, as well as changing `NATIVECPU_USE_OCK` to be the
17+
default. It also applies clang-format-20 to all the .h and .cpp files brought
18+
in. Other than that the .cpp and .h files are unchanged. The lit tests cfg files
19+
were updated to fit with LLVM, and a small change was made to avoid use of
20+
`undef`.
21+
22+
A brief explanation and limitations of the importing of the files are under
23+
`llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_passes.rst`.

scripts/native_cpu_compiler_passes.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Compiler passes
44
Introduction
55
------------
66

7-
Files under this directory are ported from the [oneAPI Construction
8-
Kit](https://github.com/uxlfoundation/oneapi-construction-kit). They are used by
9-
NativeCPU to help create a pipeline for turning a base kernel into something
10-
which can be executed across multiple work items, including auto-vectorization.
7+
Files under this directory are ported from the `oneAPI Construction Kit`_. They
8+
are used by Native CPU to help create a pipeline for turning a base kernel into
9+
something which can be executed across multiple work items, including
10+
auto-vectorization.
1111

1212
These files are largely from the sub-directories
1313
**modules/compiler/compiler_pipeline**, **modules/compiler/vecz** and
1414
**modules/compiler/multi_llvm**. Only files that are used have been copied and
15-
the **Cmake** files have been updated to fit in with LLVM components.
15+
the **CMake** files have been updated to fit in with LLVM components.
1616

1717
These sub-directories are used as follows:
1818

@@ -50,15 +50,16 @@ copied across.
5050
these directories after the port.
5151
* **vecz** has a test tool **veczc** and associated **lit** tests. This tool if
5252
required should be moved under **llvm/tools** or **llvm/test**. This is also
53-
requires `NATIVE_CPU_BUILD_VECZ_TEST_TOOLS` cmake option to build. This can be
53+
requires `NATIVE_CPU_BUILD_VECZ_TEST_TOOLS` **CMake** option to build. This can be
5454
run using the target `check-sycl-vecz`.
5555
* **compiler_pipeline** has lit tests for the passes which have not been ported
5656
across. This is because they use a tool **muxc**, but these passes should be
57-
able to be tested using opt. These lit tests can be found
58-
[here](https://github.com/uxlfoundation/oneapi-construction-kit/tree/main/modules/compiler/test/lit/passes).
57+
able to be tested using **opt**. These lit tests can be found in the
58+
`pipeline pass tests`_.
5959
* There are many files that are unlikely to have any code coverage but because
6060
there are referred to in other files which we do need, they exist here. These
6161
should be pruned over time as a better understanding is made of what is
6262
required.
6363

64-
.. _oneAPI Construction Kit: https://github.com/uxlfoundation/oneapi-construction-kit
64+
.. _oneAPI Construction Kit: https://github.com/uxlfoundation/oneapi-construction-kit
65+
.. _pipeline pass tests: https://github.com/uxlfoundation/oneapi-construction-kit/tree/main/modules/compiler/test/lit/passes

scripts/native_cpu_vecz_test_lit_lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ config.test_exec_root = r"@CURRENT_BINARY_DIR@"
1111
# Paths to helper utilities
1212
config.tools = [ ToolSubst('veczc') ]
1313

14-
config.root.targets = frozenset('@LLVM_TARGETS_TO_BUILD@'.split(';'))
14+
config.targets = frozenset('@LLVM_TARGETS_TO_BUILD@'.split(';'))
1515

1616
config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@"))
1717

0 commit comments

Comments
 (0)