llvm-project/mlir/test/Target/SPIRV/entry-point.mlir
rkayaith e4889c0a04 [mlir][spirv] Change translation to use spirv.module
Update the SPIRV `mlir-translate` translations to translate to/from
`spirv.module` instead of `builtin.module`. This simplifies the
translation since the code no longer needs to walk the module looking
for a SPIRV module, however it requires passing `-no-implicit-module` to
all the tests.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D135819
2022-11-08 14:47:01 -05:00

28 lines
1.1 KiB
MLIR

// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s
spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader], []> {
spirv.func @noop() -> () "None" {
spirv.Return
}
// CHECK: spirv.EntryPoint "GLCompute" @noop
// CHECK-NEXT: spirv.ExecutionMode @noop "ContractionOff"
spirv.EntryPoint "GLCompute" @noop
spirv.ExecutionMode @noop "ContractionOff"
}
// -----
spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader], []> {
// CHECK: spirv.GlobalVariable @var2 : !spirv.ptr<f32, Input>
// CHECK-NEXT: spirv.GlobalVariable @var3 : !spirv.ptr<f32, Output>
// CHECK-NEXT: spirv.func @noop({{%.*}}: !spirv.ptr<f32, Input>, {{%.*}}: !spirv.ptr<f32, Output>) "None"
// CHECK: spirv.EntryPoint "GLCompute" @noop, @var2, @var3
spirv.GlobalVariable @var2 : !spirv.ptr<f32, Input>
spirv.GlobalVariable @var3 : !spirv.ptr<f32, Output>
spirv.func @noop(%arg0 : !spirv.ptr<f32, Input>, %arg1 : !spirv.ptr<f32, Output>) -> () "None" {
spirv.Return
}
spirv.EntryPoint "GLCompute" @noop, @var2, @var3
spirv.ExecutionMode @noop "ContractionOff"
}