Skip to content

[SYCL][NewOffloadModel] Add ESIMD Procesing to clang-linker-wrapper.#21449

Open
maksimsab wants to merge 1 commit intointel:syclfrom
maksimsab:add_esimd_to_clang_linker_wrapper
Open

[SYCL][NewOffloadModel] Add ESIMD Procesing to clang-linker-wrapper.#21449
maksimsab wants to merge 1 commit intointel:syclfrom
maksimsab:add_esimd_to_clang_linker_wrapper

Conversation

@maksimsab
Copy link
Contributor

@maksimsab maksimsab commented Mar 5, 2026

This patch add getSYCLPostLinkSettings function in clang-linker-wrapper
which constructs Settings for SYCLPostLink library. Also, this patch adds
an invocation of ESIMD processing in SYCLPostLink library.

@maksimsab maksimsab force-pushed the add_esimd_to_clang_linker_wrapper branch from 91961ee to 75e21a3 Compare March 10, 2026 13:16
Settings.GenerateModuleDescWithDefaultSpecConsts = true;

Settings.SplitMode = Settings.ESIMDOptions.SplitMode = *SYCLModuleSplitMode;
// TODO: fill AllowDeviceImageDependencies, ESIMDOptions.OptLevel and
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is left like this because it is more convenient to do when it is moved to clang-sycl-linker.

This patch add getSYCLPostLinkSettings function in clang-linker-wrapper
which constructs Settings for SYCLPostLink library. Also, this patch adds
an invocation of ESIMD processing in SYCLPostLink library.
@maksimsab maksimsab force-pushed the add_esimd_to_clang_linker_wrapper branch from 75e21a3 to ff5f294 Compare March 10, 2026 13:31
@maksimsab maksimsab marked this pull request as ready for review March 10, 2026 13:31
@maksimsab maksimsab requested review from a team as code owners March 10, 2026 13:31
Comment on lines +674 to +678
/// This function analyzes command line arguments and target triple information
/// to determine the appropriate settings for the SYCL post-link phase. The
/// settings control various aspects of device code processing including
/// specialization constants handling, kernel entry point emission, metadata
/// generation, and ESIMD code splitting.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - unnecessary words

Suggested change
/// This function analyzes command line arguments and target triple information
/// to determine the appropriate settings for the SYCL post-link phase. The
/// settings control various aspects of device code processing including
/// specialization constants handling, kernel entry point emission, metadata
/// generation, and ESIMD code splitting.
/// This function analyzes command line arguments and target triple
/// to determine settings for the SYCL post-link phase. The
/// settings control various aspects of device code processing including
/// specialization constants handling, kernel entry point emission, metadata
/// generation, and ESIMD code splitting.


if (!Triple.isAMDGCN())
Settings.EmitParamInfo = true;
// Enable program metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: unnecessary comment

Suggested change
// Enable program metadata

if (Triple.isNVPTX() || Triple.isAMDGCN() || Triple.isNativeCPU())
Settings.EmitProgramMetadata = true;

// Emit kernel names if we are producing SYCLBIN.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: unnecessary comment just repeating the code

Suggested change
// Emit kernel names if we are producing SYCLBIN.

if (Args.hasArg(OPT_syclbin_EQ))
Settings.EmitKernelNames = true;
// Specialization constant info generation is mandatory -
// add options unconditionally
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
// add options unconditionally
// add options unconditionally.

Comment on lines +722 to +726
bool SplitEsimd =
Args.hasFlag(OPT_sycl_device_code_split_esimd,
OPT_no_sycl_device_code_split_esimd, SplitEsimdByDefault);
if (SplitEsimd)
Settings.ESIMDOptions.SplitESIMD = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. SplitEsimd is not used anywhere else. and Settings.ESIMDOptions.SplitESIMD is clear enough, so no need to create temporary SplitEsimd

Suggested change
bool SplitEsimd =
Args.hasFlag(OPT_sycl_device_code_split_esimd,
OPT_no_sycl_device_code_split_esimd, SplitEsimdByDefault);
if (SplitEsimd)
Settings.ESIMDOptions.SplitESIMD = true;
Settings.ESIMDOptions.SplitESIMD = Args.hasFlag(OPT_sycl_device_code_split_esimd,
OPT_no_sycl_device_code_split_esimd, SplitEsimdByDefault);

if (SplitEsimd)
Settings.ESIMDOptions.SplitESIMD = true;

Settings.ESIMDOptions.LowerESIMD = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: here comment would be useful to explain why LowerESIMD setting is set to true unconditionally.

Copy link
Contributor

@YuriPlyakhin YuriPlyakhin left a comment

Choose a reason for hiding this comment

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

LGTM. several nits.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants