2016-05-11 08:28:54 +08:00
|
|
|
; RUN: llc -march=amdgcn -mattr=-promote-alloca,+max-private-element-size-16 -verify-machineinstrs < %s | FileCheck -check-prefix=SI-ALLOCA16 -check-prefix=SI %s
|
|
|
|
; RUN: llc -march=amdgcn -mattr=-promote-alloca,+max-private-element-size-4 -verify-machineinstrs < %s | FileCheck -check-prefix=SI-ALLOCA4 -check-prefix=SI %s
|
2016-04-29 02:38:48 +08:00
|
|
|
; RUN: llc -march=amdgcn -mattr=+promote-alloca -verify-machineinstrs < %s | FileCheck -check-prefix=SI-PROMOTE -check-prefix=SI %s
|
2016-05-27 03:35:29 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-promote-alloca,+max-private-element-size-16 -verify-machineinstrs < %s | FileCheck -check-prefix=CI-ALLOCA16 -check-prefix=SI %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=+promote-alloca -verify-machineinstrs < %s | FileCheck -check-prefix=CI-PROMOTE -check-prefix=SI %s
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2016-05-17 05:19:59 +08:00
|
|
|
declare void @llvm.amdgcn.s.barrier() #0
|
2014-02-02 08:13:12 +08:00
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; SI-LABEL: {{^}}private_access_f64_alloca:
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2016-05-11 08:28:54 +08:00
|
|
|
; SI-ALLOCA16: buffer_store_dwordx2
|
|
|
|
; SI-ALLOCA16: buffer_load_dwordx2
|
|
|
|
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI-PROMOTE: ds_write_b64
|
|
|
|
; SI-PROMOTE: ds_read_b64
|
2016-05-27 03:35:29 +08:00
|
|
|
; CI-PROMOTE: ds_write_b64
|
|
|
|
; CI-PROMOTE: ds_read_b64
|
2016-02-11 14:02:01 +08:00
|
|
|
define void @private_access_f64_alloca(double addrspace(1)* noalias %out, double addrspace(1)* noalias %in, i32 %b) #1 {
|
2015-02-28 05:17:42 +08:00
|
|
|
%val = load double, double addrspace(1)* %in, align 8
|
2016-04-29 02:38:48 +08:00
|
|
|
%array = alloca [16 x double], align 8
|
|
|
|
%ptr = getelementptr inbounds [16 x double], [16 x double]* %array, i32 0, i32 %b
|
2014-02-02 08:13:12 +08:00
|
|
|
store double %val, double* %ptr, align 8
|
2016-02-11 14:02:01 +08:00
|
|
|
call void @llvm.amdgcn.s.barrier()
|
2015-02-28 05:17:42 +08:00
|
|
|
%result = load double, double* %ptr, align 8
|
2014-02-02 08:13:12 +08:00
|
|
|
store double %result, double addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; SI-LABEL: {{^}}private_access_v2f64_alloca:
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2016-05-11 08:28:54 +08:00
|
|
|
; SI-ALLOCA16: buffer_store_dwordx4
|
|
|
|
; SI-ALLOCA16: buffer_load_dwordx4
|
|
|
|
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2015-11-24 20:18:54 +08:00
|
|
|
; SI-PROMOTE: ds_write_b64
|
|
|
|
; SI-PROMOTE: ds_write_b64
|
|
|
|
; SI-PROMOTE: ds_read_b64
|
|
|
|
; SI-PROMOTE: ds_read_b64
|
2016-05-27 03:35:29 +08:00
|
|
|
; CI-PROMOTE: ds_write2_b64
|
|
|
|
; CI-PROMOTE: ds_read2_b64
|
2016-02-11 14:02:01 +08:00
|
|
|
define void @private_access_v2f64_alloca(<2 x double> addrspace(1)* noalias %out, <2 x double> addrspace(1)* noalias %in, i32 %b) #1 {
|
2015-02-28 05:17:42 +08:00
|
|
|
%val = load <2 x double>, <2 x double> addrspace(1)* %in, align 16
|
2016-04-29 02:38:48 +08:00
|
|
|
%array = alloca [8 x <2 x double>], align 16
|
|
|
|
%ptr = getelementptr inbounds [8 x <2 x double>], [8 x <2 x double>]* %array, i32 0, i32 %b
|
2014-02-02 08:13:12 +08:00
|
|
|
store <2 x double> %val, <2 x double>* %ptr, align 16
|
2016-02-11 14:02:01 +08:00
|
|
|
call void @llvm.amdgcn.s.barrier()
|
2015-02-28 05:17:42 +08:00
|
|
|
%result = load <2 x double>, <2 x double>* %ptr, align 16
|
2014-02-02 08:13:12 +08:00
|
|
|
store <2 x double> %result, <2 x double> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
2014-03-25 01:50:46 +08:00
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; SI-LABEL: {{^}}private_access_i64_alloca:
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2016-05-11 08:28:54 +08:00
|
|
|
; SI-ALLOCA16: buffer_store_dwordx2
|
|
|
|
; SI-ALLOCA16: buffer_load_dwordx2
|
|
|
|
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI-PROMOTE: ds_write_b64
|
|
|
|
; SI-PROMOTE: ds_read_b64
|
2016-05-27 03:35:29 +08:00
|
|
|
; CI-PROMOTE: ds_write_b64
|
|
|
|
; CI-PROMOTE: ds_read_b64
|
2016-02-11 14:02:01 +08:00
|
|
|
define void @private_access_i64_alloca(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in, i32 %b) #1 {
|
2015-02-28 05:17:42 +08:00
|
|
|
%val = load i64, i64 addrspace(1)* %in, align 8
|
2016-04-29 02:38:48 +08:00
|
|
|
%array = alloca [8 x i64], align 8
|
|
|
|
%ptr = getelementptr inbounds [8 x i64], [8 x i64]* %array, i32 0, i32 %b
|
2014-03-25 01:50:46 +08:00
|
|
|
store i64 %val, i64* %ptr, align 8
|
2016-02-11 14:02:01 +08:00
|
|
|
call void @llvm.amdgcn.s.barrier()
|
2015-02-28 05:17:42 +08:00
|
|
|
%result = load i64, i64* %ptr, align 8
|
2014-03-25 01:50:46 +08:00
|
|
|
store i64 %result, i64 addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; SI-LABEL: {{^}}private_access_v2i64_alloca:
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2016-05-11 08:28:54 +08:00
|
|
|
; SI-ALLOCA16: buffer_store_dwordx4
|
|
|
|
; SI-ALLOCA16: buffer_load_dwordx4
|
|
|
|
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
; SI-ALLOCA4: buffer_store_dword v
|
|
|
|
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
|
|
|
; SI-ALLOCA4: buffer_load_dword v
|
2014-07-13 10:46:17 +08:00
|
|
|
|
2015-11-24 20:18:54 +08:00
|
|
|
; SI-PROMOTE: ds_write_b64
|
|
|
|
; SI-PROMOTE: ds_write_b64
|
|
|
|
; SI-PROMOTE: ds_read_b64
|
|
|
|
; SI-PROMOTE: ds_read_b64
|
2016-05-27 03:35:29 +08:00
|
|
|
; CI-PROMOTE: ds_write2_b64
|
|
|
|
; CI-PROMOTE: ds_read2_b64
|
2016-02-11 14:02:01 +08:00
|
|
|
define void @private_access_v2i64_alloca(<2 x i64> addrspace(1)* noalias %out, <2 x i64> addrspace(1)* noalias %in, i32 %b) #1 {
|
2015-02-28 05:17:42 +08:00
|
|
|
%val = load <2 x i64>, <2 x i64> addrspace(1)* %in, align 16
|
2016-04-29 02:38:48 +08:00
|
|
|
%array = alloca [8 x <2 x i64>], align 16
|
|
|
|
%ptr = getelementptr inbounds [8 x <2 x i64>], [8 x <2 x i64>]* %array, i32 0, i32 %b
|
2014-03-25 01:50:46 +08:00
|
|
|
store <2 x i64> %val, <2 x i64>* %ptr, align 16
|
2016-02-11 14:02:01 +08:00
|
|
|
call void @llvm.amdgcn.s.barrier()
|
2015-02-28 05:17:42 +08:00
|
|
|
%result = load <2 x i64>, <2 x i64>* %ptr, align 16
|
2014-03-25 01:50:46 +08:00
|
|
|
store <2 x i64> %result, <2 x i64> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
2016-02-11 14:02:01 +08:00
|
|
|
|
2016-05-17 05:19:59 +08:00
|
|
|
attributes #0 = { convergent nounwind }
|
|
|
|
attributes #1 = { nounwind "amdgpu-max-waves-per-eu"="2" "amdgpu-max-work-group-size"="64" }
|