[clang] [CIR] Convert i1 intrinsic results for bool-returning builtins (PR #220576)
Steffen Larsen via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 2 22:13:50 PDT 2026
================
@@ -0,0 +1,21 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fclangir -fcuda-is-device \
+// RUN: -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device -emit-llvm %s \
+// RUN: -o - | FileCheck %s
+
+// Checks that builtins returning an i1 can be used as bool results implicitly.
+
+#define __device__ __attribute__((device))
+
+// CHECK-LABEL: @_Z2shPv
+// CHECK: call i1 @llvm.amdgcn.is.shared(ptr
+__device__ bool sh(void *p) { return __builtin_amdgcn_is_shared(p); }
+
+// CHECK-LABEL: @_Z3usePv
+// CHECK: call i1 @llvm.amdgcn.is.shared(ptr
----------------
steffenlarsen wrote:
Good shout. Cases added.
https://github.com/llvm/llvm-project/pull/220576
More information about the cfe-commits
mailing list