|
3 | 3 |
|
4 | 4 | ; CHECK: %llvm.amdgcn.module.lds.t = type { float, float }
|
5 | 5 |
|
6 |
| -@func = addrspace(3) global float undef, align 4 |
| 6 | +@a_func = addrspace(3) global float undef, align 4 |
7 | 7 |
|
8 | 8 | ; CHECK: %llvm.amdgcn.kernel.timestwo.lds.t = type { float }
|
9 | 9 |
|
10 | 10 | @kern = addrspace(3) global float undef, align 4
|
11 | 11 |
|
12 |
| -; @func is only used from a non-kernel function so is rewritten |
13 |
| -; CHECK-NOT: @func |
14 |
| -; @both is used from a non-kernel function so is rewritten |
15 |
| -; CHECK-NOT: @both |
16 |
| -; sorted both < func, so @both at null and @func at 4 |
17 |
| -@both = addrspace(3) global float undef, align 4 |
| 12 | +; @a_func is only used from a non-kernel function so is rewritten |
| 13 | +; CHECK-NOT: @a_func |
| 14 | +; @b_both is used from a non-kernel function so is rewritten |
| 15 | +; CHECK-NOT: @b_both |
| 16 | +; sorted both < func, so @b_both at null and @a_func at 4 |
| 17 | +@b_both = addrspace(3) global float undef, align 4 |
18 | 18 |
|
19 | 19 | ; CHECK: @llvm.amdgcn.module.lds = internal addrspace(3) global %llvm.amdgcn.module.lds.t undef, align 4
|
20 | 20 | ; CHECK: @llvm.amdgcn.kernel.timestwo.lds = internal addrspace(3) global %llvm.amdgcn.kernel.timestwo.lds.t undef, align 4
|
|
32 | 32 | ; CHECK: ret i32 %8
|
33 | 33 | define i32 @get_func() local_unnamed_addr #0 {
|
34 | 34 | entry:
|
35 |
| - %0 = load i32, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @func to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @func to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4 |
| 35 | + %0 = load i32, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @a_func to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @a_func to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4 |
36 | 36 | ret i32 %0
|
37 | 37 | }
|
38 | 38 |
|
|
49 | 49 | ; CHECK: ret void
|
50 | 50 | define void @set_func(i32 %x) local_unnamed_addr #1 {
|
51 | 51 | entry:
|
52 |
| - store i32 %x, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @both to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @both to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4 |
| 52 | + store i32 %x, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @b_both to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @b_both to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4 |
53 | 53 | ret void
|
54 | 54 | }
|
55 | 55 |
|
|
78 | 78 | ; CHECK: store i32 %mul, i32* %16, align 4
|
79 | 79 | ; CHECK: ret void
|
80 | 80 | define amdgpu_kernel void @timestwo() {
|
81 |
| - %ld = load i32, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @both to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @kern to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4 |
| 81 | + %ld = load i32, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @b_both to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @kern to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4 |
82 | 82 | %mul = mul i32 %ld, 2
|
83 |
| - store i32 %mul, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @kern to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @both to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4 |
| 83 | + store i32 %mul, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @kern to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast (float addrspace(3)* @b_both to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4 |
84 | 84 | ret void
|
85 | 85 | }
|
86 | 86 |
|
|
0 commit comments