diff --git a/test/extensions/KHR/SPV_KHR_untyped_pointers/basic.ll b/test/extensions/KHR/SPV_KHR_untyped_pointers/basic.ll deleted file mode 100644 index b6d50e9ad..000000000 --- a/test/extensions/KHR/SPV_KHR_untyped_pointers/basic.ll +++ /dev/null @@ -1,35 +0,0 @@ -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_untyped_pointers -o %t.spv -; RUN: spirv-val %t.spv -; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_untyped_pointers -spirv-text -o %t.spt -; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV - -; RUN: llvm-spirv -r %t.spv -o %t.rev.bc -; RUN: llvm-dis < %t.rev.bc -; RUN: llvm-dis %t.rev.bc -o %t.rev.ll -; R/UN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM - -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" -target triple = "spir-unknown-unknown" - -; CHECK-SPIRV: 4 TypeInt [[#INT:]] 32 0 -; CHECK-SPIRV: 3 TypeUntypedPointerKHR [[#FLOATPTR:]] 7 -; CHECK-SPIRV: 3 TypeFloat [[#FLOAT:]] 32 - -; Function Attrs: nounwind -define spir_kernel void @foo() { -; CHECK-SPIRV: 5 UntypedVariableKHR [[#FLOATPTR]] [[#IPTR:]] 7 [[#INT]] -; CHECK-SPIRV: 5 UntypedVariableKHR [[#FLOATPTR]] [[#FPTR:]] 7 [[#FLOAT]] -; CHECK-SPIRV: Store [[#IPTR]] [[#]] -; CHECK-SPIRV: Load [[#INT]] [[#LOAD:]] [[#IPTR]] -; CHECK-SPIRV: 4 Bitcast [[#FLOAT]] [[#BITCAST:]] [[#LOAD]] -; CHECK-SPIRV: Store [[#FPTR]] [[#BITCAST]] -entry: - %iptr = alloca i32, align 4 - %fptr = alloca float, align 4 - store i32 0, ptr %iptr, align 4 - %0 = load i32, ptr %iptr, align 4 - %1 = bitcast i32 %0 to float - store float %1, ptr %fptr, align 4 - ret void -} diff --git a/test/extensions/KHR/SPV_KHR_untyped_pointers/call.ll b/test/extensions/KHR/SPV_KHR_untyped_pointers/call.ll deleted file mode 100644 index f0e376da3..000000000 --- a/test/extensions/KHR/SPV_KHR_untyped_pointers/call.ll +++ /dev/null @@ -1,43 +0,0 @@ -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_untyped_pointers -o %t.spv -; RUN: spirv-val %t.spv -; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_untyped_pointers -spirv-text -o %t.spt -; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV - -; RUN: llvm-spirv -r %t.spv -o %t.rev.bc -; RUN: llvm-dis < %t.rev.bc -; RUN: llvm-dis %t.rev.bc -o %t.rev.ll -; R/UN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM - -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" -target triple = "spir-unknown-unknown" - -; CHECK-SPIRV: Name [[#CALL:]] "call" -; CHECK-SPIRV: TypeInt [[#INT:]] 32 0 -; CHECK-SPIRV: TypeUntypedPointerKHR [[#INTPTR:]] 7 -; CHECK-SPIRV: TypeFloat [[#FLOAT:]] 32 -; CHECK-SPIRV: TypeFunction [[#CALLTY:]] [[#INTPTR]] [[#INTPTR]] - -; Function Attrs: nounwind -define spir_kernel void @foo() { -; CHECK-SPIRV: UntypedVariableKHR [[#INTPTR]] [[#IPTR:]] 7 [[#INT]] -; CHECK-SPIRV: UntypedVariableKHR [[#INTPTR]] [[#FPTR:]] 7 [[#FLOAT]] -; CHECK-SPIRV: FunctionCall [[#INTPTR]] [[#IPTR1:]] [[#CALL]] [[#IPTR]] -; CHECK-SPIRV: Store [[#IPTR1]] -; CHECK-SPIRV: Bitcast [[#INTPTR]] [[#FPTR1:]] [[#FPTR]] -; CHECK-SPIRV: FunctionCall [[#INTPTR]] [[#FPTR2:]] [[#CALL]] [[#FPTR1]] -; CHECK-SPIRV: Bitcast [[#INTPTR]] [[#FPTR3:]] [[#FPTR2]] -; CHECK-SPIRV: Store [[#FPTR3]] -entry: - %iptr = alloca i32, align 4 - %fptr = alloca float, align 4 - %iptr.call = call spir_func ptr @call(ptr %iptr) - store i32 0, ptr %iptr.call - %fptr.call = call spir_func ptr @call(ptr %fptr) - store float 0.0, ptr %fptr.call - ret void -} - -define spir_func ptr @call(ptr %a) { - ret ptr %a -} diff --git a/test/extensions/KHR/SPV_KHR_untyped_pointers/equivalence.ll b/test/extensions/KHR/SPV_KHR_untyped_pointers/equivalence.ll deleted file mode 100644 index 9f958d815..000000000 --- a/test/extensions/KHR/SPV_KHR_untyped_pointers/equivalence.ll +++ /dev/null @@ -1,83 +0,0 @@ - -; Test if llvm-spirv type scavenging has an assertion -; failure due to incorrect lookup of an equivalence class leader. - -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_untyped_pointers -o %t.spv -; RUN: spirv-val %t.spv -; RUN: llvm-spirv %t.spv --spirv-ext=+SPV_KHR_untyped_pointers -to-text -; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV -; RUN: llvm-spirv %t.spv -o - -r | llvm-dis | FileCheck %s --check-prefix=CHECK-LLVM - - -; Incorrect lookup of equivalence class leader caused an assertion failure when -; processing call instruction to this name -; CHECK-SPIRV: _func0 -; CHECK-LLVM: _func0 - -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" -target triple = "spir64-unknown-unknown" - -define spir_func void @_func1() { -entry: - br label %for.cond - -for.cond: ; preds = %for.cond, %entry - %call3 = call spir_func ptr addrspace(4) @_func2() - %call5 = call spir_func ptr addrspace(4) @_func0(ptr addrspace(4) %call3, i64 0) - br label %for.cond -} - -define spir_func void @_func3() { -entry: - br label %for.cond - -for.cond: ; preds = %for.cond, %entry - %call3 = call spir_func ptr @_func4() - %call3.ascast = addrspacecast ptr %call3 to ptr addrspace(4) - %call5 = call spir_func ptr addrspace(4) @_func0(ptr addrspace(4) %call3.ascast, i64 0) - br label %for.cond -} - -declare spir_func ptr addrspace(4) @_func5() - -define spir_func void @_func6(ptr addrspace(4) %call3.ascast) { -entry: - br label %for.cond - -for.cond: ; preds = %for.cond, %entry - %call5 = call spir_func ptr addrspace(4) @_func0(ptr addrspace(4) %call3.ascast, i64 0) - br label %for.cond -} - -define spir_func void @_func7() { -entry: - br label %for.cond - -for.cond: ; preds = %for.cond, %entry - %call3 = call spir_func ptr addrspace(4) @_func5() - %call5 = call spir_func ptr addrspace(4) @_func0(ptr addrspace(4) %call3, i64 0) - br label %for.cond -} - -declare spir_func ptr @_func4() - -declare spir_func ptr addrspace(4) @_func2() - -define spir_func ptr addrspace(4) @_func0(ptr addrspace(4) %this, i64 %index) { -entry: - %arrayidx = getelementptr [5 x i32], ptr addrspace(4) %this, i64 0, i64 %index - ret ptr addrspace(4) null -} - -define spir_func void @_func8() { -entry: - br label %for.cond - -for.cond: ; preds = %for.cond, %entry - %call8 = call spir_func ptr addrspace(4) @_func0(ptr addrspace(4) null, i64 0) - br label %for.cond -} - -; uselistorder directives -uselistorder ptr @_func0, { 0, 4, 3, 2, 1 } diff --git a/test/extensions/KHR/SPV_KHR_untyped_pointers/extract_insert_value.ll b/test/extensions/KHR/SPV_KHR_untyped_pointers/extract_insert_value.ll deleted file mode 100644 index 48e9cd988..000000000 --- a/test/extensions/KHR/SPV_KHR_untyped_pointers/extract_insert_value.ll +++ /dev/null @@ -1,97 +0,0 @@ -; This is a copy of extract_insert_value.ll test, but here we want to verify -; that conversion of extract/insert value and getelementptr works with the untyped pointers extension enabled. - -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" -target triple = "spir-unknown-unknown" - -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_untyped_pointers -spirv-text -o %t.spt -; R/UN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV -; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_untyped_pointers -o %t.spv -; RUN: spirv-val %t.spv -; RUN: llvm-spirv -r %t.spv -o %t.bc -; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-LLVM - -%struct.arr = type { [7 x float] } -%struct.st = type { %struct.inner } -%struct.inner = type { float } -; CHECK-LLVM: %struct.arr = type { [7 x float] } -; CHECK-LLVM: %struct.st = type { %struct.inner } -; CHECK-LLVM: %struct.inner = type { float } - -; CHECK-LLVM: define spir_func void @array_test -; CHECK-LLVM-LABEL: entry -; CHECK-LLVM: %0 = getelementptr inbounds %struct.arr, ptr addrspace(1) %object, i32 0, i32 0 -; CHECK-LLVM: %1 = load [7 x float], ptr addrspace(1) %0, align 4 -; CHECK-LLVM: %2 = extractvalue [7 x float] %1, 4 -; CHECK-LLVM: %3 = extractvalue [7 x float] %1, 2 -; CHECK-LLVM: %4 = fadd float %2, %3 -; CHECK-LLVM: %5 = insertvalue [7 x float] %1, float %4, 5 -; CHECK-LLVM: store [7 x float] %5, ptr addrspace(1) %0 - -; CHECK-SPIRV-LABEL: 5 Function -; CHECK-SPIRV-NEXT: FunctionParameter {{[0-9]+}} [[object:[0-9]+]] -; CHECK-SPIRV: 6 InBoundsPtrAccessChain {{[0-9]+}} {{[0-9]+}} [[object]] {{[0-9]+}} {{[0-9]+}} -; CHECK-SPIRV: 6 Load {{[0-9]+}} [[extracted_array:[0-9]+]] {{[0-9]+}} {{[0-9]+}} 4 -; CHECK-SPIRV: 5 CompositeExtract {{[0-9]+}} [[elem_4:[0-9]+]] [[extracted_array]] 4 -; CHECK-SPIRV: 5 CompositeExtract {{[0-9]+}} [[elem_2:[0-9]+]] [[extracted_array]] 2 -; CHECK-SPIRV: 5 FAdd {{[0-9]+}} [[add:[0-9]+]] [[elem_4]] [[elem_2]] -; CHECK-SPIRV: 6 CompositeInsert {{[0-9]+}} [[inserted_array:[0-9]+]] [[add]] [[extracted_array]] 5 -; CHECK-SPIRV: 5 Store {{[0-9]+}} [[inserted_array]] -; CHECK-SPIRV-LABEL: 1 FunctionEnd - -; Function Attrs: nounwind -define spir_func void @array_test(ptr addrspace(1) %object) #0 { -entry: - %0 = getelementptr inbounds %struct.arr, ptr addrspace(1) %object, i32 0, i32 0 - %1 = load [7 x float], ptr addrspace(1) %0, align 4 - %2 = extractvalue [7 x float] %1, 4 - %3 = extractvalue [7 x float] %1, 2 - %4 = fadd float %2, %3 - %5 = insertvalue [7 x float] %1, float %4, 5 - store [7 x float] %5, ptr addrspace(1) %0 - ret void -} - -; CHECK-LLVM: define spir_func void @struct_test -; CHECK-LLVM-LABEL: entry -; CHECK-LLVM: %0 = getelementptr inbounds %struct.st, ptr addrspace(1) %object, i32 0, i32 0 -; CHECK-LLVM: %1 = load %struct.inner, ptr addrspace(1) %0, align 4 -; CHECK-LLVM: %2 = extractvalue %struct.inner %1, 0 -; CHECK-LLVM: %3 = fadd float %2, 1.000000e+00 -; CHECK-LLVM: %4 = insertvalue %struct.inner %1, float %3, 0 -; CHECK-LLVM: store %struct.inner %4, ptr addrspace(1) %0 - -; CHECK-SPIRV-LABEL: 5 Function -; CHECK-SPIRV-NEXT: FunctionParameter {{[0-9]+}} [[object:[0-9]+]] -; CHECK-SPIRV: 6 InBoundsPtrAccessChain {{[0-9]+}} {{[0-9]+}} [[object]] {{[0-9]+}} {{[0-9]+}} -; CHECK-SPIRV: 6 Load {{[0-9]+}} [[extracted_struct:[0-9]+]] {{[0-9]+}} {{[0-9]+}} 4 -; CHECK-SPIRV: 5 CompositeExtract {{[0-9]+}} [[elem:[0-9]+]] [[extracted_struct]] 0 -; CHECK-SPIRV: 5 FAdd {{[0-9]+}} [[add:[0-9]+]] [[elem]] {{[0-9]+}} -; CHECK-SPIRV: 6 CompositeInsert {{[0-9]+}} [[inserted_struct:[0-9]+]] [[add]] [[extracted_struct]] 0 -; CHECK-SPIRV: 5 Store {{[0-9]+}} [[inserted_struct]] -; CHECK-SPIRV-LABEL: 1 FunctionEnd - -; Function Attrs: nounwind -define spir_func void @struct_test(ptr addrspace(1) %object) #0 { -entry: - %0 = getelementptr inbounds %struct.st, ptr addrspace(1) %object, i32 0, i32 0 - %1 = load %struct.inner, ptr addrspace(1) %0, align 4 - %2 = extractvalue %struct.inner %1, 0 - %3 = fadd float %2, 1.000000e+00 - %4 = insertvalue %struct.inner %1, float %3, 0 - store %struct.inner %4, ptr addrspace(1) %0 - ret void -} - -attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!opencl.enable.FP_CONTRACT = !{} -!opencl.spir.version = !{!0} -!opencl.ocl.version = !{!0} -!opencl.used.extensions = !{!1} -!opencl.used.optional.core.features = !{!1} -!opencl.compiler.options = !{!1} - -!0 = !{i32 1, i32 2} -!1 = !{}