Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir
Show All 24 Lines | spv.func @access_chain_array(%arg0 : i32) "None" { | ||||
spv.Return | spv.Return | ||||
} | } | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// spv.GlobalVariable and spv.mlir.addressof | // spv.GlobalVariable and spv.mlir.addressof | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
spv.module Logical GLSL450 { | spv.module Logical GLSL450 { | ||||
// CHECK: llvm.mlir.global external constant @var() : f32 | // CHECK: llvm.mlir.global external constant @var() {addr_space = 0 : i32} : f32 | ||||
spv.GlobalVariable @var : !spv.ptr<f32, Input> | spv.GlobalVariable @var : !spv.ptr<f32, Input> | ||||
} | } | ||||
spv.module Logical GLSL450 { | spv.module Logical GLSL450 { | ||||
// CHECK: llvm.mlir.global private @struct() : !llvm.struct<packed (f32, array<10 x f32>)> | // CHECK: llvm.mlir.global private @struct() {addr_space = 0 : i32} : !llvm.struct<packed (f32, array<10 x f32>)> | ||||
// CHECK-LABEL: @func | // CHECK-LABEL: @func | ||||
// CHECK: llvm.mlir.addressof @struct : !llvm.ptr<struct<packed (f32, array<10 x f32>)>> | // CHECK: llvm.mlir.addressof @struct : !llvm.ptr<struct<packed (f32, array<10 x f32>)>> | ||||
spv.GlobalVariable @struct : !spv.ptr<!spv.struct<(f32, !spv.array<10xf32>)>, Private> | spv.GlobalVariable @struct : !spv.ptr<!spv.struct<(f32, !spv.array<10xf32>)>, Private> | ||||
spv.func @func() "None" { | spv.func @func() "None" { | ||||
%0 = spv.mlir.addressof @struct : !spv.ptr<!spv.struct<(f32, !spv.array<10xf32>)>, Private> | %0 = spv.mlir.addressof @struct : !spv.ptr<!spv.struct<(f32, !spv.array<10xf32>)>, Private> | ||||
spv.Return | spv.Return | ||||
} | } | ||||
} | } | ||||
spv.module Logical GLSL450 { | spv.module Logical GLSL450 { | ||||
// CHECK: llvm.mlir.global external @bar_descriptor_set0_binding0() : i32 | // CHECK: llvm.mlir.global external @bar_descriptor_set0_binding0() {addr_space = 0 : i32} : i32 | ||||
// CHECK-LABEL: @foo | // CHECK-LABEL: @foo | ||||
// CHECK: llvm.mlir.addressof @bar_descriptor_set0_binding0 : !llvm.ptr<i32> | // CHECK: llvm.mlir.addressof @bar_descriptor_set0_binding0 : !llvm.ptr<i32> | ||||
spv.GlobalVariable @bar bind(0, 0) : !spv.ptr<i32, StorageBuffer> | spv.GlobalVariable @bar bind(0, 0) : !spv.ptr<i32, StorageBuffer> | ||||
spv.func @foo() "None" { | spv.func @foo() "None" { | ||||
%0 = spv.mlir.addressof @bar : !spv.ptr<i32, StorageBuffer> | %0 = spv.mlir.addressof @bar : !spv.ptr<i32, StorageBuffer> | ||||
spv.Return | spv.Return | ||||
} | } | ||||
} | } | ||||
spv.module @name Logical GLSL450 { | spv.module @name Logical GLSL450 { | ||||
// CHECK: llvm.mlir.global external @name_bar_descriptor_set0_binding0() : i32 | // CHECK: llvm.mlir.global external @name_bar_descriptor_set0_binding0() {addr_space = 0 : i32} : i32 | ||||
// CHECK-LABEL: @foo | // CHECK-LABEL: @foo | ||||
// CHECK: llvm.mlir.addressof @name_bar_descriptor_set0_binding0 : !llvm.ptr<i32> | // CHECK: llvm.mlir.addressof @name_bar_descriptor_set0_binding0 : !llvm.ptr<i32> | ||||
spv.GlobalVariable @bar bind(0, 0) : !spv.ptr<i32, StorageBuffer> | spv.GlobalVariable @bar bind(0, 0) : !spv.ptr<i32, StorageBuffer> | ||||
spv.func @foo() "None" { | spv.func @foo() "None" { | ||||
%0 = spv.mlir.addressof @bar : !spv.ptr<i32, StorageBuffer> | %0 = spv.mlir.addressof @bar : !spv.ptr<i32, StorageBuffer> | ||||
spv.Return | spv.Return | ||||
} | } | ||||
} | } | ||||
spv.module Logical GLSL450 { | spv.module Logical GLSL450 { | ||||
// CHECK: llvm.mlir.global external @bar() {location = 1 : i32} : i32 | // CHECK: llvm.mlir.global external @bar() {addr_space = 0 : i32, location = 1 : i32} : i32 | ||||
// CHECK-LABEL: @foo | // CHECK-LABEL: @foo | ||||
spv.GlobalVariable @bar {location = 1 : i32} : !spv.ptr<i32, Output> | spv.GlobalVariable @bar {location = 1 : i32} : !spv.ptr<i32, Output> | ||||
spv.func @foo() "None" { | spv.func @foo() "None" { | ||||
%0 = spv.mlir.addressof @bar : !spv.ptr<i32, Output> | %0 = spv.mlir.addressof @bar : !spv.ptr<i32, Output> | ||||
spv.Return | spv.Return | ||||
} | } | ||||
} | } | ||||
spv.module Logical GLSL450 { | spv.module Logical GLSL450 { | ||||
// CHECK: llvm.mlir.global external constant @bar() {location = 3 : i32} : f32 | // CHECK: llvm.mlir.global external constant @bar() {addr_space = 0 : i32, location = 3 : i32} : f32 | ||||
// CHECK-LABEL: @foo | // CHECK-LABEL: @foo | ||||
spv.GlobalVariable @bar {descriptor_set = 0 : i32, location = 3 : i32} : !spv.ptr<f32, UniformConstant> | spv.GlobalVariable @bar {descriptor_set = 0 : i32, location = 3 : i32} : !spv.ptr<f32, UniformConstant> | ||||
spv.func @foo() "None" { | spv.func @foo() "None" { | ||||
%0 = spv.mlir.addressof @bar : !spv.ptr<f32, UniformConstant> | %0 = spv.mlir.addressof @bar : !spv.ptr<f32, UniformConstant> | ||||
spv.Return | spv.Return | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |