blob: c3bdf06b1447ed1c0e0f0358b002382642bcf084 [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib %s | FileCheck %s
; Make sure we can produce a valid FunctionType for the expected
; signature of image functions.
define i32 @test_get_image_width_ro_image1d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_ro_image1d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image1d_ro(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image1d_ro(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image1d_ro(ptr addrspace(4)) #1
define i32 @test_get_image_width_wo_image1d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_wo_image1d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image1d_wo(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image1d_wo(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image1d_wo(ptr addrspace(4)) #1
define i32 @test_get_image_width_rw_image1d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_rw_image1d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image1d_rw(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image1d_rw(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image1d_rw(ptr addrspace(4)) #1
define i32 @test_get_image_width_ro_image1d_buffer_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_ro_image1d_buffer_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_ro(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_ro(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width21ocl_image1d_buffer_ro(ptr addrspace(4)) #1
define i32 @test_get_image_width_wo_image1d_buffer_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_wo_image1d_buffer_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_wo(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_wo(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width21ocl_image1d_buffer_wo(ptr addrspace(4)) #1
define i32 @test_get_image_width_rw_image1d_buffer_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_rw_image1d_buffer_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_rw(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_rw(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width21ocl_image1d_buffer_rw(ptr addrspace(4)) #1
define i32 @test_get_image_width_ro_image2d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_ro_image2d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image2d_ro(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image2d_ro(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image2d_ro(ptr addrspace(4)) #1
define i32 @test_get_image_width_wo_image2d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_wo_image2d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image2d_wo(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image2d_wo(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image2d_wo(ptr addrspace(4)) #1
define i32 @test_get_image_width_rw_image2d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_rw_image2d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image2d_rw(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image2d_rw(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image2d_rw(ptr addrspace(4)) #1
define i32 @test_get_image_width_ro_image3d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_ro_image3d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image3d_ro(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image3d_ro(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image3d_ro(ptr addrspace(4)) #1
define i32 @test_get_image_width_wo_image3d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_wo_image3d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image3d_wo(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image3d_wo(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image3d_wo(ptr addrspace(4)) #1
define i32 @test_get_image_width_rw_image3d_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_rw_image3d_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image3d_rw(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width14ocl_image3d_rw(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width14ocl_image3d_rw(ptr addrspace(4)) #1
define i32 @test_get_image_width_ro_image1d_array_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_ro_image1d_array_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image1d_array_ro(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image1d_array_ro(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image1d_array_ro(ptr addrspace(4)) #1
define i32 @test_get_image_width_wo_image1d_array_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_wo_image1d_array_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image1d_array_wo(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image1d_array_wo(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image1d_array_wo(ptr addrspace(4)) #1
define i32 @test_get_image_width_rw_image1d_array_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_rw_image1d_array_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image1d_array_rw(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image1d_array_rw(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image1d_array_rw(ptr addrspace(4)) #1
define i32 @test_get_image_width_ro_image2d_array_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_ro_image2d_array_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_array_ro(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image2d_array_ro(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image2d_array_ro(ptr addrspace(4)) #1
define i32 @test_get_image_width_wo_image2d_array_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_wo_image2d_array_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_array_wo(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image2d_array_wo(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image2d_array_wo(ptr addrspace(4)) #1
define i32 @test_get_image_width_rw_image2d_array_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_rw_image2d_array_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_array_rw(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image2d_array_rw(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image2d_array_rw(ptr addrspace(4)) #1
define i32 @test_get_image_width_ro_image2d_depth_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_ro_image2d_depth_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_depth_ro(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image2d_depth_ro(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image2d_depth_ro(ptr addrspace(4)) #1
define i32 @test_get_image_width_wo_image2d_depth_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_wo_image2d_depth_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_depth_wo(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image2d_depth_wo(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image2d_depth_wo(ptr addrspace(4)) #1
define i32 @test_get_image_width_rw_image2d_depth_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_rw_image2d_depth_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_depth_rw(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width20ocl_image2d_depth_rw(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width20ocl_image2d_depth_rw(ptr addrspace(4)) #1
define i32 @test_get_image_width_ro_image2d_array_depth_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_ro_image2d_array_depth_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_ro(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_ro(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width26ocl_image2d_array_depth_ro(ptr addrspace(4)) #1
define i32 @test_get_image_width_wo_image2d_array_depth_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_wo_image2d_array_depth_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_wo(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_wo(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width26ocl_image2d_array_depth_wo(ptr addrspace(4)) #1
define i32 @test_get_image_width_rw_image2d_array_depth_t(ptr addrspace(4) readnone %img) {
; CHECK-LABEL: define i32 @test_get_image_width_rw_image2d_array_depth_t(
; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_rw(ptr addrspace(4) [[IMG]])
; CHECK-NEXT: ret i32 [[CALL]]
;
entry:
%call = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_rw(ptr addrspace(4) %img)
ret i32 %call
}
declare i32 @_Z15get_image_width26ocl_image2d_array_depth_rw(ptr addrspace(4)) #1