Skip to content

Commit 9d936d6

Browse files
Guzewicz, Kacperigcbot
authored andcommitted
Conversion of IGC LITs for opaque pointer support, batch 26
This commit converts part of LITs so that igc_opt uses "--opaque-pointers" option that allows automatic conversion between typed and opaque pointers. Typed version of tests are still kept in separate files.
1 parent 96e4480 commit 9d936d6

File tree

116 files changed

+5798
-927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+5798
-927
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2022-2024 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; RUN: igc_opt %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
10+
11+
; This test verifies the case where a function which operates on a generic
12+
; pointer is called from two kernels.
13+
14+
; kernelA kernelB
15+
; \ /
16+
; \ /
17+
; f_common
18+
19+
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
20+
21+
define spir_func void @f_common(i32 addrspace(4)* %generic_ptr) {
22+
store i32 5, i32 addrspace(4)* %generic_ptr, align 4
23+
; CHECK: %[[PTI:.*]] = ptrtoint i32 addrspace(4)* %generic_ptr to i64
24+
; CHECK: %[[TAG:.*]] = lshr i64 %1, 61
25+
; switch i64 %[[TAG]], label %GlobalBlock [
26+
; i64 2, label %LocalBlock
27+
; ]
28+
29+
; LocalBlock:
30+
; %[[LOCAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %generic_ptr to i32 addrspace(3)*
31+
; store i32 5, i32 addrspace(3)* %[[LOCAL_PTR]], align 4
32+
33+
; GlobalBlock:
34+
; %[[GLOBAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %generic_ptr to i32 addrspace(1)*
35+
; store i32 5, i32 addrspace(1)* %[[GLOBAL_PTR]], align 4
36+
ret void
37+
}
38+
39+
define spir_kernel void @kernelA(i32 addrspace(1)* %global_buffer) {
40+
%generic_ptr = addrspacecast i32 addrspace(1)* %global_buffer to i32 addrspace(4)*
41+
call spir_func void @f_common(i32 addrspace(4)* %generic_ptr)
42+
ret void
43+
}
44+
45+
define spir_kernel void @kernelB(i32 addrspace(3)* %local_buffer) {
46+
%generic_ptr = addrspacecast i32 addrspace(3)* %local_buffer to i32 addrspace(4)*
47+
call spir_func void @f_common(i32 addrspace(4)* %generic_ptr)
48+
ret void
49+
}
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
;=========================== begin_copyright_notice ============================
22
;
3-
; Copyright (C) 2022 Intel Corporation
3+
; Copyright (C) 2022-2024 Intel Corporation
44
;
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
88

9-
; RUN: igc_opt %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
9+
; REQUIRES: llvm-14-plus
10+
; RUN: igc_opt --opaque-pointers %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
1011

1112
; This test verifies the case where a function which operates on a generic
1213
; pointer is called from two kernels.
@@ -18,32 +19,32 @@
1819

1920
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
2021

21-
define spir_func void @f_common(i32 addrspace(4)* %generic_ptr) {
22-
store i32 5, i32 addrspace(4)* %generic_ptr, align 4
23-
; CHECK: %[[PTI:.*]] = ptrtoint i32 addrspace(4)* %generic_ptr to i64
22+
define spir_func void @f_common(ptr addrspace(4) %generic_ptr) {
23+
store i32 5, ptr addrspace(4) %generic_ptr, align 4
24+
; CHECK: %[[PTI:.*]] = ptrtoint ptr addrspace(4) %generic_ptr to i64
2425
; CHECK: %[[TAG:.*]] = lshr i64 %1, 61
2526
; switch i64 %[[TAG]], label %GlobalBlock [
2627
; i64 2, label %LocalBlock
2728
; ]
2829

2930
; LocalBlock:
30-
; %[[LOCAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %generic_ptr to i32 addrspace(3)*
31-
; store i32 5, i32 addrspace(3)* %[[LOCAL_PTR]], align 4
31+
; %[[LOCAL_PTR:.*]] = addrspacecast ptr addrspace(4) %generic_ptr to ptr addrspace(3)
32+
; store i32 5, ptr addrspace(3) %[[LOCAL_PTR]], align 4
3233

3334
; GlobalBlock:
34-
; %[[GLOBAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %generic_ptr to i32 addrspace(1)*
35-
; store i32 5, i32 addrspace(1)* %[[GLOBAL_PTR]], align 4
35+
; %[[GLOBAL_PTR:.*]] = addrspacecast ptr addrspace(4) %generic_ptr to ptr addrspace(1)
36+
; store i32 5, ptr addrspace(1) %[[GLOBAL_PTR]], align 4
3637
ret void
3738
}
3839

39-
define spir_kernel void @kernelA(i32 addrspace(1)* %global_buffer) {
40-
%generic_ptr = addrspacecast i32 addrspace(1)* %global_buffer to i32 addrspace(4)*
41-
call spir_func void @f_common(i32 addrspace(4)* %generic_ptr)
40+
define spir_kernel void @kernelA(ptr addrspace(1) %global_buffer) {
41+
%generic_ptr = addrspacecast ptr addrspace(1) %global_buffer to ptr addrspace(4)
42+
call spir_func void @f_common(ptr addrspace(4) %generic_ptr)
4243
ret void
4344
}
4445

45-
define spir_kernel void @kernelB(i32 addrspace(3)* %local_buffer) {
46-
%generic_ptr = addrspacecast i32 addrspace(3)* %local_buffer to i32 addrspace(4)*
47-
call spir_func void @f_common(i32 addrspace(4)* %generic_ptr)
46+
define spir_kernel void @kernelB(ptr addrspace(3) %local_buffer) {
47+
%generic_ptr = addrspacecast ptr addrspace(3) %local_buffer to ptr addrspace(4)
48+
call spir_func void @f_common(ptr addrspace(4) %generic_ptr)
4849
ret void
4950
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2022-2024 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; RUN: igc_opt %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
10+
11+
; This test verifies whether cyclic call graph is properly handled by CastToGASAnalysis.
12+
; Here is a call graph for below test:
13+
14+
; kernelA kernelB
15+
; / /
16+
; f0 f2
17+
; / \
18+
; / /
19+
; | /
20+
; f1
21+
22+
; Expecting that call graph analysis will properly lead to optimizing all load and store instructions
23+
; within functions accesible from kernelA, since kernelA uses only global memory.
24+
; Memory operations accesible from kernelB should not be optimized, since it uses both private and
25+
; local memory.
26+
27+
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
28+
29+
; CHECK-LABEL: define spir_func void @f2
30+
define spir_func void @f2(i32 addrspace(4)* %ptr) {
31+
; CHECK: %[[PTI:.*]] = ptrtoint i32 addrspace(4)* %ptr to i64
32+
; CHECK: %[[TAG:.*]] = lshr i64 %1, 61
33+
; CHECK: switch i64 %2, label %GlobalBlock [
34+
; CHECK: i64 2, label %LocalBlock
35+
; CHECK: ]
36+
37+
; CHECK: LocalBlock:
38+
; CHECK: %[[LOCAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(3)*
39+
; CHECK: store i32 123, i32 addrspace(3)* %[[LOCAL_PTR]], align 4
40+
store i32 123, i32 addrspace(4)* %ptr, align 4
41+
ret void
42+
}
43+
44+
; CHECK-LABEL: define spir_func void @f1
45+
define spir_func void @f1(i32 addrspace(4)* %ptr, i32 %value) {
46+
%dec = sub i32 %value, 1
47+
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(1)*
48+
; CHECK: store i32 %dec, i32 addrspace(1)* %[[GLOBAL_PTR]], align 4
49+
store i32 %dec, i32 addrspace(4)* %ptr, align 4
50+
call spir_func void @f0(i32 addrspace(4)* %ptr)
51+
ret void
52+
}
53+
54+
; CHECK-LABEL: define spir_func void @f0
55+
define spir_func void @f0(i32 addrspace(4)* %ptr) {
56+
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(1)*
57+
; CHECK: load i32, i32 addrspace(1)* %[[GLOBAL_PTR]], align 4
58+
%v = load i32, i32 addrspace(4)* %ptr, align 4
59+
%c = icmp ne i32 %v, 0
60+
br i1 %c, label %call_func, label %exit
61+
call_func:
62+
call spir_func void @f1(i32 addrspace(4)* %ptr, i32 %v)
63+
br label %exit
64+
exit:
65+
ret void
66+
}
67+
68+
define spir_kernel void @kernelA(i32 addrspace(1)* %global_buffer) {
69+
%generic_ptr = addrspacecast i32 addrspace(1)* %global_buffer to i32 addrspace(4)*
70+
call spir_func void @f0(i32 addrspace(4)* %generic_ptr)
71+
ret void
72+
}
73+
74+
define spir_kernel void @kernelB(i32 addrspace(3)* %local_buffer) {
75+
%alloca = alloca i32
76+
%generic_ptr = addrspacecast i32 addrspace(3)* %local_buffer to i32 addrspace(4)*
77+
%private_ptr = addrspacecast i32* %alloca to i32 addrspace(4)*
78+
call spir_func void @f2(i32 addrspace(4)* %generic_ptr)
79+
call spir_func void @f2(i32 addrspace(4)* %private_ptr)
80+
ret void
81+
}
Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
;=========================== begin_copyright_notice ============================
22
;
3-
; Copyright (C) 2022 Intel Corporation
3+
; Copyright (C) 2022-2024 Intel Corporation
44
;
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
88

9-
; RUN: igc_opt %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
9+
; REQUIRES: llvm-14-plus
10+
; RUN: igc_opt --opaque-pointers %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
1011

1112
; This test verifies whether cyclic call graph is properly handled by CastToGASAnalysis.
1213
; Here is a call graph for below test:
@@ -27,55 +28,55 @@
2728
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
2829

2930
; CHECK-LABEL: define spir_func void @f2
30-
define spir_func void @f2(i32 addrspace(4)* %ptr) {
31-
; CHECK: %[[PTI:.*]] = ptrtoint i32 addrspace(4)* %ptr to i64
31+
define spir_func void @f2(ptr addrspace(4) %ptr) {
32+
; CHECK: %[[PTI:.*]] = ptrtoint ptr addrspace(4) %ptr to i64
3233
; CHECK: %[[TAG:.*]] = lshr i64 %1, 61
3334
; CHECK: switch i64 %2, label %GlobalBlock [
3435
; CHECK: i64 2, label %LocalBlock
3536
; CHECK: ]
3637

3738
; CHECK: LocalBlock:
38-
; CHECK: %[[LOCAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(3)*
39-
; CHECK: store i32 123, i32 addrspace(3)* %[[LOCAL_PTR]], align 4
40-
store i32 123, i32 addrspace(4)* %ptr, align 4
39+
; CHECK: %[[LOCAL_PTR:.*]] = addrspacecast ptr addrspace(4) %ptr to ptr addrspace(3)
40+
; CHECK: store i32 123, ptr addrspace(3) %[[LOCAL_PTR]], align 4
41+
store i32 123, ptr addrspace(4) %ptr, align 4
4142
ret void
4243
}
4344

4445
; CHECK-LABEL: define spir_func void @f1
45-
define spir_func void @f1(i32 addrspace(4)* %ptr, i32 %value) {
46+
define spir_func void @f1(ptr addrspace(4) %ptr, i32 %value) {
4647
%dec = sub i32 %value, 1
47-
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(1)*
48-
; CHECK: store i32 %dec, i32 addrspace(1)* %[[GLOBAL_PTR]], align 4
49-
store i32 %dec, i32 addrspace(4)* %ptr, align 4
50-
call spir_func void @f0(i32 addrspace(4)* %ptr)
48+
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast ptr addrspace(4) %ptr to ptr addrspace(1)
49+
; CHECK: store i32 %dec, ptr addrspace(1) %[[GLOBAL_PTR]], align 4
50+
store i32 %dec, ptr addrspace(4) %ptr, align 4
51+
call spir_func void @f0(ptr addrspace(4) %ptr)
5152
ret void
5253
}
5354

5455
; CHECK-LABEL: define spir_func void @f0
55-
define spir_func void @f0(i32 addrspace(4)* %ptr) {
56-
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(1)*
57-
; CHECK: load i32, i32 addrspace(1)* %[[GLOBAL_PTR]], align 4
58-
%v = load i32, i32 addrspace(4)* %ptr, align 4
56+
define spir_func void @f0(ptr addrspace(4) %ptr) {
57+
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast ptr addrspace(4) %ptr to ptr addrspace(1)
58+
; CHECK: load i32, ptr addrspace(1) %[[GLOBAL_PTR]], align 4
59+
%v = load i32, ptr addrspace(4) %ptr, align 4
5960
%c = icmp ne i32 %v, 0
6061
br i1 %c, label %call_func, label %exit
6162
call_func:
62-
call spir_func void @f1(i32 addrspace(4)* %ptr, i32 %v)
63+
call spir_func void @f1(ptr addrspace(4) %ptr, i32 %v)
6364
br label %exit
6465
exit:
6566
ret void
6667
}
6768

68-
define spir_kernel void @kernelA(i32 addrspace(1)* %global_buffer) {
69-
%generic_ptr = addrspacecast i32 addrspace(1)* %global_buffer to i32 addrspace(4)*
70-
call spir_func void @f0(i32 addrspace(4)* %generic_ptr)
69+
define spir_kernel void @kernelA(ptr addrspace(1) %global_buffer) {
70+
%generic_ptr = addrspacecast ptr addrspace(1) %global_buffer to ptr addrspace(4)
71+
call spir_func void @f0(ptr addrspace(4) %generic_ptr)
7172
ret void
7273
}
7374

74-
define spir_kernel void @kernelB(i32 addrspace(3)* %local_buffer) {
75+
define spir_kernel void @kernelB(ptr addrspace(3) %local_buffer) {
7576
%alloca = alloca i32
76-
%generic_ptr = addrspacecast i32 addrspace(3)* %local_buffer to i32 addrspace(4)*
77-
%private_ptr = addrspacecast i32* %alloca to i32 addrspace(4)*
78-
call spir_func void @f2(i32 addrspace(4)* %generic_ptr)
79-
call spir_func void @f2(i32 addrspace(4)* %private_ptr)
77+
%generic_ptr = addrspacecast ptr addrspace(3) %local_buffer to ptr addrspace(4)
78+
%private_ptr = addrspacecast ptr %alloca to ptr addrspace(4)
79+
call spir_func void @f2(ptr addrspace(4) %generic_ptr)
80+
call spir_func void @f2(ptr addrspace(4) %private_ptr)
8081
ret void
8182
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2022-2024 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; RUN: igc_opt %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
10+
11+
; This test verifies whether optimization which allows to avoid additional control flow
12+
; generation is blocked when a kernel calls a function indirectly. In such case, we don't
13+
; know what function is going to be called by a function pointer, so it is not possible
14+
; to check whether callee contains addrspacecast's from private/local to generic addrspace.
15+
16+
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
17+
18+
declare spir_func void @foo(i32 addrspace(4)* %ptr) "referenced-indirectly"
19+
20+
define spir_kernel void @kernel(i32 addrspace(1)* %global_buffer) {
21+
%fp = alloca void (i32 addrspace(4)*)*, align 8
22+
store void (i32 addrspace(4)*)* @foo, void (i32 addrspace(4)*)** %fp, align 8
23+
%generic_ptr = addrspacecast i32 addrspace(1)* %global_buffer to i32 addrspace(4)*
24+
%f = load void (i32 addrspace(4)*)*, void (i32 addrspace(4)*)** %fp, align 8
25+
call spir_func void %f(i32 addrspace(4)* %generic_ptr)
26+
27+
; CHECK: %[[PTI:.*]] = ptrtoint i32 addrspace(4)* %generic_ptr to i64
28+
; CHECK: %[[TAG:.*]] = lshr i64 %[[PTI]], 61
29+
; CHECK: switch i64 %[[TAG]], label %GlobalBlock [
30+
; CHECK: i64 2, label %LocalBlock
31+
; CHECK: ]
32+
33+
; CHECK: LocalBlock:
34+
; CHECK: %[[LOCAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %generic_ptr to i32 addrspace(3)*
35+
; CHECK: store i32 5, i32 addrspace(3)* %[[LOCAL_PTR]], align 4
36+
37+
; CHECK: GlobalBlock:
38+
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %generic_ptr to i32 addrspace(1)*
39+
; CHECK: store i32 5, i32 addrspace(1)* %[[GLOBAL_PTR]], align 4
40+
store i32 5, i32 addrspace(4)* %generic_ptr, align 4
41+
ret void
42+
}
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
;=========================== begin_copyright_notice ============================
22
;
3-
; Copyright (C) 2022 Intel Corporation
3+
; Copyright (C) 2022-2024 Intel Corporation
44
;
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
88

9-
; RUN: igc_opt %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
9+
; REQUIRES: llvm-14-plus
10+
; RUN: igc_opt --opaque-pointers %s -S -o - -igc-generic-address-dynamic-resolution | FileCheck %s
1011

1112
; This test verifies whether optimization which allows to avoid additional control flow
1213
; generation is blocked when a kernel calls a function indirectly. In such case, we don't
@@ -15,28 +16,28 @@
1516

1617
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
1718

18-
declare spir_func void @foo(i32 addrspace(4)* %ptr) "referenced-indirectly"
19+
declare spir_func void @foo(ptr addrspace(4) %ptr) "referenced-indirectly"
1920

20-
define spir_kernel void @kernel(i32 addrspace(1)* %global_buffer) {
21-
%fp = alloca void (i32 addrspace(4)*)*, align 8
22-
store void (i32 addrspace(4)*)* @foo, void (i32 addrspace(4)*)** %fp, align 8
23-
%generic_ptr = addrspacecast i32 addrspace(1)* %global_buffer to i32 addrspace(4)*
24-
%f = load void (i32 addrspace(4)*)*, void (i32 addrspace(4)*)** %fp, align 8
25-
call spir_func void %f(i32 addrspace(4)* %generic_ptr)
21+
define spir_kernel void @kernel(ptr addrspace(1) %global_buffer) {
22+
%fp = alloca ptr, align 8
23+
store ptr @foo, ptr %fp, align 8
24+
%generic_ptr = addrspacecast ptr addrspace(1) %global_buffer to ptr addrspace(4)
25+
%f = load ptr, ptr %fp, align 8
26+
call spir_func void %f(ptr addrspace(4) %generic_ptr)
2627

27-
; CHECK: %[[PTI:.*]] = ptrtoint i32 addrspace(4)* %generic_ptr to i64
28+
; CHECK: %[[PTI:.*]] = ptrtoint ptr addrspace(4) %generic_ptr to i64
2829
; CHECK: %[[TAG:.*]] = lshr i64 %[[PTI]], 61
2930
; CHECK: switch i64 %[[TAG]], label %GlobalBlock [
3031
; CHECK: i64 2, label %LocalBlock
3132
; CHECK: ]
3233

3334
; CHECK: LocalBlock:
34-
; CHECK: %[[LOCAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %generic_ptr to i32 addrspace(3)*
35-
; CHECK: store i32 5, i32 addrspace(3)* %[[LOCAL_PTR]], align 4
35+
; CHECK: %[[LOCAL_PTR:.*]] = addrspacecast ptr addrspace(4) %generic_ptr to ptr addrspace(3)
36+
; CHECK: store i32 5, ptr addrspace(3) %[[LOCAL_PTR]], align 4
3637

3738
; CHECK: GlobalBlock:
38-
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast i32 addrspace(4)* %generic_ptr to i32 addrspace(1)*
39-
; CHECK: store i32 5, i32 addrspace(1)* %[[GLOBAL_PTR]], align 4
40-
store i32 5, i32 addrspace(4)* %generic_ptr, align 4
39+
; CHECK: %[[GLOBAL_PTR:.*]] = addrspacecast ptr addrspace(4) %generic_ptr to ptr addrspace(1)
40+
; CHECK: store i32 5, ptr addrspace(1) %[[GLOBAL_PTR]], align 4
41+
store i32 5, ptr addrspace(4) %generic_ptr, align 4
4142
ret void
4243
}

0 commit comments

Comments
 (0)