Skip to content
Merged
Show file tree
Hide file tree
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 May 24, 2023
4e8a584
[multi_llvm] Move to compiler module
frasercrmck May 24, 2023
41376e6
[lit] Have lit configure tools in-house
frasercrmck May 25, 2023
6e40843
[compiler] Replace all uses of llvm::Optional
frasercrmck Jun 22, 2023
5eabd4d
[multi_llvm] Add Triple.h wrapper
frasercrmck Jun 22, 2023
f01fae7
Run clang-format-9 on everything
ori-sky Jun 22, 2023
f64652a
[vecz] Update vsetvli intrinsic for LLVM 17
frasercrmck Jun 26, 2023
148a386
[compiler] Adapt to removal of llvm.dbg.addr in LLVM 17+
frasercrmck Jun 26, 2023
1c957a0
[compiler] Drop last traces of LLVM 14 support
frasercrmck Jun 26, 2023
7a0e655
[multi_llvm] Provide implicit conversion from Optional to std::optional
frasercrmck Jun 29, 2023
0dafdeb
[compiler] Remove need for passing Module to NameMangler
frasercrmck Jul 4, 2023
29945d2
Subgroup broadcast of uniform value becomes a NOP (#59)
AmyCodeplay Jul 17, 2023
8480725
[vecz] Update some lit tests to account for LLVM 17
frasercrmck Jul 25, 2023
5a54394
[compiler] Enable mux subgroup/workgroup builtins
frasercrmck Aug 9, 2023
3350190
[compiler] Provide methods for common group operation checks
frasercrmck Aug 9, 2023
3d00633
[compiler] Add more helper methods for mux group operations
frasercrmck Aug 14, 2023
106d3b9
[vecz] Migrate vecz lit tests to mux builtins
frasercrmck Aug 14, 2023
91ef73c
[compiler] Update to build with LLVM 17
frasercrmck Aug 15, 2023
b3d2276
[compiler] Fix a couple of lit tests with LLVM 17
frasercrmck Aug 16, 2023
e5904ee
Amy/refactor work group collectives 2 (#98)
AmyCodeplay Aug 23, 2023
10b9d78
[vecz] Do not vectorize llvm.debug.value intrinsics
frasercrmck Aug 28, 2023
c93b31f
[compiler] Delete dead CLBuiltinInfo code
frasercrmck Aug 28, 2023
73bd8bd
[vecz] Remove checks for non-i8 memcpy/memsets
frasercrmck Aug 29, 2023
427b2ef
[vecz] Remove dead/discarded function demangle
frasercrmck Aug 30, 2023
0ed8ebd
[vecz] Switch from AssertingVH to PoisoningVH
frasercrmck Aug 31, 2023
fdbb6b1
[multi_llvm] Remove opaque pointer helpers
frasercrmck Aug 30, 2023
5858572
[compiler] Remove all but one use of multi_llvm::Optional
frasercrmck Aug 30, 2023
c0e10f5
[vecz] Vectorize sub-group local ID on top of mux sub-groups
frasercrmck Aug 15, 2023
5c08537
[vecz] Vectorize sub-group reductions on top of mux sub-groups
frasercrmck Aug 15, 2023
f54110b
[vecz] Vectorize sub-group broadcasts on top of mux sub-groups
frasercrmck Aug 29, 2023
b839b76
[vecz] Vectorize sub-group scans on top of mux sub-groups
frasercrmck Aug 30, 2023
cc242ab
[vecz] Packetize the sub-group size on top of mux sub-groups
frasercrmck Aug 30, 2023
1005ff9
[compiler] Add mux sub-group shuffle builtins
frasercrmck Sep 5, 2023
0c37789
[compiler] Vectorize to any required sub-group size
frasercrmck Sep 12, 2023
5c54766
[compiler] Preserve 'entry point' on vectorized kernels
frasercrmck Sep 13, 2023
a6b43d5
[vecz] Vectorize to the reqd sub-group size under 'auto'
frasercrmck Sep 14, 2023
3bae73b
[riscv] Vectorize sub-group functions to a device size
frasercrmck Sep 14, 2023
449c0fe
[vecz] Fix alignment of load operations
frasercrmck Sep 20, 2023
1887b3f
[vecz] Fix invalid dangling AssumptionCaches
frasercrmck Sep 21, 2023
753793e
[compiler] Add work-group scan support in vecz/work-item-loops
frasercrmck Sep 26, 2023
a21a7af
[vecz] Use correct alignment for memcpy source
RossBrunton Oct 12, 2023
6928994
[vecz] Don't mask work-group collective operations
frasercrmck Oct 16, 2023
0d38f0b
[vecz] Packetize sub-group shuffles with uniform indices
frasercrmck Oct 26, 2023
14225d9
[vecz] Packetize sub-group shuffle_xor builtins
frasercrmck Oct 26, 2023
3871885
[multi_llvm] Remove ArrayRef helpers
frasercrmck Nov 2, 2023
c22c69f
[multi_llvm] Remove TypeSize helpers
frasercrmck Nov 2, 2023
6b4ec57
[multi_llvm] Remove insertInto helpers
frasercrmck Nov 2, 2023
e4dc6c4
[multi_llvm] Remove InlineFunction helper
frasercrmck Nov 2, 2023
b88164f
[multi_llvm] Remove addVectorizableFunctionsFromVecLib helper
frasercrmck Nov 2, 2023
41dad0f
[multi_llvm] Clean up unused includes
frasercrmck Nov 2, 2023
f113292
[multi_llvm] Remove Optional helper
frasercrmck Nov 2, 2023
7009d6a
Remove old LLVM 15 code
frasercrmck Nov 2, 2023
4811379
[multi_llvm] Remove getStructTypeByName helper
frasercrmck Nov 2, 2023
8562327
[multi_llvm] Remove getDILocation helper
frasercrmck Nov 2, 2023
3da0921
[multi_llvm] Move some vectorization helpers into the vectorizer
frasercrmck Nov 2, 2023
d47f463
[multi_llvm] Remove creation_apis_helper.h
frasercrmck Nov 2, 2023
a8ae40f
[multi_llvm] Move createBinOpForRecurKind helper
frasercrmck Nov 2, 2023
23584d5
[multi_llvm] Clean up assorted 'inline' versioning
frasercrmck Nov 2, 2023
6b5b08d
[vecz] Support vector-predicated reductions natively
frasercrmck Nov 2, 2023
e2eddfb
[vecz] Fix vectorization of sub-group broadcasts
frasercrmck Nov 1, 2023
437baf7
[vecz] Packetize sub-group shuffle_(up|down) builtins
frasercrmck Oct 30, 2023
643bc62
[vecz] Fix SquashSmallVectorsPass on larger vectors
frasercrmck Nov 7, 2023
45a665b
[LLVM] Multi_llvm support for current tip changes
RossBrunton Nov 7, 2023
319e7dc
[vecz] Update tests for LLVM tip and fix alignment optimization
RossBrunton Nov 22, 2023
b867868
[vecz] Suppress cert-err33-c on error-handling fprintf
frasercrmck Nov 23, 2023
f988373
Move LLVM 18 fixups.
hvdijk Dec 5, 2023
6b193d6
[vecz] Provide more context when CFG conversion fails
frasercrmck Dec 13, 2023
74d0cf5
[vecz] Run SROA as part of the vecz pipeline
frasercrmck Dec 14, 2023
b6a7155
[vecz] Simplify pass construction process
frasercrmck Dec 14, 2023
9e232b9
More LLVM 18 fixups.
hvdijk Dec 18, 2023
632c85e
[vecz] Add support for masking atomic RMW instructions
frasercrmck Dec 14, 2023
27cc2d9
[compiler] Handle scalable structs as barrier live variables
frasercrmck Dec 20, 2023
1a9491e
[vecz] Add support for masking cmpxchg instructions
frasercrmck Dec 19, 2023
783cd9b
[NFC] Change startswith/endswith to starts_with/ends_with.
hvdijk Jan 2, 2024
bcae693
[vecz] Fix missing CHECKs in LIT tests
frasercrmck Jan 2, 2024
eb3737f
[vecz] Fix missing CHECK in LIT test
frasercrmck Jan 2, 2024
153037f
[vecz] Enable XFAIL tests
frasercrmck Jan 2, 2024
f3764ec
[vecz] Merge and fix call instantiation LIT tests
frasercrmck Jan 2, 2024
c46bae6
[vecz] Add nounwind/norecurse attributes to internal vecz builtins
frasercrmck Jan 2, 2024
2f7e00c
[vecz] Ensure inactive lanes don't contribute to branch conditions
frasercrmck Jan 9, 2024
3bddeaa
[compiler] Ensure createLoop always creates a loop
frasercrmck Oct 11, 2023
73fd006
[NFC] Merge OpaquePointers with main tests.
hvdijk Jan 16, 2024
39f8f46
[NFC] Pick a style for const.
hvdijk Jan 16, 2024
f993b32
[tests] Update for LLVM 18.
hvdijk Jan 16, 2024
8fe1f81
[NFC] Upgrade to clang-format-17.
hvdijk Jan 18, 2024
0f68262
[compiler] Fix unchecked std::optional accesses
frasercrmck Jan 11, 2024
345e8b7
[NFC] Add const.
hvdijk Jan 18, 2024
c39749d
[NFC] Address clang-tidy-17 readability warnings.
hvdijk Jan 22, 2024
5b304da
[compiler] Improve analysis of 'true uniform' values
frasercrmck Jan 22, 2024
3798c49
Update findDbgDeclare for LLVM 18
PietroGhg Jan 29, 2024
0549866
Enable extra warnings, adjust code.
hvdijk Jan 31, 2024
0ce030e
Upgrade to clang-tidy-17.
hvdijk Feb 1, 2024
ebb0a0d
Update tests for LLVM 19.
hvdijk Feb 1, 2024
fb17e5f
[vecz] Use LLVM helper for testing for powers of 2
frasercrmck Feb 15, 2024
e0e0fa9
[vecz] Add a pass to print StrideAnalysis results
frasercrmck Feb 15, 2024
e2ecdab
[vecz][NFC] Fix a couple of doxygen issues in OffsetInfo
frasercrmck Feb 19, 2024
dfe08c6
[vecz] Fix dropped value analysis in OffsetInfo
frasercrmck Feb 19, 2024
c421b7c
[NFC] buildAfter: return IRBuilder<>.
hvdijk Feb 22, 2024
9e84524
Keep debug information.
hvdijk Feb 22, 2024
42b425a
Update for LLVM 19.
hvdijk Feb 26, 2024
715f8dc
Update for LLVM 19.
hvdijk Mar 6, 2024
8e00b3f
Update for LLVM 19.
hvdijk Mar 25, 2024
61d2113
LLVM 19 update: trunc to i1.
hvdijk Mar 31, 2024
e278c60
Accept nuw/nsw flags on trunc.
hvdijk Apr 16, 2024
7580493
[LLVM 19] Adjust tests for llvm.ct* intrinsics.
hvdijk Apr 26, 2024
17d65f8
Update lit check for vector.splice
PietroGhg May 1, 2024
4eeda20
Moved compiler-pipeline out of utils so it can be included directly.
May 2, 2024
cca9b23
Use LLVM passes to output modules
PietroGhg May 6, 2024
2dc2283
Remove all code specific to LLVM 16
May 9, 2024
80d71ac
Fix replace_local_module_scope_variables mempcy bug
May 6, 2024
d1f526d
Avoid StringRef.equals()
hvdijk May 22, 2024
8ebf0b7
Update tests for LLVM 19.
hvdijk Jun 17, 2024
f4aaca5
[LLVM 19] Drop debug info format conversions
hvdijk Jun 21, 2024
c5841ed
Fix build with LLVM 19 again.
hvdijk Jun 24, 2024
bad94d1
Fix build with LLVM 19 again.
hvdijk Jul 1, 2024
2007e53
[LLVM 20] Adjust irreducible_loop test
hvdijk Aug 29, 2024
8f8bef4
[LLVM 20] Adjust for non-experimental builtins
hvdijk Aug 29, 2024
a93c2cc
[LLVM 20] Adjust packetize_mask_varying test
hvdijk Sep 2, 2024
2e6fae4
[vecz] Avoid scalarization using large ints
hvdijk Sep 5, 2024
86798e6
Fix compiler breakage on llvm 20 for createSimpleTargetReduction.
Sep 6, 2024
d366807
[LLVM20] Handle USubCond, USubSat.
hvdijk Sep 9, 2024
41658d9
[vecz] Clear getelementptr flags.
hvdijk Sep 11, 2024
18194f1
Upgrade clang-format & clang-tidy.
hvdijk Oct 7, 2024
293dbcc
Remove LLVM 17 support.
hvdijk Oct 14, 2024
0cc33f7
Fix build with LLVM 20.
hvdijk Oct 15, 2024
1d452d5
Add support for ConstantAray in replace-module-scope pass.
Oct 16, 2024
52f70b8
[NFC] Avoid deprecated Type::getPointerTo.
hvdijk Nov 11, 2024
626b71d
Fix vecz lit test for splat issues after llvm 20 changes to output
Nov 15, 2024
91d164e
[LLVM 20] Update tests.
hvdijk Nov 20, 2024
d899e8f
LLVM 20: Update lit tests.
hvdijk Nov 22, 2024
3524c8c
[LLVM 20] Allow getelementptr nuw flag.
hvdijk Dec 6, 2024
a9bb965
[compiler] Handle skipped vectorized functions.
hvdijk Jan 10, 2025
acfd588
[compiler] Avoid out of bounds access.
hvdijk Jan 15, 2025
9e7b479
[mux] Remove degenerate subgroup support.
hvdijk Jan 17, 2025
da04975
[compiler] Do not mix kernels with different sub-group sizes.
hvdijk Jan 18, 2025
94c6f94
[vecz] Handle missing gather/scatter functions.
hvdijk Jan 22, 2025
15fdf9f
Update for LLVM 20.
hvdijk Jan 24, 2025
e57031f
[vecz] Handle vectors of size 1.
hvdijk Jan 24, 2025
40b912c
LLVM 20: Update for getFirstNonPHIOrDbg.
hvdijk Jan 29, 2025
a5ca431
LLVM 21: Update for Attribute::NoCapture removal.
hvdijk Feb 13, 2025
04d65a4
Update for LLVM 20, 21.
hvdijk Feb 18, 2025
99b1f03
Update for LLVM 21.
hvdijk Mar 14, 2025
d9efef4
Address clang & clang-tidy warnings.
hvdijk Mar 24, 2025
9555a73
Address more clang & clang-tidy warnings.
hvdijk Mar 25, 2025
56538f3
[vecz] Fix packetization of PHIs of literal structs.
hvdijk Apr 1, 2025
79c9b40
[LLVM 21] Take address space into account for legality.
hvdijk Apr 4, 2025
a52b7d9
Remove all conditional LLVM code for LLVM 18
Apr 8, 2025
e35e199
Do not vectorize NoInline kernels.
hvdijk Apr 9, 2025
a337576
[LLVM 21] Avoid calling spir_kernel functions.
hvdijk Apr 15, 2025
1168a18
Fix up Instrinsic::getAttributes to work across LLVM versions
Apr 18, 2025
0423986
Update to address PointerType deprecation.
hvdijk Apr 23, 2025
3020f67
[vecz] Track barriers by ID.
hvdijk Apr 23, 2025
4fe6c8e
[builtins] Improve robustness.
hvdijk Apr 24, 2025
4869bb4
[NFC] Fix comments.
hvdijk Apr 25, 2025
61d55e8
[LLVM 21] Update for CreateTargetInfo API change.
hvdijk Apr 30, 2025
6099cc0
[LLVM 21] Add FMaximum, FMinimum.
hvdijk May 2, 2025
c5ce5ce
[NFC] Address LLVM 21's BinOp additions in a better way.
hvdijk May 2, 2025
f2e2aa4
Removal of Vulkan API support
Jan 17, 2025
71d18ce
[NFC] Remove Abacus extras.
hvdijk May 21, 2025
1f16d4d
[LLVM 21] Avoid computeKnownBits.
hvdijk Jun 4, 2025
76d0c25
[LLVM 21] Remove VectorizationFactor, use CreateElementCount.
hvdijk Jun 11, 2025
dedf80a
[NFC] Remove code for old debug info format.
hvdijk Jun 12, 2025
75f885b
[LLVM 21] Allow nuw in more tests.
hvdijk Jun 20, 2025
56b5011
Replace getNextNonDebugInstruction() with getNextNode()
Jul 16, 2025
d93bf5e
[LLVM TIP] Fix use of ConvertDebugDeclareToDebugValue
Jul 17, 2025
f2e46fe
[NFC] Remove more old debug info handling.
hvdijk Jul 19, 2025
5cddabc
Fix check for GEPs with scalar indices
hvdijk Jul 21, 2025
94a4719
[NFC] Remove some old LLVM support from tests.
hvdijk Jul 21, 2025
91e7104
Remove CA references under compiler_pipeline and vecz
Aug 19, 2025
b7087e5
Changed copyright license to point to correct license file path
Aug 19, 2025
1213b0c
[LLVM 22] A few more lifetime fixes.
hvdijk Aug 26, 2025
e1663a0
Use poison rather than undef.
hvdijk Aug 27, 2025
2506819
[NFC] Update to clang-format/clang-tidy 20.
hvdijk Aug 27, 2025
cfc296e
[vecz] Avoid mishandling poison.
hvdijk Aug 28, 2025
fc3e3f2
More poison/undef updates.
hvdijk Aug 29, 2025
a951cde
[NFC] Remove unused %pp-llvm-ver.
hvdijk Aug 29, 2025
3720900
Switch to LLVM versions 20/21 as supported versions.
hvdijk Aug 29, 2025
ac9ee79
Remove outdated test.
hvdijk Aug 29, 2025
9333649
[NFC] Remove leftover older LLVM handling.
hvdijk Sep 2, 2025
d3a5a69
Re-enable RISC-V lit tests.
hvdijk Sep 2, 2025
25f934d
[SYCL][NATIVE_CPU] Resolve formatting issues on compiler_pipeline
Sep 5, 2025
477f0cd
[NATIVE_CPU][SYCL] Switch to using native_cpu compiler pipeline inline
Sep 5, 2025
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
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ jobs:
--ci-defaults ${{ inputs.build_configure_extra_args }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DLLVM_INSTALL_UTILS=ON \
-DNATIVECPU_USE_OCK=Off
-DLLVM_INSTALL_UTILS=ON
- name: Compile
id: build
# Emulate default value for manual dispatch as we've run out of available arguments.
Expand Down
88 changes: 17 additions & 71 deletions llvm/lib/SYCLNativeCPUUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
set(OCK_LIBS)
Copy link
Contributor

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)?

Copy link
Author

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)?

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.

Copy link
Contributor

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.

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
Expand All @@ -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()
2 changes: 2 additions & 0 deletions llvm/lib/SYCLNativeCPUUtils/compiler_passes/CMakeLists.txt
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 llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_passes.rst
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
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>
)
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
Loading
Loading