| 1 |
;;===----------------------------------------------------------------------===;; |
| 2 |
; |
| 3 |
; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
; See https://llvm.org/LICENSE.txt for license information. |
| 5 |
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
; |
| 7 |
;;===----------------------------------------------------------------------===;; |
| 8 |
|
| 9 |
%opencl.image2d_t = type opaque |
| 10 |
%opencl.image3d_t = type opaque |
| 11 |
|
| 12 |
declare i32 @llvm.OpenCL.image.get.resource.id.2d( |
| 13 |
%opencl.image2d_t addrspace(1)*) nounwind readnone |
| 14 |
declare i32 @llvm.OpenCL.image.get.resource.id.3d( |
| 15 |
%opencl.image3d_t addrspace(1)*) nounwind readnone |
| 16 |
|
| 17 |
declare [3 x i32] @llvm.OpenCL.image.get.size.2d( |
| 18 |
%opencl.image2d_t addrspace(1)*) nounwind readnone |
| 19 |
declare [3 x i32] @llvm.OpenCL.image.get.size.3d( |
| 20 |
%opencl.image3d_t addrspace(1)*) nounwind readnone |
| 21 |
|
| 22 |
declare [2 x i32] @llvm.OpenCL.image.get.format.2d( |
| 23 |
%opencl.image2d_t addrspace(1)*) nounwind readnone |
| 24 |
declare [2 x i32] @llvm.OpenCL.image.get.format.3d( |
| 25 |
%opencl.image3d_t addrspace(1)*) nounwind readnone |
| 26 |
|
| 27 |
define i32 @__clc_get_image_width_2d( |
| 28 |
%opencl.image2d_t addrspace(1)* nocapture %img) #0 { |
| 29 |
%1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.2d( |
| 30 |
%opencl.image2d_t addrspace(1)* %img) |
| 31 |
%2 = extractvalue [3 x i32] %1, 0 |
| 32 |
ret i32 %2 |
| 33 |
} |
| 34 |
define i32 @__clc_get_image_width_3d( |
| 35 |
%opencl.image3d_t addrspace(1)* nocapture %img) #0 { |
| 36 |
%1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.3d( |
| 37 |
%opencl.image3d_t addrspace(1)* %img) |
| 38 |
%2 = extractvalue [3 x i32] %1, 0 |
| 39 |
ret i32 %2 |
| 40 |
} |
| 41 |
|
| 42 |
define i32 @__clc_get_image_height_2d( |
| 43 |
%opencl.image2d_t addrspace(1)* nocapture %img) #0 { |
| 44 |
%1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.2d( |
| 45 |
%opencl.image2d_t addrspace(1)* %img) |
| 46 |
%2 = extractvalue [3 x i32] %1, 1 |
| 47 |
ret i32 %2 |
| 48 |
} |
| 49 |
define i32 @__clc_get_image_height_3d( |
| 50 |
%opencl.image3d_t addrspace(1)* nocapture %img) #0 { |
| 51 |
%1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.3d( |
| 52 |
%opencl.image3d_t addrspace(1)* %img) |
| 53 |
%2 = extractvalue [3 x i32] %1, 1 |
| 54 |
ret i32 %2 |
| 55 |
} |
| 56 |
|
| 57 |
define i32 @__clc_get_image_depth_3d( |
| 58 |
%opencl.image3d_t addrspace(1)* nocapture %img) #0 { |
| 59 |
%1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.3d( |
| 60 |
%opencl.image3d_t addrspace(1)* %img) |
| 61 |
%2 = extractvalue [3 x i32] %1, 2 |
| 62 |
ret i32 %2 |
| 63 |
} |
| 64 |
|
| 65 |
define i32 @__clc_get_image_channel_data_type_2d( |
| 66 |
%opencl.image2d_t addrspace(1)* nocapture %img) #0 { |
| 67 |
%1 = tail call [2 x i32] @llvm.OpenCL.image.get.format.2d( |
| 68 |
%opencl.image2d_t addrspace(1)* %img) |
| 69 |
%2 = extractvalue [2 x i32] %1, 0 |
| 70 |
ret i32 %2 |
| 71 |
} |
| 72 |
define i32 @__clc_get_image_channel_data_type_3d( |
| 73 |
%opencl.image3d_t addrspace(1)* nocapture %img) #0 { |
| 74 |
%1 = tail call [2 x i32] @llvm.OpenCL.image.get.format.3d( |
| 75 |
%opencl.image3d_t addrspace(1)* %img) |
| 76 |
%2 = extractvalue [2 x i32] %1, 0 |
| 77 |
ret i32 %2 |
| 78 |
} |
| 79 |
|
| 80 |
define i32 @__clc_get_image_channel_order_2d( |
| 81 |
%opencl.image2d_t addrspace(1)* nocapture %img) #0 { |
| 82 |
%1 = tail call [2 x i32] @llvm.OpenCL.image.get.format.2d( |
| 83 |
%opencl.image2d_t addrspace(1)* %img) |
| 84 |
%2 = extractvalue [2 x i32] %1, 1 |
| 85 |
ret i32 %2 |
| 86 |
} |
| 87 |
define i32 @__clc_get_image_channel_order_3d( |
| 88 |
%opencl.image3d_t addrspace(1)* nocapture %img) #0 { |
| 89 |
%1 = tail call [2 x i32] @llvm.OpenCL.image.get.format.3d( |
| 90 |
%opencl.image3d_t addrspace(1)* %img) |
| 91 |
%2 = extractvalue [2 x i32] %1, 1 |
| 92 |
ret i32 %2 |
| 93 |
} |
| 94 |
|
| 95 |
attributes #0 = { nounwind readnone alwaysinline } |