Skip to content

Conversation

@asudarsa
Copy link
Contributor

@asudarsa asudarsa commented Mar 5, 2025

A couple of upstream commits were not merged due to merge conflicts.
This PR reintroduces the following upstream commits:

ccd73ee
4a96081
Also, This PR restores missing changes from upstream commit aae059e1389bebe86ceb3aea159d95ca6d0823ea](f2f1a14)

Thanks

jhuber6 and others added 3 commits March 5, 2025 13:35
Summary:
This should be the linker's job if the user creates any bitcode files,
then passing `-flto` to the linker for the toolchain should be able to
handle it. Right now this path is only used in the case where someone
does LTO w/ ld.gold targeting a CPU so I think we are safe here as that
will still be forwarded, for bfd it'll be an error as it would on the
host. I think I talked the SYCL team out of using this as well so I
should be good to delete it.
This patch fixes:

  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:642:6:
  error: unused function 'diagnosticHandler'
  [-Werror,-Wunused-function]
…159d95ca6d0823ea

[LinkerWrapper] Pass all files to the device linker
Summary:
The linker wrapper's job is to extract embedded device code from fat
binaries and create linked images that can then be embedded and
executed. In order to support LTO, we originally reinvented all of the
LTO handling that `ld.lld` normally does. Primarily, this was because
`nvlink` didn't support this at all, and we have special hacks required
for offloading languages interacting with archive libraries.

Now since I wrote #96561 we
should be able to pass all the inputs to the device linker
transparently. This has the advantage of allowing the `clang` Driver to
do its own handling. Primarily, this will be used to implicitly pass
libraries to the device link job to make it more consistent with other
toolchains.

The JIT support is a notable departure, however there is an option
called `--lto-emit-llvm` that performs the exact function where we want
the final link job to output LLVM-IR that we can then embed instead.

This patch does not fully delete the LTO handling, primarily because I
think the SPIR-V people might want it. To see only the relevant patches,
ignore the first commit of the nvlink-wrapper.

Depends on #96561.

Author: Joseph Huber
@bader
Copy link
Contributor

bader commented Mar 5, 2025

@asudarsa, I suggest we merge to sycl-web branch instead of sycl to avoid squashing the commits.

Signed-off-by: Arvind Sudarsanam <[email protected]>
@asudarsa
Copy link
Contributor Author

asudarsa commented Mar 6, 2025

@asudarsa, I suggest we merge to sycl-web branch instead of sycl to avoid squashing the commits.

As we discussed offline, we can merge without squashing here as well. Thanks

@asudarsa
Copy link
Contributor Author

asudarsa commented Mar 6, 2025

Test failure and format issue resolved in latest commit. Thanks

@asudarsa
Copy link
Contributor Author

asudarsa commented Mar 7, 2025

Test failures do not seem to be related to my PR and seems like infrastructure issue. @intel/llvm-gatekeepers, can you please take a look and provide feedback?

Thanks

@asudarsa
Copy link
Contributor Author

Quick ping: @AlexeySachkov and @ldrumm
Can you please take a look when convenient?

Thanks

Copy link
Contributor

@ldrumm ldrumm left a comment

Choose a reason for hiding this comment

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

Apologies for my tardiness in reviewing. This looks good, but please double check the early exit. I don't know enough about this part of the code to know whether that's intended or not

@asudarsa
Copy link
Contributor Author

AMD failure seems like infrastructure issue.
@intel/llvm-gatekeepers
I think this is ready to be merged.

Thanks

@uditagarwal97
Copy link
Contributor

AMD failure seems like infrastructure issue. @intel/llvm-gatekeepers I think this is ready to be merged.

Thanks

Review from @intel/dpcpp-tools-reviewers is missing.

@asudarsa
Copy link
Contributor Author

@maksimsab

Can you please take a look?

Thanks

Copy link
Contributor

@maksimsab maksimsab left a comment

Choose a reason for hiding this comment

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

LGTM.

@asudarsa
Copy link
Contributor Author

Hi @intel/llvm-gatekeepers

This is ready for merge.

Thanks

@sarnex
Copy link
Contributor

sarnex commented Mar 12, 2025

AMD failure seems like infrastructure issue

Not infra issue, just too long delay between build and AMD test run, the artifacts expired

@sarnex sarnex merged commit 21ccf55 into intel:sycl Mar 12, 2025
21 of 22 checks passed
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.

9 participants