-
Notifications
You must be signed in to change notification settings - Fork 790
[NATIVE_CPU][SYCL] Switch to using native_cpu compiler pipeline inline instead of OCK fetchContent #19886
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
Merged
Merged
[NATIVE_CPU][SYCL] Switch to using native_cpu compiler pipeline inline instead of OCK fetchContent #19886
Changes from all commits
Commits
Show all changes
182 commits
Select commit
Hold shift + click to select a range
8874bb2
[vecz] Move to compiler module
frasercrmck 4e8a584
[multi_llvm] Move to compiler module
frasercrmck 41376e6
[lit] Have lit configure tools in-house
frasercrmck 6e40843
[compiler] Replace all uses of llvm::Optional
frasercrmck 5eabd4d
[multi_llvm] Add Triple.h wrapper
frasercrmck f01fae7
Run clang-format-9 on everything
ori-sky f64652a
[vecz] Update vsetvli intrinsic for LLVM 17
frasercrmck 148a386
[compiler] Adapt to removal of llvm.dbg.addr in LLVM 17+
frasercrmck 1c957a0
[compiler] Drop last traces of LLVM 14 support
frasercrmck 7a0e655
[multi_llvm] Provide implicit conversion from Optional to std::optional
frasercrmck 0dafdeb
[compiler] Remove need for passing Module to NameMangler
frasercrmck 29945d2
Subgroup broadcast of uniform value becomes a NOP (#59)
AmyCodeplay 8480725
[vecz] Update some lit tests to account for LLVM 17
frasercrmck 5a54394
[compiler] Enable mux subgroup/workgroup builtins
frasercrmck 3350190
[compiler] Provide methods for common group operation checks
frasercrmck 3d00633
[compiler] Add more helper methods for mux group operations
frasercrmck 106d3b9
[vecz] Migrate vecz lit tests to mux builtins
frasercrmck 91ef73c
[compiler] Update to build with LLVM 17
frasercrmck b3d2276
[compiler] Fix a couple of lit tests with LLVM 17
frasercrmck e5904ee
Amy/refactor work group collectives 2 (#98)
AmyCodeplay 10b9d78
[vecz] Do not vectorize llvm.debug.value intrinsics
frasercrmck c93b31f
[compiler] Delete dead CLBuiltinInfo code
frasercrmck 73bd8bd
[vecz] Remove checks for non-i8 memcpy/memsets
frasercrmck 427b2ef
[vecz] Remove dead/discarded function demangle
frasercrmck 0ed8ebd
[vecz] Switch from AssertingVH to PoisoningVH
frasercrmck fdbb6b1
[multi_llvm] Remove opaque pointer helpers
frasercrmck 5858572
[compiler] Remove all but one use of multi_llvm::Optional
frasercrmck c0e10f5
[vecz] Vectorize sub-group local ID on top of mux sub-groups
frasercrmck 5c08537
[vecz] Vectorize sub-group reductions on top of mux sub-groups
frasercrmck f54110b
[vecz] Vectorize sub-group broadcasts on top of mux sub-groups
frasercrmck b839b76
[vecz] Vectorize sub-group scans on top of mux sub-groups
frasercrmck cc242ab
[vecz] Packetize the sub-group size on top of mux sub-groups
frasercrmck 1005ff9
[compiler] Add mux sub-group shuffle builtins
frasercrmck 0c37789
[compiler] Vectorize to any required sub-group size
frasercrmck 5c54766
[compiler] Preserve 'entry point' on vectorized kernels
frasercrmck a6b43d5
[vecz] Vectorize to the reqd sub-group size under 'auto'
frasercrmck 3bae73b
[riscv] Vectorize sub-group functions to a device size
frasercrmck 449c0fe
[vecz] Fix alignment of load operations
frasercrmck 1887b3f
[vecz] Fix invalid dangling AssumptionCaches
frasercrmck 753793e
[compiler] Add work-group scan support in vecz/work-item-loops
frasercrmck a21a7af
[vecz] Use correct alignment for memcpy source
RossBrunton 6928994
[vecz] Don't mask work-group collective operations
frasercrmck 0d38f0b
[vecz] Packetize sub-group shuffles with uniform indices
frasercrmck 14225d9
[vecz] Packetize sub-group shuffle_xor builtins
frasercrmck 3871885
[multi_llvm] Remove ArrayRef helpers
frasercrmck c22c69f
[multi_llvm] Remove TypeSize helpers
frasercrmck 6b4ec57
[multi_llvm] Remove insertInto helpers
frasercrmck e4dc6c4
[multi_llvm] Remove InlineFunction helper
frasercrmck b88164f
[multi_llvm] Remove addVectorizableFunctionsFromVecLib helper
frasercrmck 41dad0f
[multi_llvm] Clean up unused includes
frasercrmck f113292
[multi_llvm] Remove Optional helper
frasercrmck 7009d6a
Remove old LLVM 15 code
frasercrmck 4811379
[multi_llvm] Remove getStructTypeByName helper
frasercrmck 8562327
[multi_llvm] Remove getDILocation helper
frasercrmck 3da0921
[multi_llvm] Move some vectorization helpers into the vectorizer
frasercrmck d47f463
[multi_llvm] Remove creation_apis_helper.h
frasercrmck a8ae40f
[multi_llvm] Move createBinOpForRecurKind helper
frasercrmck 23584d5
[multi_llvm] Clean up assorted 'inline' versioning
frasercrmck 6b5b08d
[vecz] Support vector-predicated reductions natively
frasercrmck e2eddfb
[vecz] Fix vectorization of sub-group broadcasts
frasercrmck 437baf7
[vecz] Packetize sub-group shuffle_(up|down) builtins
frasercrmck 643bc62
[vecz] Fix SquashSmallVectorsPass on larger vectors
frasercrmck 45a665b
[LLVM] Multi_llvm support for current tip changes
RossBrunton 319e7dc
[vecz] Update tests for LLVM tip and fix alignment optimization
RossBrunton b867868
[vecz] Suppress cert-err33-c on error-handling fprintf
frasercrmck f988373
Move LLVM 18 fixups.
hvdijk 6b193d6
[vecz] Provide more context when CFG conversion fails
frasercrmck 74d0cf5
[vecz] Run SROA as part of the vecz pipeline
frasercrmck b6a7155
[vecz] Simplify pass construction process
frasercrmck 9e232b9
More LLVM 18 fixups.
hvdijk 632c85e
[vecz] Add support for masking atomic RMW instructions
frasercrmck 27cc2d9
[compiler] Handle scalable structs as barrier live variables
frasercrmck 1a9491e
[vecz] Add support for masking cmpxchg instructions
frasercrmck 783cd9b
[NFC] Change startswith/endswith to starts_with/ends_with.
hvdijk bcae693
[vecz] Fix missing CHECKs in LIT tests
frasercrmck eb3737f
[vecz] Fix missing CHECK in LIT test
frasercrmck 153037f
[vecz] Enable XFAIL tests
frasercrmck f3764ec
[vecz] Merge and fix call instantiation LIT tests
frasercrmck c46bae6
[vecz] Add nounwind/norecurse attributes to internal vecz builtins
frasercrmck 2f7e00c
[vecz] Ensure inactive lanes don't contribute to branch conditions
frasercrmck 3bddeaa
[compiler] Ensure createLoop always creates a loop
frasercrmck 73fd006
[NFC] Merge OpaquePointers with main tests.
hvdijk 39f8f46
[NFC] Pick a style for const.
hvdijk f993b32
[tests] Update for LLVM 18.
hvdijk 8fe1f81
[NFC] Upgrade to clang-format-17.
hvdijk 0f68262
[compiler] Fix unchecked std::optional accesses
frasercrmck 345e8b7
[NFC] Add const.
hvdijk c39749d
[NFC] Address clang-tidy-17 readability warnings.
hvdijk 5b304da
[compiler] Improve analysis of 'true uniform' values
frasercrmck 3798c49
Update findDbgDeclare for LLVM 18
PietroGhg 0549866
Enable extra warnings, adjust code.
hvdijk 0ce030e
Upgrade to clang-tidy-17.
hvdijk ebb0a0d
Update tests for LLVM 19.
hvdijk fb17e5f
[vecz] Use LLVM helper for testing for powers of 2
frasercrmck e0e0fa9
[vecz] Add a pass to print StrideAnalysis results
frasercrmck e2ecdab
[vecz][NFC] Fix a couple of doxygen issues in OffsetInfo
frasercrmck dfe08c6
[vecz] Fix dropped value analysis in OffsetInfo
frasercrmck c421b7c
[NFC] buildAfter: return IRBuilder<>.
hvdijk 9e84524
Keep debug information.
hvdijk 42b425a
Update for LLVM 19.
hvdijk 715f8dc
Update for LLVM 19.
hvdijk 8e00b3f
Update for LLVM 19.
hvdijk 61d2113
LLVM 19 update: trunc to i1.
hvdijk e278c60
Accept nuw/nsw flags on trunc.
hvdijk 7580493
[LLVM 19] Adjust tests for llvm.ct* intrinsics.
hvdijk 17d65f8
Update lit check for vector.splice
PietroGhg 4eeda20
Moved compiler-pipeline out of utils so it can be included directly.
cca9b23
Use LLVM passes to output modules
PietroGhg 2dc2283
Remove all code specific to LLVM 16
80d71ac
Fix replace_local_module_scope_variables mempcy bug
d1f526d
Avoid StringRef.equals()
hvdijk 8ebf0b7
Update tests for LLVM 19.
hvdijk f4aaca5
[LLVM 19] Drop debug info format conversions
hvdijk c5841ed
Fix build with LLVM 19 again.
hvdijk bad94d1
Fix build with LLVM 19 again.
hvdijk 2007e53
[LLVM 20] Adjust irreducible_loop test
hvdijk 8f8bef4
[LLVM 20] Adjust for non-experimental builtins
hvdijk a93c2cc
[LLVM 20] Adjust packetize_mask_varying test
hvdijk 2e6fae4
[vecz] Avoid scalarization using large ints
hvdijk 86798e6
Fix compiler breakage on llvm 20 for createSimpleTargetReduction.
d366807
[LLVM20] Handle USubCond, USubSat.
hvdijk 41658d9
[vecz] Clear getelementptr flags.
hvdijk 18194f1
Upgrade clang-format & clang-tidy.
hvdijk 293dbcc
Remove LLVM 17 support.
hvdijk 0cc33f7
Fix build with LLVM 20.
hvdijk 1d452d5
Add support for ConstantAray in replace-module-scope pass.
52f70b8
[NFC] Avoid deprecated Type::getPointerTo.
hvdijk 626b71d
Fix vecz lit test for splat issues after llvm 20 changes to output
91d164e
[LLVM 20] Update tests.
hvdijk d899e8f
LLVM 20: Update lit tests.
hvdijk 3524c8c
[LLVM 20] Allow getelementptr nuw flag.
hvdijk a9bb965
[compiler] Handle skipped vectorized functions.
hvdijk acfd588
[compiler] Avoid out of bounds access.
hvdijk 9e7b479
[mux] Remove degenerate subgroup support.
hvdijk da04975
[compiler] Do not mix kernels with different sub-group sizes.
hvdijk 94c6f94
[vecz] Handle missing gather/scatter functions.
hvdijk 15fdf9f
Update for LLVM 20.
hvdijk e57031f
[vecz] Handle vectors of size 1.
hvdijk 40b912c
LLVM 20: Update for getFirstNonPHIOrDbg.
hvdijk a5ca431
LLVM 21: Update for Attribute::NoCapture removal.
hvdijk 04d65a4
Update for LLVM 20, 21.
hvdijk 99b1f03
Update for LLVM 21.
hvdijk d9efef4
Address clang & clang-tidy warnings.
hvdijk 9555a73
Address more clang & clang-tidy warnings.
hvdijk 56538f3
[vecz] Fix packetization of PHIs of literal structs.
hvdijk 79c9b40
[LLVM 21] Take address space into account for legality.
hvdijk a52b7d9
Remove all conditional LLVM code for LLVM 18
e35e199
Do not vectorize NoInline kernels.
hvdijk a337576
[LLVM 21] Avoid calling spir_kernel functions.
hvdijk 1168a18
Fix up Instrinsic::getAttributes to work across LLVM versions
0423986
Update to address PointerType deprecation.
hvdijk 3020f67
[vecz] Track barriers by ID.
hvdijk 4fe6c8e
[builtins] Improve robustness.
hvdijk 4869bb4
[NFC] Fix comments.
hvdijk 61d55e8
[LLVM 21] Update for CreateTargetInfo API change.
hvdijk 6099cc0
[LLVM 21] Add FMaximum, FMinimum.
hvdijk c5ce5ce
[NFC] Address LLVM 21's BinOp additions in a better way.
hvdijk f2e2aa4
Removal of Vulkan API support
71d18ce
[NFC] Remove Abacus extras.
hvdijk 1f16d4d
[LLVM 21] Avoid computeKnownBits.
hvdijk 76d0c25
[LLVM 21] Remove VectorizationFactor, use CreateElementCount.
hvdijk dedf80a
[NFC] Remove code for old debug info format.
hvdijk 75f885b
[LLVM 21] Allow nuw in more tests.
hvdijk 56b5011
Replace getNextNonDebugInstruction() with getNextNode()
d93bf5e
[LLVM TIP] Fix use of ConvertDebugDeclareToDebugValue
f2e46fe
[NFC] Remove more old debug info handling.
hvdijk 5cddabc
Fix check for GEPs with scalar indices
hvdijk 94a4719
[NFC] Remove some old LLVM support from tests.
hvdijk 91e7104
Remove CA references under compiler_pipeline and vecz
b7087e5
Changed copyright license to point to correct license file path
1213b0c
[LLVM 22] A few more lifetime fixes.
hvdijk e1663a0
Use poison rather than undef.
hvdijk 2506819
[NFC] Update to clang-format/clang-tidy 20.
hvdijk cfc296e
[vecz] Avoid mishandling poison.
hvdijk fc3e3f2
More poison/undef updates.
hvdijk a951cde
[NFC] Remove unused %pp-llvm-ver.
hvdijk 3720900
Switch to LLVM versions 20/21 as supported versions.
hvdijk ac9ee79
Remove outdated test.
hvdijk 9333649
[NFC] Remove leftover older LLVM handling.
hvdijk d3a5a69
Re-enable RISC-V lit tests.
hvdijk 25f934d
[SYCL][NATIVE_CPU] Resolve formatting issues on compiler_pipeline
477f0cd
[NATIVE_CPU][SYCL] Switch to using native_cpu compiler pipeline inline
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
set(OCK_LIBS) | ||
option(NATIVECPU_USE_OCK "Use the oneAPI Construction Kit for Native CPU" ON) | ||
|
||
# Don't use OCK compiler_passes if Native CPU is not enabled. | ||
if(NOT "native_cpu" IN_LIST SYCL_ENABLE_BACKENDS) | ||
set(NATIVECPU_USE_OCK Off CACHE BOOL "Use the oneAPI Construction Kit for Native CPU" FORCE) | ||
endif() | ||
|
||
if(NATIVECPU_USE_OCK) | ||
add_subdirectory(compiler_passes EXCLUDE_FROM_ALL) | ||
set(OCK_LIBS NativeCPUPipeline NativeCPUVecz) | ||
endif() | ||
|
||
add_llvm_component_library(LLVMSYCLNativeCPUUtils | ||
PipelineSYCLNativeCPU.cpp | ||
PrepareSYCLNativeCPU.cpp | ||
|
@@ -17,80 +30,13 @@ add_llvm_component_library(LLVMSYCLNativeCPUUtils | |
TargetParser | ||
TransformUtils | ||
ipo | ||
) | ||
${OCK_LIBS} | ||
) | ||
|
||
option(NATIVECPU_USE_OCK "Use the oneAPI Construction Kit for Native CPU" ON) | ||
|
||
# Don't fetch OCK if Native CPU is not enabled. | ||
if(NOT "native_cpu" IN_LIST SYCL_ENABLE_BACKENDS) | ||
set(NATIVECPU_USE_OCK Off CACHE BOOL "Use the oneAPI Construction Kit for Native CPU" FORCE) | ||
endif() | ||
|
||
if(NATIVECPU_USE_OCK) | ||
set(OCK_SEARCH_LOC "oneapi-construction-kit/compiler_passes") | ||
if(NOT FETCHCONTENT_SOURCE_DIR_ONEAPI-CK) | ||
find_path(OCK_SOURCE_DIR ${OCK_SEARCH_LOC} PATHS ${CMAKE_PREFIX_PATH}) | ||
endif() | ||
if(OCK_SOURCE_DIR) | ||
message(STATUS "Found system source location of oneAPI Construction Kit in ${OCK_SOURCE_DIR}") | ||
set(OCK_SOURCE_DIR "${OCK_SOURCE_DIR}/${OCK_SEARCH_LOC}") | ||
set(OCK_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/oneapi-construction-kit") | ||
else() | ||
set(OCK_GIT_REPO "https://github.com/uxlfoundation/oneapi-construction-kit.git") | ||
# commit d0a32d701e34b3285de7ce776ea36abfec673df7 | ||
# Merge: a9f848e0e8 56473a8c25 | ||
# Author: Harald van Dijk <[email protected]> | ||
# Date: Mon Jun 30 12:24:46 2025 +0100 | ||
# | ||
# Merge pull request #878 from hvdijk/specify-fuse-ld-lld | ||
# | ||
# [RefSi] Explicitly specify -fuse-ld=lld. | ||
set(OCK_GIT_TAG d0a32d701e34b3285de7ce776ea36abfec673df7) | ||
|
||
include(FetchContent) | ||
FetchContent_Declare(oneapi-ck | ||
GIT_REPOSITORY "${OCK_GIT_REPO}" | ||
GIT_TAG "${OCK_GIT_TAG}" | ||
) | ||
FetchContent_GetProperties(oneapi-ck) | ||
if(NOT oneapi-ck_POPULATED) | ||
if(FETCHCONTENT_SOURCE_DIR_ONEAPI-CK) | ||
message(STATUS "Using specified oneAPI Construction Kit repo location at ${FETCHCONTENT_SOURCE_DIR_ONEAPI-CK}") | ||
else() | ||
message(STATUS "Cloning oneAPI Construction Kit from ${OCK_GIT_REPO}, tag ${OCK_GIT_TAG}") | ||
endif() | ||
FetchContent_Populate(oneapi-ck) | ||
message(STATUS "oneAPI Construction Kit cloned in ${oneapi-ck_SOURCE_DIR}") | ||
set(OCK_SOURCE_DIR ${oneapi-ck_SOURCE_DIR}/compiler_passes) | ||
set(OCK_BINARY_DIR ${oneapi-ck_BINARY_DIR}) | ||
endif() | ||
endif() | ||
|
||
set(CA_ENABLE_API "cl" CACHE STRING "" FORCE) | ||
add_subdirectory( | ||
${OCK_SOURCE_DIR} | ||
${OCK_BINARY_DIR} EXCLUDE_FROM_ALL) | ||
|
||
install(TARGETS compiler-pipeline | ||
EXPORT;LLVMExports | ||
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT compiler-pipeline | ||
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT compiler-pipeline | ||
RUNTIME DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT compiler-pipeline) | ||
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS compiler-pipeline) | ||
install(TARGETS vecz | ||
EXPORT;LLVMExports | ||
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT vecz | ||
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT vecz | ||
RUNTIME DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT vecz) | ||
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS vecz) | ||
install(TARGETS multi_llvm EXPORT;LLVMExports) | ||
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS multi_llvm) | ||
target_compile_definitions(LLVMSYCLNativeCPUUtils PRIVATE NATIVECPU_USE_OCK) | ||
target_include_directories(LLVMSYCLNativeCPUUtils PRIVATE | ||
${oneapi-ck_SOURCE_DIR}/modules/compiler/multi_llvm/include | ||
${oneapi-ck_SOURCE_DIR}/modules/cargo/include | ||
${oneapi-ck_SOURCE_DIR}/modules/compiler/vecz/include | ||
${oneapi-ck_SOURCE_DIR}/modules/compiler/utils/include) | ||
target_link_libraries(LLVMSYCLNativeCPUUtils PRIVATE compiler-pipeline vecz) | ||
|
||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_passes/compiler_pipeline/include | ||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_passes/vecz/include) | ||
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/compiler_pipeline) | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/vecz) |
63 changes: 63 additions & 0 deletions
63
llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_passes.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Compiler passes | ||
=============== | ||
|
||
Introduction | ||
------------ | ||
|
||
Files under this directory are integrated from the `oneAPI Construction Kit`_ | ||
using `git-filter-repo`. They are used by Native CPU to help create a pipeline for | ||
turning a base kernel into something which can be executed across multiple work | ||
items, including auto-vectorization. | ||
|
||
These files are largely from the sub-directories | ||
**modules/compiler/compiler_pipeline**, **modules/compiler/vecz** and | ||
**modules/compiler/multi_llvm**. Only files that are used have been integrated | ||
and the **CMake** files have been updated to fit in with LLVM components. | ||
|
||
These sub-directories are used as follows: | ||
|
||
* **compiler_pipeline** provides the passes to build a pipeline from the initial | ||
kernel, including generating working item loops, handling local memory, | ||
handling metadata and calling the vectorizer **vecz**. | ||
|
||
* **vecz** provides a full function vectorizer, which generates a copy of the | ||
original function but vectorized across the work group, taking into account | ||
subgroups. | ||
|
||
* **multi_llvm**. This provides some support for these functions to work across | ||
multiple LLVM versions. Although this is not strictly needed in LLVM, it has | ||
been integrated to allow the integration to go smoothly, without changing files | ||
directly. Note this is header only and exists under | ||
**compiler_pipeline/include/multi_llvm**. | ||
|
||
**compiler_pipeline** and **vecz** will be documented under `sycl/docs`. Note | ||
that there are several limitations in the code that are a result of the initial | ||
integration. These should be addressed over time for maintainability reasons, | ||
they are not necessary for correctness or performance reasons. | ||
|
||
General limitations | ||
------------------- | ||
|
||
To simplify the integration and reduce risk, most of the files were integrated | ||
with no changes at all. This means there are currently the following limitations: | ||
|
||
* The namespace in **compiler_pipeline** is **compiler/utils**, the namespace in | ||
multi_llvm is **multi_llvm** and the namespace in **vecz** is **vecz**. These should | ||
be updated to reflect being under **LLVM**. | ||
* include files should ideally be moved to under **llvm/include** but remain under | ||
these directories after the integration. | ||
* **vecz** has a test tool **veczc** and associated **lit** tests. This tool if | ||
required should be moved under **llvm/tools** or **llvm/test**. This is also | ||
requires `NATIVE_CPU_BUILD_VECZ_TEST_TOOLS` **CMake** option to build. This can be | ||
run using the target `check-sycl-vecz`. | ||
* **compiler_pipeline** has lit tests for the passes which have not been integrated. | ||
This is because they use a tool **muxc**, but these passes should be | ||
able to be tested using **opt**. These lit tests can be found in the | ||
`pipeline pass tests`_. | ||
* There are many integrated files that are unlikely to have any code coverage but because | ||
there are referred to in other files which we do need, they exist here. These | ||
should be pruned over time as a better understanding is made of what is | ||
essential. | ||
|
||
.. _oneAPI Construction Kit: https://github.com/uxlfoundation/oneapi-construction-kit | ||
.. _pipeline pass tests: https://github.com/uxlfoundation/oneapi-construction-kit/tree/main/modules/compiler/test/lit/passes |
32 changes: 32 additions & 0 deletions
32
llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
add_llvm_component_library(LLVMNativeCPUPipeline | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/attributes.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/barrier_regions.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/builtin_info.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/cl_builtin_info.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/define_mux_builtins_pass.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/dma.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/encode_kernel_metadata_pass.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/group_collective_helpers.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/mangling.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/metadata.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/mux_builtin_info.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/pass_functions.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/optimal_builtin_replacement_pass.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/pass_machinery.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/prepare_barriers_pass.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/replace_local_module_scope_variables_pass.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/scheduling.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/sub_group_analysis.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/target_extension_types.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/source/work_item_loops_pass.cpp | ||
|
||
LINK_COMPONENTS | ||
Passes | ||
Core | ||
) | ||
|
||
# TODO: Move to under LLVM include and work out why ADDITIONAL_HEADER_DIRS | ||
# does not capture it. | ||
target_include_directories(LLVMNativeCPUPipeline PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
) |
38 changes: 38 additions & 0 deletions
38
...LNativeCPUUtils/compiler_passes/compiler_pipeline/include/compiler/utils/address_spaces.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (C) Codeplay Software Limited | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License") with LLVM | ||
// Exceptions; you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://github.com/uxlfoundation/oneapi-construction-kit/blob/main/LICENSE.txt | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
/// @file | ||
/// | ||
/// LLVM address space identifiers. | ||
|
||
#ifndef COMPILER_UTILS_ADDRESS_SPACES_H_INCLUDED | ||
#define COMPILER_UTILS_ADDRESS_SPACES_H_INCLUDED | ||
|
||
namespace compiler { | ||
namespace utils { | ||
namespace AddressSpace { | ||
enum { | ||
Private = 0, | ||
Global = 1, | ||
Constant = 2, | ||
Local = 3, | ||
Generic = 4, | ||
}; | ||
} | ||
} // namespace utils | ||
} // namespace compiler | ||
|
||
#endif // COMPILER_UTILS_ADDRESS_SPACES_H_INCLUDED |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it accurate to say that this PR takes files that were previously checked out as part of the FetchContent for OCK and adds them into this repo, and that the ownership of the files is still in OCK (as in, changes to the files will be made in the OCK repo, and any changes to them here will not be pushed back to OCK)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does take files from OCK and adds them to this repo, with some clang-formatting and cmake changes.
Although it's theoretically possible to go back and forward, I think this is more of a split and DPC++ can make changes without pushing them back and vice-versa. Some monitoring of fixes in either place may still be beneficial. OCK is unlikely to be on the same version of llvm tip wrt to fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok if we are taking files from OCK and adding them here and the files here become severed/unrelated from OCK this is fine from my POV. If we were just copying code still owned by OCK and we would periodically sync changes from OCK or something, I would really recommend FetchContent, but that seems not the case here.