This commit shuffles SPIR-V code around to better follow MLIR
convention. Specifically,
* Created IR/, Transforms/, Linking/, and Utils/ subdirectories and
moved suitable code inside.
* Created SPIRVEnums.{h|cpp} for SPIR-V C/C++ enums generated from
SPIR-V spec. Previously they are cluttered inside SPIRVTypes.{h|cpp}.
* Fixed include guards in various header files (both .h and .td).
* Moved serialization tests under test/Target/SPIRV.
* Renamed TableGen backend -gen-spirv-op-utils into -gen-spirv-attr-utils
as it is only generating utility functions for attributes.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D93407
28 lines
1.1 KiB
MLIR
28 lines
1.1 KiB
MLIR
// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s
|
|
|
|
spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
|
|
spv.func @noop() -> () "None" {
|
|
spv.Return
|
|
}
|
|
// CHECK: spv.EntryPoint "GLCompute" @noop
|
|
// CHECK-NEXT: spv.ExecutionMode @noop "ContractionOff"
|
|
spv.EntryPoint "GLCompute" @noop
|
|
spv.ExecutionMode @noop "ContractionOff"
|
|
}
|
|
|
|
// -----
|
|
|
|
spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
|
|
// CHECK: spv.globalVariable @var2 : !spv.ptr<f32, Input>
|
|
// CHECK-NEXT: spv.globalVariable @var3 : !spv.ptr<f32, Output>
|
|
// CHECK-NEXT: spv.func @noop({{%.*}}: !spv.ptr<f32, Input>, {{%.*}}: !spv.ptr<f32, Output>) "None"
|
|
// CHECK: spv.EntryPoint "GLCompute" @noop, @var2, @var3
|
|
spv.globalVariable @var2 : !spv.ptr<f32, Input>
|
|
spv.globalVariable @var3 : !spv.ptr<f32, Output>
|
|
spv.func @noop(%arg0 : !spv.ptr<f32, Input>, %arg1 : !spv.ptr<f32, Output>) -> () "None" {
|
|
spv.Return
|
|
}
|
|
spv.EntryPoint "GLCompute" @noop, @var2, @var3
|
|
spv.ExecutionMode @noop "ContractionOff"
|
|
}
|