-
Notifications
You must be signed in to change notification settings - Fork 752
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
[SYCL][Fusion] Fix kernel fusion passes tests #7719
Conversation
There was a problem hiding this 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 && |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
Signed-off-by: Lukas Sommer <[email protected]>
e0a191b
to
e2ba7dc
Compare
@intel/llvm-gatekeepers This patch is ready to be merged, could you please merge? |
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]