Skip to content

Commit fd83926

Browse files
jcranmer-intelChenyang-L
authored andcommitted
Adjust several lit tests to use opaque pointers. (#2037)
These tests generally require adjustments to their check lines to match opaque pointer output, or extra bitcasts, or the like correctly. For the function pointer tests in particular, some adjustments to the input IR have been made to minimize the impact on existing checks. Original commit: KhronosGroup/SPIRV-LLVM-Translator@0946e53
1 parent 45e57da commit fd83926

14 files changed

+80
-89
lines changed

llvm-spirv/test/complex-constexpr.ll

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -o %t.spv
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -o %t.spv
33
; RUN: llvm-spirv %t.spv -o %t.spt --to-text
44
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.bc
55
; RUN: llvm-dis %t.bc -o %t.ll
@@ -13,37 +13,35 @@ target triple = "spir64"
1313
; CHECK-SPIRV: TypeInt [[Int_Ty:[0-9]+]] 8 0
1414
; CHECK-SPIRV: TypeVoid [[Void_Ty:[0-9]+]]
1515
; CHECK-SPIRV: TypeFunction [[Func_Ty1:[0-9]+]] [[Void_Ty]]
16-
; CHECK-SPIRV: TypePointer [[Ptr_Ty:[0-9]+]] 8 [[Int_Ty]]
16+
; CHECK-SPIRV: TypePointer [[Ptr_Ty:[0-9]+]] 8
1717
; CHECK-SPIRV: TypeFunction [[Func_Ty2:[0-9]+]] [[Void_Ty]] [[Ptr_Ty]] [[Ptr_Ty]]
1818

1919
@.str.1 = private unnamed_addr addrspace(1) constant [1 x i8] zeroinitializer, align 1
2020

2121
define linkonce_odr hidden spir_func void @foo() {
2222
entry:
2323
; CHECK-SPIRV: PtrCastToGeneric {{[0-9]+}} [[Cast:[0-9]+]]
24-
; CHECK-SPIRV: InBoundsPtrAccessChain {{[0-9]+}} [[Gep:[0-9]+]] [[Cast]]
25-
; CHECK-SPIRV: ConvertPtrToU {{[0-9]+}} [[PtrToU1:[0-9]+]] [[Gep]]
24+
; CHECK-SPIRV: ConvertPtrToU {{[0-9]+}} [[PtrToU1:[0-9]+]] [[Cast]]
2625
; CHECK-SPIRV: ConvertPtrToU {{[0-9]+}} [[PtrToU2:[0-9]+]]
2726
; CHECK-SPIRV: IEqual {{[0-9]+}} [[IEq:[0-9]+]] [[PtrToU1]] [[PtrToU2]]
2827
; CHECK-SPIRV: ConvertUToPtr {{[0-9]+}} [[UToPtr:[0-9]+]]
29-
; CHECK-SPIRV: Select {{[0-9]+}} [[Sel:[0-9]+]] [[IEq]] [[UToPtr]] [[Gep]]
30-
; CHECK-SPIRV: FunctionCall [[Void_Ty]] {{[0-9]+}} [[Func:[0-9]+]] [[Gep]] [[Sel]]
28+
; CHECK-SPIRV: Select {{[0-9]+}} [[Sel:[0-9]+]] [[IEq]] [[UToPtr]] [[Cast]]
29+
; CHECK-SPIRV: FunctionCall [[Void_Ty]] {{[0-9]+}} [[Func:[0-9]+]] [[Cast]] [[Sel]]
3130
; CHECK-LLVM: %[[Cast:[0-9]+]] = addrspacecast ptr addrspace(1) @.str.1 to ptr addrspace(4)
32-
; CHECK-LLVM: %[[Gep:[0-9]+]] = getelementptr inbounds [1 x i8], ptr addrspace(4) %0, i64 0, i64 0
33-
; CHECK-LLVM: %[[PtrToU1:[0-9]+]] = ptrtoint ptr addrspace(4) %[[Gep]] to i64
31+
; CHECK-LLVM: %[[PtrToU1:[0-9]+]] = ptrtoint ptr addrspace(4) %[[Cast]] to i64
3432
; CHECK-LLVM: %[[PtrToU2:[0-9]+]] = ptrtoint ptr addrspace(4) null to i64
3533
; CHECK-LLVM: %[[IEq:[0-9]+]] = icmp eq i64 %[[PtrToU1]], %[[PtrToU2]]
3634
; CHECK-LLVM: %[[UToPtr:[0-9]+]] = inttoptr i64 -1 to ptr addrspace(4)
37-
; CHECK-LLVM: %[[Sel:[0-9]+]] = select i1 %[[IEq]], ptr addrspace(4) %[[UToPtr]], ptr addrspace(4) %[[Gep]]
38-
; CHECK-LLVM: call spir_func void @bar(ptr addrspace(4) %[[Gep]], ptr addrspace(4) %[[Sel]]) #0
39-
%0 = select i1 icmp eq (i8 addrspace(4)* getelementptr inbounds ([1 x i8], [1 x i8] addrspace(4)* addrspacecast ([1 x i8] addrspace(1)* @.str.1 to [1 x i8] addrspace(4)*), i64 0, i64 0), i8 addrspace(4)* null), i8 addrspace(4)* inttoptr (i64 -1 to i8 addrspace(4)*), i8 addrspace(4)* getelementptr inbounds ([1 x i8], [1 x i8] addrspace(4)* addrspacecast ([1 x i8] addrspace(1)* @.str.1 to [1 x i8] addrspace(4)*), i64 0, i64 0)
40-
call spir_func void @bar(i8 addrspace(4)* getelementptr inbounds ([1 x i8], [1 x i8] addrspace(4)* addrspacecast ([1 x i8] addrspace(1)* @.str.1 to [1 x i8] addrspace(4)*), i64 0, i64 0), i8 addrspace(4)* %0)
35+
; CHECK-LLVM: %[[Sel:[0-9]+]] = select i1 %[[IEq]], ptr addrspace(4) %[[UToPtr]], ptr addrspace(4) %[[Cast]]
36+
; CHECK-LLVM: call spir_func void @bar(ptr addrspace(4) %[[Cast]], ptr addrspace(4) %[[Sel]]) #0
37+
%0 = select i1 icmp eq (ptr addrspace(4) getelementptr inbounds ([1 x i8], ptr addrspace(4) addrspacecast (ptr addrspace(1) @.str.1 to ptr addrspace(4)), i64 0, i64 0), ptr addrspace(4) null), ptr addrspace(4) inttoptr (i64 -1 to ptr addrspace(4)), ptr addrspace(4) getelementptr inbounds ([1 x i8], ptr addrspace(4) addrspacecast (ptr addrspace(1) @.str.1 to ptr addrspace(4)), i64 0, i64 0)
38+
call spir_func void @bar(ptr addrspace(4) getelementptr inbounds ([1 x i8], ptr addrspace(4) addrspacecast (ptr addrspace(1) @.str.1 to ptr addrspace(4)), i64 0, i64 0), ptr addrspace(4) %0)
4139
ret void
4240
}
4341

4442
; CHECK-SPIRV: Function [[Void_Ty]] [[Func]] 0 [[Func_Ty2]]
4543

46-
define linkonce_odr hidden spir_func void @bar(i8 addrspace(4)* %__beg, i8 addrspace(4)* %__end) {
44+
define linkonce_odr hidden spir_func void @bar(ptr addrspace(4) %__beg, ptr addrspace(4) %__end) {
4745
entry:
4846
ret void
4947
}

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/bitcast.ll

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@
44
; }
55
; void bar() {
66
; int (*fun_ptr)(int) = &foo;
7+
; fun_ptr(0);
78
; }
89

9-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
10-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
10+
; RUN: llvm-as %s -o %t.bc
11+
; RUN: llvm-spirv %t.bc -spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
1112
; RUN: llvm-spirv %t.spv -to-text -o %t.spt
1213
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
1314
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.r.bc
1415
; RUN: llvm-dis %t.r.bc -o %t.r.ll
1516
; RUN: FileCheck < %t.r.ll %s --check-prefix=CHECK-LLVM
1617

17-
; CHECK-SPIRV: TypeFunction [[#FOO_TY:]] [[#]] [[#]]
18-
; CHECK-SPIRV: TypeFunction [[#DEST_TY:]] [[#]] [[#]]
19-
; CHECK-SPIRV: TypePointer [[#DEST_TY_PTR:]] [[#]] [[#DEST_TY]]
20-
; CHECK-SPIRV: TypePointer [[#FOO_TY_PTR:]] [[#]] [[#FOO_TY]]
18+
; CHECK-SPIRV-DAG: TypeInt [[#I8:]] 8
19+
; CHECK-SPIRV-DAG: TypeInt [[#I32:]] 32
20+
; CHECK-SPIRV-DAG: TypeFunction [[#FOO_TY:]] [[#I8]] [[#I8]]
21+
; CHECK-SPIRV-DAG: TypeFunction [[#DEST_TY:]] [[#I32]] [[#I32]]
22+
; CHECK-SPIRV-DAG: TypePointer [[#DEST_TY_PTR:]] [[#]] [[#DEST_TY]]
23+
; CHECK-SPIRV-DAG: TypePointer [[#FOO_TY_PTR:]] [[#]] [[#FOO_TY]]
2124
; CHECK-SPIRV: ConstantFunctionPointerINTEL [[#FOO_TY_PTR]] [[#FOO_PTR:]] [[#FOO:]]
2225
; CHECK-SPIRV: Function [[#]] [[#FOO]] [[#]] [[#FOO_TY]]
2326

@@ -37,8 +40,8 @@ define dso_local spir_func signext i8 @foo(i8 signext %0) #0 {
3740

3841
; Function Attrs: noinline nounwind optnone
3942
define dso_local spir_func void @bar() #0 {
40-
%1 = alloca i32 (i32)*, align 4
41-
store i32 (i32)* bitcast (i8 (i8)* @foo to i32 (i32)*), i32 (i32)** %1, align 4
43+
%1 = bitcast i8 (i8)* @foo to i32 (i32)*
44+
%2 = call i32 %1(i32 0)
4245
ret void
4346
}
4447

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/const-function-pointer.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
33
; RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
44
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.r.bc
55
; RUN: llvm-dis %t.r.bc -o %t.r.ll

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/decor-func-ptr-arg-attr.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -o %t.spt -spirv-text -spirv-ext=+SPV_INTEL_function_pointers
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -o %t.spt -spirv-text -spirv-ext=+SPV_INTEL_function_pointers
33
; RUN: FileCheck < %t.spt %s --check-prefix CHECK-SPIRV
44

55
; RUN: llvm-spirv %t.spt -o %t.spv -to-binary

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/function-pointer-as-function-arg.ll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-text --spirv-ext=+SPV_INTEL_function_pointers -o %t.spt
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -spirv-text --spirv-ext=+SPV_INTEL_function_pointers -o %t.spt
33
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
4-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
4+
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
55
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.r.bc
66
; RUN: llvm-dis %t.r.bc -o %t.r.ll
77
; RUN: FileCheck < %t.r.ll %s --check-prefix=CHECK-LLVM
@@ -125,7 +125,6 @@ entry:
125125
%fp = alloca i32 (i32)*, align 8
126126
store i32 addrspace(1)* %data, i32 addrspace(1)** %data.addr, align 8
127127
store i32 %control, i32* %control.addr, align 4
128-
store i32 (i32)* null, i32 (i32)** %fp, align 8
129128
%call = call spir_func i64 @_Z13get_global_idj(i32 0) #4
130129
%0 = load i32, i32* %control.addr, align 4
131130
%conv = sext i32 %0 to i64

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/function-pointer.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-text --spirv-ext=+SPV_INTEL_function_pointers -o %t.spt
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -spirv-text --spirv-ext=+SPV_INTEL_function_pointers -o %t.spt
33
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
4-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
4+
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
55
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.r.bc
66
; RUN: llvm-dis %t.r.bc -o %t.r.ll
77
; RUN: FileCheck < %t.r.ll %s --check-prefix=CHECK-LLVM

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/global-function-pointer.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
; RUN: llvm-as -opaque-pointers=0 < %s | llvm-spirv -opaque-pointers=0 -spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
1+
; RUN: llvm-as < %s | llvm-spirv -spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
22
; RUN: llvm-spirv %t.spv -spirv-ext=+SPV_INTEL_function_pointers -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
3-
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -opaque-pointers=0 | FileCheck %s --check-prefix=CHECK-LLVM
3+
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-LLVM
44

55
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
66
target triple = "spir64"
@@ -13,7 +13,7 @@ target triple = "spir64"
1313
; CHECK-SPIRV: ConstantFunctionPointerINTEL [[#FOO_TY_PTR]] [[#FOO_PTR:]] [[#FOO:]]
1414
; CHECK-SPIRV: Function [[#]] [[#]] [[#]] [[#FOO_TY]]
1515

16-
; CHECK-LLVM: @two = internal addrspace(1) global i32 (i32, i32)* @_Z4barrii
16+
; CHECK-LLVM: @two = internal addrspace(1) global ptr @_Z4barrii
1717
; CHECK-LLVM: define spir_func i32 @_Z4barrii(i32 %[[#]], i32 %[[#]])
1818

1919
@two = internal addrspace(1) global i32 (i32, i32)* @_Z4barrii, align 8

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/non-uniform-function-pointer.ll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-text --spirv-ext=+SPV_INTEL_function_pointers -o %t.spt
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -spirv-text --spirv-ext=+SPV_INTEL_function_pointers -o %t.spt
33
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
4-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
4+
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
55
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.r.bc
66
; RUN: llvm-dis %t.r.bc -o %t.r.ll
77
; RUN: FileCheck < %t.r.ll %s --check-prefix=CHECK-LLVM
@@ -86,7 +86,6 @@ entry:
8686
%fp = alloca i32 (i32)*, align 8
8787
store i32 addrspace(1)* %data, i32 addrspace(1)** %data.addr, align 8
8888
store i32 %control, i32* %control.addr, align 4
89-
store i32 (i32)* null, i32 (i32)** %fp, align 8
9089
%call = call spir_func i64 @_Z13get_global_idj(i32 0) #3
9190
%0 = load i32, i32* %control.addr, align 4
9291
%conv = sext i32 %0 to i64

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/referenced-indirectly.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-text --spirv-ext=+SPV_INTEL_function_pointers -o %t.spt
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -spirv-text --spirv-ext=+SPV_INTEL_function_pointers -o %t.spt
33
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
4-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
4+
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
55
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.r.bc
66
; RUN: llvm-dis %t.r.bc -o %t.r.ll
77
; RUN: FileCheck < %t.r.ll %s --check-prefix=CHECK-LLVM

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/select.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_function_pointers -o %t.spv
33
; RUN: llvm-spirv %t.spv -to-text -o %t.spt
44
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
55
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.r.bc

llvm-spirv/test/layout.ll

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-text -o %t
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -spirv-text -o %t
33
; RUN: FileCheck < %t %s
4-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -o %t.spv
4+
; RUN: llvm-spirv %t.bc -o %t.spv
55
; RUN: spirv-val %t.spv
66

77
; CHECK: 119734787 {{[0-9]*}} {{[0-9]*}} {{[0-9]*}} 0
@@ -43,21 +43,20 @@
4343
; CHECK-NOT: {{[0-9]*}} Variable
4444
; CHECK-NOT: {{[0-9]*}} Function
4545

46-
; CHECK: {{[0-9]*}} TypeForwardPointer [[AFwdPtr:[0-9]+]]
47-
; CHECK: {{[0-9]*}} TypeInt [[TypeInt:[0-9]+]]
46+
; CHECK: {{[0-9]*}} TypeInt [[TypeInt:[0-9]+]] 32
47+
; CHECK: {{[0-9]*}} TypeInt [[TypeI8:[0-9]+]] 8
4848
; CHECK: {{[0-9]*}} Constant [[TypeInt]] [[Two:[0-9]+]] 2
4949
; CHECK: {{[0-9]*}} TypePointer [[TPointer:[0-9]+]]
5050
; CHECK: {{[0-9]*}} TypePointer [[SConstOpType:[0-9]+]]
5151
; CHECK: {{[0-9]*}} TypeFloat [[TypeFloat:[0-9]+]]
5252
; CHECK: {{[0-9]*}} TypeArray [[TypeArray:[0-9]+]] [[TypeFloat]] [[Two]]
5353
; CHECK: {{[0-9]*}} TypeVector [[TypeVectorInt3:[0-9]+]] [[TypeInt]] 3
54-
; CHECK: {{[0-9]*}} TypeStruct [[BID:[0-9]+]] {{[0-9]+}} [[AFwdPtr]]
54+
; CHECK: {{[0-9]*}} TypePointer [[TPointerI8:[0-9]+]] 8 [[TypeI8]]
55+
; CHECK: {{[0-9]*}} TypeStruct [[BID:[0-9]+]] {{[0-9]+}} [[TPointerI8]]
5556
; CHECK: {{[0-9]*}} TypeStruct [[CID:[0-9]+]] {{[0-9]+}} [[BID]]
5657
; CHECK: {{[0-9]*}} TypeStruct [[AID:[0-9]+]] {{[0-9]+}} [[CID]]
57-
; CHECK: {{[0-9]*}} TypePointer [[AFwdPtr]] {{[0-9]*}} [[AID]]
5858
; CHECK: {{[0-9]*}} TypeVoid [[Void:[0-9]+]]
59-
; CHECK: {{[0-9]*}} TypePointer [[Int3Ptr:[0-9]+]] {{[0-9]+}} [[TypeVectorInt3]]
60-
; CHECK: {{[0-9]*}} TypeFunction [[TypeBar1:[0-9]+]] [[Void]] [[Int3Ptr]]
59+
; CHECK: {{[0-9]*}} TypeFunction [[TypeBar1:[0-9]+]] [[Void]] [[SConstOpType]]
6160
; CHECK: {{[0-9]*}} Variable [[TPointer]] [[Var:[0-9]+]]
6261
; CHECK: {{[0-9]*}} SpecConstantOp [[SConstOpType]] [[SConstOp:[0-9]+]] 70 [[Var]]
6362
; CHECK: {{[0-9]*}} Variable {{[0-9]+}} {{[0-9]+}} 5 [[SConstOp]]
@@ -124,7 +123,7 @@ target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:2
124123
target triple = "spir"
125124

126125
@v = addrspace(1) global [2 x i32] [i32 1, i32 2], align 4
127-
@s = addrspace(1) global i32 addrspace(1)* getelementptr inbounds ([2 x i32], [2 x i32] addrspace(1)* @v, i32 0, i32 0), align 4
126+
@s = addrspace(1) global i32 addrspace(1)* getelementptr inbounds ([2 x i32], [2 x i32] addrspace(1)* @v, i32 0, i32 1), align 4
128127

129128
%struct.A = type { i32, %struct.C }
130129
%struct.C = type { i32, %struct.B }

llvm-spirv/test/transcoding/AtomicCompareExchange_cl20.ll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
33
target triple = "spir-unknown-unknown"
44

5-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
5+
; RUN: llvm-as %s -o %t.bc
66
; RUN: llvm-spirv %t.bc -o %t.spv
7-
; RUN: llvm-spirv -r --spirv-target-env=CL2.0 %t.spv -o %t.bc
8-
; RUN: llvm-dis -opaque-pointers=0 < %t.bc | FileCheck %s
7+
; RUN: llvm-spirv -r -emit-opaque-pointers --spirv-target-env=CL2.0 %t.spv -o %t.bc
8+
; RUN: llvm-dis < %t.bc | FileCheck %s
99

1010
; Check 'LLVM ==> SPIR-V ==> LLVM' conversion of atomic_compare_exchange_strong and atomic_compare_exchange_weak.
1111

@@ -21,18 +21,18 @@ target triple = "spir-unknown-unknown"
2121
; CHECK-LABEL: define spir_func void @test_strong
2222
; CHECK-NEXT: entry:
2323
; CHECK: [[PTR_STRONG:%expected[0-9]*]] = alloca i32, align 4
24-
; CHECK: store i32 {{.*}}, i32* [[PTR_STRONG]]
25-
; CHECK: [[PTR_STRONG]].as = addrspacecast i32* [[PTR_STRONG]] to i32 addrspace(4)*
26-
; CHECK: call spir_func i1 @_Z39atomic_compare_exchange_strong_explicit{{.*}}(i32 {{.*}}* %object, i32 {{.*}}* [[PTR_STRONG]].as, i32 %desired, i32 5, i32 5, i32 2)
27-
; CHECK: load i32, i32 addrspace(4)* [[PTR_STRONG]].as
24+
; CHECK: store i32 {{.*}}, ptr [[PTR_STRONG]]
25+
; CHECK: [[PTR_STRONG]].as = addrspacecast ptr [[PTR_STRONG]] to ptr addrspace(4)
26+
; CHECK: call spir_func i1 @_Z39atomic_compare_exchange_strong_explicit{{.*}}(ptr {{.*}} %object, ptr {{.*}} [[PTR_STRONG]].as, i32 %desired, i32 5, i32 5, i32 2)
27+
; CHECK: load i32, ptr addrspace(4) [[PTR_STRONG]].as
2828

2929
; CHECK-LABEL: define spir_func void @test_weak
3030
; CHECK-NEXT: entry:
3131
; CHECK: [[PTR_WEAK:%expected[0-9]*]] = alloca i32, align 4
32-
; CHECK: store i32 {{.*}}, i32* [[PTR_WEAK]]
33-
; CHECK: [[PTR_WEAK]].as = addrspacecast i32* [[PTR_WEAK]] to i32 addrspace(4)*
34-
; CHECK: call spir_func i1 @_Z39atomic_compare_exchange_strong_explicitPU3AS4VU7_AtomiciPU3AS4ii12memory_orderS4_12memory_scope{{.*}}(i32 {{.*}}* %object, i32 {{.*}}* [[PTR_WEAK]].as, i32 %desired, i32 5, i32 5, i32 2)
35-
; CHECK: load i32, i32 addrspace(4)* [[PTR_WEAK]].as
32+
; CHECK: store i32 {{.*}}, ptr [[PTR_WEAK]]
33+
; CHECK: [[PTR_WEAK]].as = addrspacecast ptr [[PTR_WEAK]] to ptr addrspace(4)
34+
; CHECK: call spir_func i1 @_Z39atomic_compare_exchange_strong_explicitPU3AS4VU7_AtomiciPU3AS4ii12memory_orderS4_12memory_scope{{.*}}(ptr {{.*}} %object, ptr {{.*}} [[PTR_WEAK]].as, i32 %desired, i32 5, i32 5, i32 2)
35+
; CHECK: load i32, ptr addrspace(4) [[PTR_WEAK]].as
3636

3737
; Check that alloca for atomic_compare_exchange is being created in the entry block.
3838

@@ -41,7 +41,7 @@ target triple = "spir-unknown-unknown"
4141
; CHECK: %expected{{[0-9]*}} = alloca i32
4242
; CHECK-LABEL: for.body:
4343
; CHECK-NOT: %expected{{[0-9]*}} = alloca i32
44-
; CHECK: call spir_func i1 @_Z39atomic_compare_exchange_strong_explicit{{.*}}(i32 {{.*}}* {{.*}}, i32 addrspace(4)* {{.*}}, i32 {{.*}}, i32 5, i32 5, i32 2)
44+
; CHECK: call spir_func i1 @_Z39atomic_compare_exchange_strong_explicit{{.*}}(ptr {{.*}} {{.*}}, ptr addrspace(4) {{.*}}, i32 {{.*}}, i32 5, i32 5, i32 2)
4545

4646
; Function Attrs: nounwind
4747
define spir_func void @test_strong(i32 addrspace(4)* %object, i32 addrspace(4)* %expected, i32 %desired) #0 {

llvm-spirv/test/transcoding/KernelArgTypeInOpString.ll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
; As a workaround we store original names in OpString instruction:
2121
; OpString "kernel_arg_type.%kernel_name%.typename0,typename1,..."
2222

23-
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
24-
; RUN: llvm-spirv -preserve-ocl-kernel-arg-type-metadata-through-string %t.bc -opaque-pointers=0 -spirv-text -o %t.spv.txt
23+
; RUN: llvm-as %s -o %t.bc
24+
; RUN: llvm-spirv -preserve-ocl-kernel-arg-type-metadata-through-string %t.bc -spirv-text -o %t.spv.txt
2525
; RUN: FileCheck < %t.spv.txt %s --check-prefix=CHECK-SPIRV-WORKAROUND
26-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-text -o %t.spv.txt
26+
; RUN: llvm-spirv %t.bc -spirv-text -o %t.spv.txt
2727
; RUN: FileCheck < %t.spv.txt %s --check-prefix=CHECK-SPIRV-WORKAROUND-NEGATIVE
28-
; RUN: llvm-spirv -preserve-ocl-kernel-arg-type-metadata-through-string %t.bc -opaque-pointers=0 -o %t.spv
28+
; RUN: llvm-spirv -preserve-ocl-kernel-arg-type-metadata-through-string %t.bc -o %t.spv
2929
; RUN: spirv-val %t.spv
3030
; RUN: llvm-spirv -r -emit-opaque-pointers -preserve-ocl-kernel-arg-type-metadata-through-string %t.spv -o %t.rev.bc
3131
; RUN: llvm-dis %t.rev.bc
3232
; RUN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM-WORKAROUND
33-
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -o %t.spv
33+
; RUN: llvm-spirv %t.bc -o %t.spv
3434
; RUN: spirv-val %t.spv
3535
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc
3636
; RUN: llvm-dis %t.rev.bc
@@ -39,8 +39,8 @@
3939
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
4040
target triple = "spir-unknown-unknown"
4141

42-
; CHECK-SPIRV-WORKAROUND: String 14 "kernel_arg_type.foo.image_kernel_data*,myInt,struct struct_name*,"
43-
; CHECK-SPIRV-WORKAROUND-NEGATIVE-NOT: String 14 "kernel_arg_type.foo.image_kernel_data*,myInt,struct struct_name*,"
42+
; CHECK-SPIRV-WORKAROUND: String [[#]] "kernel_arg_type.foo.image_kernel_data*,myInt,struct struct_name*,"
43+
; CHECK-SPIRV-WORKAROUND-NEGATIVE-NOT: String [[#]] "kernel_arg_type.foo.image_kernel_data*,myInt,struct struct_name*,"
4444

4545
; CHECK-LLVM-WORKAROUND: !kernel_arg_type [[TYPE:![0-9]+]]
4646
; CHECK-LLVM-WORKAROUND: [[TYPE]] = !{!"image_kernel_data*", !"myInt", !"struct struct_name*"}

0 commit comments

Comments
 (0)