[clang] b0e4897 - [OpenCL] Remove arm-integer-dot-product extension pragmas

Sven van Haastregt via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 05:27:04 PST 2022


Author: Sven van Haastregt
Date: 2022-11-29T13:26:50Z
New Revision: b0e4897a1bd2ea5eeeb8c104e32df1402a397ac1

URL: https://github.com/llvm/llvm-project/commit/b0e4897a1bd2ea5eeeb8c104e32df1402a397ac1
DIFF: https://github.com/llvm/llvm-project/commit/b0e4897a1bd2ea5eeeb8c104e32df1402a397ac1.diff

LOG: [OpenCL] Remove arm-integer-dot-product extension pragmas

This extension only adds builtin functions and thus doesn't need to be
included as an extension.  Instead of a pragma, the builtin functions
of the extension can be exposed through enabling preprocessor defines.

Added: 
    

Modified: 
    clang/include/clang/Basic/OpenCLExtensions.def
    clang/test/CodeGenOpenCL/arm-integer-dot-product.cl

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def
index a053a0e9adb5..70b4f15a95a7 100644
--- a/clang/include/clang/Basic/OpenCLExtensions.def
+++ b/clang/include/clang/Basic/OpenCLExtensions.def
@@ -94,12 +94,6 @@ OPENCL_EXTENSION(__cl_clang_bitfields, true, 100)
 OPENCL_EXTENSION(cl_amd_media_ops, true, 100)
 OPENCL_EXTENSION(cl_amd_media_ops2, true, 100)
 
-// ARM OpenCL extensions
-OPENCL_EXTENSION(cl_arm_integer_dot_product_int8, true, 120)
-OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_int8, true, 120)
-OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_int16, true, 120)
-OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_saturate_int8, true, 120)
-
 // Intel OpenCL extensions
 OPENCL_EXTENSION(cl_intel_subgroups, true, 120)
 OPENCL_EXTENSION(cl_intel_subgroups_short, true, 120)

diff  --git a/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl b/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
index c98615c5dd98..e3172f28afd7 100644
--- a/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
+++ b/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
@@ -1,6 +1,12 @@
 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -finclude-default-header -fdeclare-opencl-builtins -cl-std=CL1.2 -emit-llvm -o - -O0 | FileCheck %s
 
 // Pragmas are only accepted for backward compatibility.
+// The builtins are made available with the following defines.
+
+#define cl_arm_integer_dot_product_int8 1
+#define cl_arm_integer_dot_product_accumulate_int8 1
+#define cl_arm_integer_dot_product_accumulate_int16 1
+#define cl_arm_integer_dot_product_accumulate_saturate_int8 1
 
 #pragma OPENCL EXTENSION cl_arm_integer_dot_product_int8 : enable
 #pragma OPENCL EXTENSION cl_arm_integer_dot_product_int8 : disable


        


More information about the cfe-commits mailing list