Skip to content

Conversation

@maksimsab
Copy link
Contributor

@maksimsab maksimsab commented Aug 19, 2024

Add -sycl-spec-const-handling-mode command line option to clang-linker-wrapper.
processSpecConstants is moved from sycl-post-link to lib/SYCLLowerIR/SpecConstants.cpp and invoked from sycl-post-link and splitting library.

@maksimsab maksimsab marked this pull request as ready for review August 20, 2024 15:12
@maksimsab maksimsab requested review from a team as code owners August 20, 2024 15:12
@maksimsab
Copy link
Contributor Author

I need to check how "default_values" mode is handled in clang-linker-wrapper.

Flags<[WrapperOnlyOption]>,
HelpText<"Option that turns on split library with the given split mode">;

def sycl_spec_const_handling_mode_EQ : Joined<["--", "-"], "sycl-spec-const-handling-mode=">,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR!

My understanding of when we should clang-linker-wrapper args is when we need to communicate information from the driver to clang-linker-wrapper, where in most cases that happens for user specified command-line args that effect how clang-linker-wrapper needs to act.

For this case, I'm not sure I see why we need the new flag. I don't see any user visible option for Clang to effect spec consts, only logic to set the -spec-const flag to sycl-post-link, which seems to be a triple-based calculation.

Also in this PR I don't see any changes to the driver to set this new flag.

Could you go into detail on why we need this flag and how we plan to modify the driver to set it?

Thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on @sarnex comment here about the need for this mode.
I see the related code here

bool SpecConstsSupported = (!Triple.isNVPTX() && !Triple.isAMDGCN() &&

and the spec-const mode seems to rely on the target triple and nothing else and hence should be computed inside the clang-linker-wrapper.
@maksimsab please let me know if we are missing something here.

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. It needs to be redesigned.

@github-actions
Copy link
Contributor

This pull request is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 26, 2025
@maksimsab maksimsab closed this Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants