-
Notifications
You must be signed in to change notification settings - Fork 787
[Driver][SYCL] Enable multi-file for AOT #3609
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
358bb2d
[Driver][SYCL] Enable multi-file for AOT
mdtoguchi ab0895f
clang format
mdtoguchi 30d69ee
Update test for Windows
mdtoguchi f187d5c
Another test adjustment
mdtoguchi e49f612
Merge remote-tracking branch 'otcshare_llvm/sycl' into device-code-sp…
mdtoguchi ef447a3
Update flow picture in source
mdtoguchi 7031c01
Update device link and wrap image to reflect removal of single file path
mdtoguchi c95634a
Merge remote-tracking branch 'otcshare_llvm/sycl' into device-code-sp…
mdtoguchi 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3785,9 +3785,6 @@ class OffloadingActionBuilder final { | |
/// Flag to signal if the user requested device code split. | ||
bool DeviceCodeSplit = false; | ||
|
||
/// Flag to signal if DAE optimization is turned on. | ||
bool EnableDAE = false; | ||
|
||
/// The SYCL actions for the current input. | ||
ActionList SYCLDeviceActions; | ||
|
||
|
@@ -4278,33 +4275,33 @@ class OffloadingActionBuilder final { | |
// .--------------------------------------. | ||
// | PostLink | | ||
// .--------------------------------------. | ||
// [.n] [.!na!s] [+*] [+*] | ||
// | | | | | ||
// | | .----------------. | | ||
// | | |FileTableTform | | | ||
// | | |(extract "Code")| | | ||
// | | .----------------. | | ||
// | | [-] | | ||
// | | | | | ||
// | [.a!s] [-*] | | ||
// .-------------. .---------------------. | | ||
// |finalizeNVPTX| | SPIRVTranslator | | | ||
// .-------------. .---------------------. | | ||
// | [.a!s] [-as] [-!a] | | ||
// | | | | | | ||
// | [.!s] [-s] | | | ||
// | .----------------. | | | ||
// | | BackendCompile | | | | ||
// | .----------------. | | | ||
// | [.!s] [-s] | | | ||
// | | | | | | ||
// | | [-a] [-!a] [+] | ||
// | | .----------------. | ||
// | | |FileTableTform | | ||
// | | |(replace "Code")| | ||
// | | .----------------. | ||
// | | | | ||
// [.n] [.!na!s] [+*] | ||
// [.n] [+*] [+*] | ||
// | | | | ||
// | .-----------------. | | ||
// | | FileTableTform | | | ||
// | | (extract "Code")| | | ||
// | .-----------------. | | ||
// | [-] | | ||
// | | | | ||
// | [-*] | | ||
// .-------------. .-------------------. | | ||
// |finalizeNVPTX| | SPIRVTranslator | | | ||
// .-------------. .-------------------. | | ||
// | [-as] [-!a] | | ||
// | | | | | ||
// | [-s] | | | ||
// | .----------------. | | | ||
// | | BackendCompile | | | | ||
// | .----------------. | | | ||
// | [-s] | | | ||
// | | | | | ||
// | [-a] [-!a] [+] | ||
// | .--------------------. | ||
// | | FileTableTform | | ||
// | | (replace "Code") | | ||
// | .--------------------. | ||
// | | | ||
// [.n] [+*] | ||
// .--------------------------------------. | ||
// | OffloadWrapper | | ||
// .--------------------------------------. | ||
|
@@ -4351,10 +4348,8 @@ class OffloadingActionBuilder final { | |
ActionList WrapperInputs; | ||
// post link is not optional - even if not splitting, always need to | ||
// process specialization constants | ||
bool MultiFileActionDeps = !isSpirvAOT || DeviceCodeSplit || EnableDAE; | ||
types::ID PostLinkOutType = isNVPTX || !MultiFileActionDeps | ||
? types::TY_LLVM_BC | ||
: types::TY_Tempfiletable; | ||
types::ID PostLinkOutType = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please update the picture and the doc |
||
isNVPTX ? types::TY_LLVM_BC : types::TY_Tempfiletable; | ||
auto *PostLinkAction = C.MakeAction<SYCLPostLinkJobAction>( | ||
FullDeviceLinkAction, PostLinkOutType); | ||
PostLinkAction->setRTSetsSpecConstants(!isAOT); | ||
|
@@ -4366,21 +4361,14 @@ class OffloadingActionBuilder final { | |
} else { | ||
// For SPIRV-based targets - translate to SPIRV then optionally | ||
// compile ahead-of-time to native architecture | ||
Action *SPIRVInput = PostLinkAction; | ||
constexpr char COL_CODE[] = "Code"; | ||
|
||
if (MultiFileActionDeps) { | ||
auto *ExtractIRFilesAction = C.MakeAction<FileTableTformJobAction>( | ||
PostLinkAction, types::TY_Tempfilelist); | ||
// single column w/o title fits TY_Tempfilelist format | ||
ExtractIRFilesAction->addExtractColumnTform(COL_CODE, | ||
false /*drop titles*/); | ||
SPIRVInput = ExtractIRFilesAction; | ||
} | ||
types::ID SPIRVOutType = | ||
MultiFileActionDeps ? types::TY_Tempfilelist : types::TY_SPIRV; | ||
Action *BuildCodeAction = | ||
C.MakeAction<SPIRVTranslatorJobAction>(SPIRVInput, SPIRVOutType); | ||
auto *ExtractIRFilesAction = C.MakeAction<FileTableTformJobAction>( | ||
PostLinkAction, types::TY_Tempfilelist); | ||
// single column w/o title fits TY_Tempfilelist format | ||
ExtractIRFilesAction->addExtractColumnTform(COL_CODE, | ||
false /*drop titles*/); | ||
Action *BuildCodeAction = C.MakeAction<SPIRVTranslatorJobAction>( | ||
ExtractIRFilesAction, types::TY_Tempfilelist); | ||
|
||
// After the Link, wrap the files before the final host link | ||
if (isSpirvAOT) { | ||
|
@@ -4412,14 +4400,11 @@ class OffloadingActionBuilder final { | |
BuildCodeAction = | ||
C.MakeAction<BackendCompileJobAction>(BEInputs, OutType); | ||
} | ||
if (MultiFileActionDeps) { | ||
ActionList TformInputs{PostLinkAction, BuildCodeAction}; | ||
auto *ReplaceFilesAction = C.MakeAction<FileTableTformJobAction>( | ||
TformInputs, types::TY_Tempfiletable); | ||
ReplaceFilesAction->addReplaceColumnTform(COL_CODE, COL_CODE); | ||
BuildCodeAction = ReplaceFilesAction; | ||
} | ||
WrapperInputs.push_back(BuildCodeAction); | ||
ActionList TformInputs{PostLinkAction, BuildCodeAction}; | ||
auto *ReplaceFilesAction = C.MakeAction<FileTableTformJobAction>( | ||
TformInputs, types::TY_Tempfiletable); | ||
ReplaceFilesAction->addReplaceColumnTform(COL_CODE, COL_CODE); | ||
WrapperInputs.push_back(ReplaceFilesAction); | ||
} | ||
// After the Link, wrap the files before the final host link | ||
auto *DeviceWrappingAction = C.MakeAction<OffloadWrapperJobAction>( | ||
|
@@ -4523,9 +4508,6 @@ class OffloadingActionBuilder final { | |
WrapDeviceOnlyBinary = Args.hasArg(options::OPT_fsycl_link_EQ); | ||
auto *DeviceCodeSplitArg = | ||
Args.getLastArg(options::OPT_fsycl_device_code_split_EQ); | ||
EnableDAE = | ||
Args.hasFlag(options::OPT_fsycl_dead_args_optimization, | ||
options::OPT_fno_sycl_dead_args_optimization, false); | ||
// -fsycl-device-code-split is an alias to | ||
// -fsycl-device-code-split=per_source | ||
DeviceCodeSplit = DeviceCodeSplitArg && | ||
|
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
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.
Uh oh!
There was an error while loading. Please reload this page.