[SYCL] Refactor sycl-post-link saveModule to improve code structure#21674
Open
maksimsab wants to merge 3 commits intointel:syclfrom
Open
[SYCL] Refactor sycl-post-link saveModule to improve code structure#21674maksimsab wants to merge 3 commits intointel:syclfrom
maksimsab wants to merge 3 commits intointel:syclfrom
Conversation
Extract prepareModuleBeforeSave() helper and change saveModule() to return Error for better error handling. Move output file index handling to call sites for more flexible function design. Output filenames changed from prefix_esimd_N.ext to prefix_N.esimd.ext as a consequence of the refactoring. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
mdtoguchi
reviewed
Apr 2, 2026
| BaseTriple.Ir = | ||
| (OutputPrefix + Suffix + "_" + Twine(I) + IRExtension).str(); | ||
| BaseTriple.Ir = (OutputPrefix + Suffix + IRExtension).str(); | ||
| ExitOnErr(saveModuleIR(MD.getModule(), BaseTriple.Ir)); |
Contributor
There was a problem hiding this comment.
Should we also be returning the error here for consistency?
sarnex
approved these changes
Apr 3, 2026
Contributor
sarnex
left a comment
There was a problem hiding this comment.
ok with me minus some nits
| const IrPropSymFilenameTriple &RowData); | ||
|
|
||
| void prepareModuleBeforeSave(module_split::ModuleDesc &MD, bool Cleanup, | ||
| bool AllowDeviceImageDependencies = false) { |
Contributor
There was a problem hiding this comment.
can we not use a default argument and force a value, and then at callsites have an inline comment of what the flag value is?
| void addTableRow(util::SimpleTable &Table, | ||
| const IrPropSymFilenameTriple &RowData); | ||
|
|
||
| void prepareModuleBeforeSave(module_split::ModuleDesc &MD, bool Cleanup, |
Contributor
There was a problem hiding this comment.
maybe we should rename the Cleanup var to RunCleanup or something?
Contributor
|
@intel/llvm-gatekeepers please consider merging |
1 similar comment
Contributor
|
@intel/llvm-gatekeepers please consider merging |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Extract prepareModuleBeforeSave() helper and change saveModule() to return Error for better error handling. Move output file index handling to call sites for more flexible function design.
Output filenames changed from prefix_esimd_N.ext to prefix_N.esimd.ext as a consequence of the refactoring.