Skip to content

[OpenCL] Fix BIenqueue_kernel fallthrough #83238

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

Merged
merged 1 commit into from
Apr 2, 2024
Merged

Conversation

svenvh
Copy link
Member

@svenvh svenvh commented Feb 28, 2024

Handling of the BIenqueue_kernel builtin must not fallthrough to the BIget_kernel_work_group_size builtin, as these builtins have no common functionality.

Handling of the `BIenqueue_kernel` builtin must not fallthrough to
the `BIget_kernel_work_group_size` builtin, as these builtins have
no common functionality.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. labels Feb 28, 2024
@llvmbot
Copy link
Member

llvmbot commented Feb 28, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-codegen

Author: Sven van Haastregt (svenvh)

Changes

Handling of the BIenqueue_kernel builtin must not fallthrough to the BIget_kernel_work_group_size builtin, as these builtins have no common functionality.


Full diff: https://github.com/llvm/llvm-project/pull/83238.diff

1 Files Affected:

  • (modified) clang/lib/CodeGen/CGBuiltin.cpp (+1-1)
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 2d16e7cdc06053..7a42174d7ec692 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -5640,7 +5640,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
         EmitLifetimeEnd(TmpSize, TmpPtr);
       return Call;
     }
-    [[fallthrough]];
+    llvm_unreachable("Unexpected enqueue_kernel signature");
   }
   // OpenCL v2.0 s6.13.17.6 - Kernel query functions need bitcast of block
   // parameter.

@svenvh svenvh added the OpenCL label Feb 28, 2024
Copy link
Contributor

@AnastasiaStulova AnastasiaStulova left a comment

Choose a reason for hiding this comment

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

Makes sense, LGTM! Thanks

@svenvh svenvh merged commit e47a81c into llvm:main Apr 2, 2024
@svenvh svenvh deleted the dse-fallthrough branch April 2, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category OpenCL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants