[clang] 8fcb114 - [OpenCL] Fix mipmap read_image return types

Sven van Haastregt via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 8 01:52:10 PDT 2021


Author: Sven van Haastregt
Date: 2021-04-08T09:51:44+01:00
New Revision: 8fcb114d002bf7cd61309af80b26af68389944d0

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

LOG: [OpenCL] Fix mipmap read_image return types

The return type did not match the function name.

Added: 
    

Modified: 
    clang/lib/Sema/OpenCLBuiltins.td

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/OpenCLBuiltins.td b/clang/lib/Sema/OpenCLBuiltins.td
index 2ea70ae3234d9..03235985ab42f 100644
--- a/clang/lib/Sema/OpenCLBuiltins.td
+++ b/clang/lib/Sema/OpenCLBuiltins.td
@@ -1444,11 +1444,11 @@ let Extension = FuncExtKhrMipmapImage in {
       }
       foreach name = ["read_imagei"] in {
         def : Builtin<name, [VectorType<Int, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, VectorType<Float, 4>, VectorType<Float, 4>], Attr.Pure>;
-        def : Builtin<name, [VectorType<Float, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, Float], Attr.Pure>;
+        def : Builtin<name, [VectorType<Int, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, Float], Attr.Pure>;
       }
       foreach name = ["read_imageui"] in {
         def : Builtin<name, [VectorType<UInt, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, VectorType<Float, 4>, VectorType<Float, 4>], Attr.Pure>;
-        def : Builtin<name, [VectorType<Float, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, Float], Attr.Pure>;
+        def : Builtin<name, [VectorType<UInt, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, Float], Attr.Pure>;
       }
     }
     foreach imgTy = [Image1dArray] in {
@@ -1481,8 +1481,8 @@ let Extension = FuncExtKhrMipmapImage in {
     }
     foreach imgTy = [Image2dArrayDepth] in {
       foreach name = ["read_imagef"] in {
-        def : Builtin<name, [VectorType<UInt, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, Float], Attr.Pure>;
-        def : Builtin<name, [VectorType<UInt, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, VectorType<Float, 2>, VectorType<Float, 2>], Attr.Pure>;
+        def : Builtin<name, [Float, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, Float], Attr.Pure>;
+        def : Builtin<name, [Float, ImageType<imgTy, aQual>, Sampler, VectorType<Float, 4>, VectorType<Float, 2>, VectorType<Float, 2>], Attr.Pure>;
       }
     }
   }


        


More information about the cfe-commits mailing list