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

Sven van Haastregt via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 01:23:02 PST 2024


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

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

>From a7375b651a2ec392e0edf4cbe3658981f56ea67a Mon Sep 17 00:00:00 2001
From: Sven van Haastregt <sven.vanhaastregt at arm.com>
Date: Wed, 28 Feb 2024 08:37:22 +0000
Subject: [PATCH] [OpenCL] Fix BIenqueue_kernel fallthrough

Handling of the `BIenqueue_kernel` builtin must not fallthrough to
the `BIget_kernel_work_group_size` builtin, as these builtins have
no common functionality.
---
 clang/lib/CodeGen/CGBuiltin.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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.



More information about the cfe-commits mailing list