Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][Fusion] Fix kernel fusion passes tests #7719

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

sommerlukas
Copy link
Contributor

Fix tests for kernel fusion passes in static builds by using correct library, loadable by opt, for tests.

Also fixes post-commit feedback from @AlexeySachkov in #7661.

Signed-off-by: Lukas Sommer [email protected]

Copy link
Contributor

@AlexeySachkov AlexeySachkov left a comment

Choose a reason for hiding this comment

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

Thanks!

// Name of the fused kernel.
auto *KernelName = dyn_cast<MDString>(MD->getOperand(0).get());
// First metadata operand should be the fused kernel name.
auto *KernelName = cast<MDString>(MD->getOperand(0).get());
assert(KernelName &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note that this assert isn't needed anymore, because it exists within cast: that one will fail first and we won't see our custom message anyway.

@@ -74,7 +72,7 @@ static Function *createMaskedFunction(const BitVector &Mask, Function *F) {
// Copy metadata.
SmallVector<std::pair<unsigned, MDNode *>> MDs;
F->getAllMetadata(MDs);
for (auto MD : MDs) {
for (auto &MD : MDs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please note that I haven't thoroughly reviewed the rest of for (auto ...) loops (because the patch is quite huge), so there might be similar excessive copies somewhere else

@sommerlukas sommerlukas force-pushed the kernel-fusion/sixth-patch branch from e0a191b to e2ba7dc Compare December 9, 2022 14:01
@sommerlukas
Copy link
Contributor Author

@intel/llvm-gatekeepers This patch is ready to be merged, could you please merge?

@steffenlarsen steffenlarsen merged commit 1b68ffd into intel:sycl Dec 9, 2022
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.

4 participants