1 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 -disable-nvptx-favor-non-generic | FileCheck %s -check-prefix=PTX32
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -disable-nvptx-favor-non-generic | FileCheck %s -check-prefix=PTX64
5 define i32 @conv1(i32 addrspace(1)* %ptr) {
7 ; PTX32: cvta.global.u32
10 ; PTX64: cvta.global.u64
12 %genptr = addrspacecast i32 addrspace(1)* %ptr to i32*
13 %val = load i32, i32* %genptr
17 define i32 @conv2(i32 addrspace(3)* %ptr) {
19 ; PTX32: cvta.shared.u32
22 ; PTX64: cvta.shared.u64
24 %genptr = addrspacecast i32 addrspace(3)* %ptr to i32*
25 %val = load i32, i32* %genptr
29 define i32 @conv3(i32 addrspace(4)* %ptr) {
31 ; PTX32: cvta.const.u32
34 ; PTX64: cvta.const.u64
36 %genptr = addrspacecast i32 addrspace(4)* %ptr to i32*
37 %val = load i32, i32* %genptr
41 define i32 @conv4(i32 addrspace(5)* %ptr) {
43 ; PTX32: cvta.local.u32
46 ; PTX64: cvta.local.u64
48 %genptr = addrspacecast i32 addrspace(5)* %ptr to i32*
49 %val = load i32, i32* %genptr
53 define i32 @conv5(i32* %ptr) {
55 ; PTX32: cvta.to.global.u32
56 ; PTX32: ld.global.u32
58 ; PTX64: cvta.to.global.u64
59 ; PTX64: ld.global.u32
60 %specptr = addrspacecast i32* %ptr to i32 addrspace(1)*
61 %val = load i32, i32 addrspace(1)* %specptr
65 define i32 @conv6(i32* %ptr) {
67 ; PTX32: cvta.to.shared.u32
68 ; PTX32: ld.shared.u32
70 ; PTX64: cvta.to.shared.u64
71 ; PTX64: ld.shared.u32
72 %specptr = addrspacecast i32* %ptr to i32 addrspace(3)*
73 %val = load i32, i32 addrspace(3)* %specptr
77 define i32 @conv7(i32* %ptr) {
79 ; PTX32: cvta.to.const.u32
82 ; PTX64: cvta.to.const.u64
84 %specptr = addrspacecast i32* %ptr to i32 addrspace(4)*
85 %val = load i32, i32 addrspace(4)* %specptr
89 define i32 @conv8(i32* %ptr) {
91 ; PTX32: cvta.to.local.u32
94 ; PTX64: cvta.to.local.u64
96 %specptr = addrspacecast i32* %ptr to i32 addrspace(5)*
97 %val = load i32, i32 addrspace(5)* %specptr