Skip to content

[SYCL] Refactor sycl-post-link saveModule to improve code structure#21674

Open
maksimsab wants to merge 3 commits intointel:syclfrom
maksimsab:refactor_sycl_post_link_presave
Open

[SYCL] Refactor sycl-post-link saveModule to improve code structure#21674
maksimsab wants to merge 3 commits intointel:syclfrom
maksimsab:refactor_sycl_post_link_presave

Conversation

@maksimsab
Copy link
Copy Markdown
Contributor

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.

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>
@maksimsab maksimsab requested a review from a team as a code owner April 1, 2026 17:30
@maksimsab maksimsab added the new-offload-model Enables testing with NewOffloadModel. label Apr 1, 2026
@maksimsab maksimsab requested a review from a team as a code owner April 1, 2026 22:34
BaseTriple.Ir =
(OutputPrefix + Suffix + "_" + Twine(I) + IRExtension).str();
BaseTriple.Ir = (OutputPrefix + Suffix + IRExtension).str();
ExitOnErr(saveModuleIR(MD.getModule(), BaseTriple.Ir));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also be returning the error here for consistency?

Copy link
Copy Markdown
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok with me minus some nits

const IrPropSymFilenameTriple &RowData);

void prepareModuleBeforeSave(module_split::ModuleDesc &MD, bool Cleanup,
bool AllowDeviceImageDependencies = false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should rename the Cleanup var to RunCleanup or something?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

@intel/llvm-gatekeepers please consider merging

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

@intel/llvm-gatekeepers please consider merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-offload-model Enables testing with NewOffloadModel.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants