This repository was archived by the owner on Feb 21, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 196
[CIR][MERGE-SPLIT-COMPILATION] Adds a compilation step that merges Device and Host CIR into a single module and can co-optimize their execution #2097
Draft
koparasy
wants to merge
14
commits into
llvm:main
Choose a base branch
from
koparasy:features/clangir-offload-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0ee10c0
Create cir-combine action placeholder
koparasy cb4c90d
Remove tooling
koparasy f94fbfb
Combine CIR code into a single module
koparasy 8a307be
Allow `cir-combine` to split back to device/host modules
koparasy 9dc8414
Allow lowering to object files through emit-* flags
koparasy 63a8f40
Add ABI support for HIP
koparasy a9476f7
GpuBinaryHandle Attribute is now stringref
koparasy ed0ff3c
Proper parsing of ConstDataArays
koparasy 0e2a637
Read/Write bytecode
koparasy e54f4b8
[WIP][Non-Functional] Make Driver aware of cir combine actions
koparasy 463d7c5
Minor changes to relax action checking
koparasy 7f8c599
Minimum progress done, passes are now correctly create the dependency
koparasy 727b5a2
Properly construct phases (-ccc-print-phases) and print them
koparasy 562e5f0
Allow CUDA support by Moving CIRCombine related methods under CudaAct…
RiverDave File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
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
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
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 |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) | ||
| get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) | ||
|
|
||
| include_directories(${LLVM_MAIN_SRC_DIR}/../mlir/include) | ||
| include_directories(${CMAKE_BINARY_DIR}/tools/mlir/include) | ||
|
|
||
| # GCC, unlike clang, issues a warning when one virtual function is overridden | ||
| # in a derived class but one or more other virtual functions with the same | ||
| # name and different signature from a base class are not overridden. This | ||
| # leads to many warnings in the MLIR and ClangIR code when using the | ||
| # OpenConversionPattern<>::matchAndRewrite() function in the ordinary way. | ||
| # The "hiding" behavior is what we want, so we're just disabling the warning | ||
| # here. | ||
| if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overloaded-virtual") | ||
| endif() | ||
|
|
||
| add_clang_tool(cir-host-device-bundle | ||
| cir-host-device-bundle.cpp | ||
| ) | ||
|
|
||
| clang_target_link_libraries(cir-host-device-bundle | ||
| PRIVATE | ||
| clangCIR | ||
| clangCIRLoweringDirectToLLVM | ||
| MLIRCIR | ||
| MLIRCIRTransforms | ||
| ) | ||
|
|
||
| target_link_libraries(cir-host-device-bundle | ||
| PRIVATE | ||
| ${dialect_libs} | ||
| ${conversion_libs} | ||
| MLIRAnalysis | ||
| MLIRDialect | ||
| MLIRIR | ||
| MLIRMemRefDialect | ||
| MLIROptLib | ||
| MLIRParser | ||
| MLIRPass | ||
| MLIRRegisterAllPasses | ||
| MLIRSideEffectInterfaces | ||
| MLIRTransforms | ||
| MLIRTransformUtils | ||
| ) |
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.
ClangIRHostInput and ClangIRDeviceInput would better follow the naming pattern