[clang] [OpenCL] Fix BIenqueue_kernel fallthrough (PR #83238)

via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 01:23:31 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-codegen

Author: Sven van Haastregt (svenvh)

<details>
<summary>Changes</summary>

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
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.

``````````

</details>


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


More information about the cfe-commits mailing list