diff --git a/mlir/lib/Target/SPIRV/TranslateRegistration.cpp b/mlir/lib/Target/SPIRV/TranslateRegistration.cpp --- a/mlir/lib/Target/SPIRV/TranslateRegistration.cpp +++ b/mlir/lib/Target/SPIRV/TranslateRegistration.cpp @@ -51,17 +51,7 @@ auto binary = llvm::makeArrayRef(reinterpret_cast(start), size / sizeof(uint32_t)); - - OwningOpRef spirvModule = - spirv::deserialize(binary, context); - if (!spirvModule) - return {}; - - OwningOpRef module(ModuleOp::create(FileLineColLoc::get( - context, input->getBufferIdentifier(), /*line=*/0, /*column=*/0))); - module->getBody()->push_front(spirvModule.release()); - - return std::move(module); + return spirv::deserialize(binary, context); } namespace mlir { @@ -80,22 +70,10 @@ // Serialization registration //===----------------------------------------------------------------------===// -static LogicalResult serializeModule(ModuleOp module, raw_ostream &output) { - if (!module) - return failure(); - +static LogicalResult serializeModule(spirv::ModuleOp module, + raw_ostream &output) { SmallVector binary; - - SmallVector spirvModules; - module.walk([&](spirv::ModuleOp op) { spirvModules.push_back(op); }); - - if (spirvModules.empty()) - return module.emitError("found no 'spirv.module' op"); - - if (spirvModules.size() != 1) - return module.emitError("found more than one 'spirv.module' op"); - - if (failed(spirv::serialize(spirvModules[0], binary))) + if (failed(spirv::serialize(module, binary))) return failure(); output.write(reinterpret_cast(binary.data()), @@ -108,7 +86,7 @@ void registerToSPIRVTranslation() { TranslateFromMLIRRegistration toBinary( "serialize-spirv", "serialize SPIR-V dialect", - [](ModuleOp module, raw_ostream &output) { + [](spirv::ModuleOp module, raw_ostream &output) { return serializeModule(module, output); }, [](DialectRegistry ®istry) { @@ -121,21 +99,14 @@ // Round-trip registration //===----------------------------------------------------------------------===// -static LogicalResult roundTripModule(ModuleOp srcModule, bool emitDebugInfo, +static LogicalResult roundTripModule(spirv::ModuleOp module, bool emitDebugInfo, raw_ostream &output) { SmallVector binary; - MLIRContext *context = srcModule.getContext(); - auto spirvModules = srcModule.getOps(); - - if (spirvModules.begin() == spirvModules.end()) - return srcModule.emitError("found no 'spirv.module' op"); - - if (std::next(spirvModules.begin()) != spirvModules.end()) - return srcModule.emitError("found more than one 'spirv.module' op"); + MLIRContext *context = module->getContext(); spirv::SerializationOptions options; options.emitDebugInfo = emitDebugInfo; - if (failed(spirv::serialize(*spirvModules.begin(), binary, options))) + if (failed(spirv::serialize(module, binary, options))) return failure(); MLIRContext deserializationContext(context->getDialectRegistry()); @@ -146,15 +117,7 @@ spirv::deserialize(binary, &deserializationContext); if (!spirvModule) return failure(); - - // Wrap around in a new MLIR module. - OwningOpRef dstModule(ModuleOp::create( - FileLineColLoc::get(&deserializationContext, - /*filename=*/"", /*line=*/0, /*column=*/0))); - dstModule->getBody()->push_front(spirvModule.release()); - if (failed(verify(*dstModule))) - return failure(); - dstModule->print(output); + spirvModule->print(output); return mlir::success(); } @@ -163,7 +126,7 @@ void registerTestRoundtripSPIRV() { TranslateFromMLIRRegistration roundtrip( "test-spirv-roundtrip", "test roundtrip in SPIR-V dialect", - [](ModuleOp module, raw_ostream &output) { + [](spirv::ModuleOp module, raw_ostream &output) { return roundTripModule(module, /*emitDebugInfo=*/false, output); }, [](DialectRegistry ®istry) { @@ -174,7 +137,7 @@ void registerTestRoundtripDebugSPIRV() { TranslateFromMLIRRegistration roundtrip( "test-spirv-roundtrip-debug", "test roundtrip debug in SPIR-V", - [](ModuleOp module, raw_ostream &output) { + [](spirv::ModuleOp module, raw_ostream &output) { return roundTripModule(module, /*emitDebugInfo=*/true, output); }, [](DialectRegistry ®istry) { diff --git a/mlir/test/Target/SPIRV/arithmetic-ops.mlir b/mlir/test/Target/SPIRV/arithmetic-ops.mlir --- a/mlir/test/Target/SPIRV/arithmetic-ops.mlir +++ b/mlir/test/Target/SPIRV/arithmetic-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @fmul(%arg0 : f32, %arg1 : f32) "None" { diff --git a/mlir/test/Target/SPIRV/array.mlir b/mlir/test/Target/SPIRV/array.mlir --- a/mlir/test/Target/SPIRV/array.mlir +++ b/mlir/test/Target/SPIRV/array.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @array_stride(%arg0 : !spirv.ptr, stride=128>, StorageBuffer>, %arg1 : i32, %arg2 : i32) "None" { diff --git a/mlir/test/Target/SPIRV/atomic-ops.mlir b/mlir/test/Target/SPIRV/atomic-ops.mlir --- a/mlir/test/Target/SPIRV/atomic-ops.mlir +++ b/mlir/test/Target/SPIRV/atomic-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @test_int_atomics diff --git a/mlir/test/Target/SPIRV/barrier-ops.mlir b/mlir/test/Target/SPIRV/barrier-ops.mlir --- a/mlir/test/Target/SPIRV/barrier-ops.mlir +++ b/mlir/test/Target/SPIRV/barrier-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @memory_barrier_0() -> () "None" { diff --git a/mlir/test/Target/SPIRV/bit-ops.mlir b/mlir/test/Target/SPIRV/bit-ops.mlir --- a/mlir/test/Target/SPIRV/bit-ops.mlir +++ b/mlir/test/Target/SPIRV/bit-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @bitcount(%arg: i32) -> i32 "None" { diff --git a/mlir/test/Target/SPIRV/cast-ops.mlir b/mlir/test/Target/SPIRV/cast-ops.mlir --- a/mlir/test/Target/SPIRV/cast-ops.mlir +++ b/mlir/test/Target/SPIRV/cast-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @bit_cast(%arg0 : f32) "None" { diff --git a/mlir/test/Target/SPIRV/composite-op.mlir b/mlir/test/Target/SPIRV/composite-op.mlir --- a/mlir/test/Target/SPIRV/composite-op.mlir +++ b/mlir/test/Target/SPIRV/composite-op.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @composite_insert(%arg0 : !spirv.struct<(f32, !spirv.struct<(!spirv.array<4xf32>, f32)>)>, %arg1: !spirv.array<4xf32>) -> !spirv.struct<(f32, !spirv.struct<(!spirv.array<4xf32>, f32)>)> "None" { diff --git a/mlir/test/Target/SPIRV/constant.mlir b/mlir/test/Target/SPIRV/constant.mlir --- a/mlir/test/Target/SPIRV/constant.mlir +++ b/mlir/test/Target/SPIRV/constant.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @bool_const diff --git a/mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir b/mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir --- a/mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir +++ b/mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @cooperative_matrix_load diff --git a/mlir/test/Target/SPIRV/debug.mlir b/mlir/test/Target/SPIRV/debug.mlir --- a/mlir/test/Target/SPIRV/debug.mlir +++ b/mlir/test/Target/SPIRV/debug.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip-debug -mlir-print-debuginfo -mlir-print-local-scope %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip-debug -mlir-print-debuginfo -mlir-print-local-scope %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: loc({{".*debug.mlir"}}:5:3) diff --git a/mlir/test/Target/SPIRV/decorations.mlir b/mlir/test/Target/SPIRV/decorations.mlir --- a/mlir/test/Target/SPIRV/decorations.mlir +++ b/mlir/test/Target/SPIRV/decorations.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: location = 0 : i32 diff --git a/mlir/test/Target/SPIRV/entry-point.mlir b/mlir/test/Target/SPIRV/entry-point.mlir --- a/mlir/test/Target/SPIRV/entry-point.mlir +++ b/mlir/test/Target/SPIRV/entry-point.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @noop() -> () "None" { diff --git a/mlir/test/Target/SPIRV/execution-mode.mlir b/mlir/test/Target/SPIRV/execution-mode.mlir --- a/mlir/test/Target/SPIRV/execution-mode.mlir +++ b/mlir/test/Target/SPIRV/execution-mode.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @foo() -> () "None" { diff --git a/mlir/test/Target/SPIRV/function-call.mlir b/mlir/test/Target/SPIRV/function-call.mlir --- a/mlir/test/Target/SPIRV/function-call.mlir +++ b/mlir/test/Target/SPIRV/function-call.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.GlobalVariable @var1 : !spirv.ptr, Input> diff --git a/mlir/test/Target/SPIRV/gl-ops.mlir b/mlir/test/Target/SPIRV/gl-ops.mlir --- a/mlir/test/Target/SPIRV/gl-ops.mlir +++ b/mlir/test/Target/SPIRV/gl-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @math(%arg0 : f32, %arg1 : f32, %arg2 : i32) "None" { diff --git a/mlir/test/Target/SPIRV/global-variable.mlir b/mlir/test/Target/SPIRV/global-variable.mlir --- a/mlir/test/Target/SPIRV/global-variable.mlir +++ b/mlir/test/Target/SPIRV/global-variable.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s // CHECK: spirv.GlobalVariable @var0 bind(1, 0) : !spirv.ptr // CHECK-NEXT: spirv.GlobalVariable @var1 bind(0, 1) : !spirv.ptr diff --git a/mlir/test/Target/SPIRV/group-ops.mlir b/mlir/test/Target/SPIRV/group-ops.mlir --- a/mlir/test/Target/SPIRV/group-ops.mlir +++ b/mlir/test/Target/SPIRV/group-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @subgroup_ballot diff --git a/mlir/test/Target/SPIRV/image-ops.mlir b/mlir/test/Target/SPIRV/image-ops.mlir --- a/mlir/test/Target/SPIRV/image-ops.mlir +++ b/mlir/test/Target/SPIRV/image-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @image(%arg0 : !spirv.sampled_image>, %arg1 : vector<4xf32>, %arg2 : f32) "None" { diff --git a/mlir/test/Target/SPIRV/image.mlir b/mlir/test/Target/SPIRV/image.mlir --- a/mlir/test/Target/SPIRV/image.mlir +++ b/mlir/test/Target/SPIRV/image.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: !spirv.ptr, UniformConstant> diff --git a/mlir/test/Target/SPIRV/invalid-module.mlir b/mlir/test/Target/SPIRV/invalid-module.mlir --- a/mlir/test/Target/SPIRV/invalid-module.mlir +++ b/mlir/test/Target/SPIRV/invalid-module.mlir @@ -1,4 +1,4 @@ // RUN: mlir-translate %s -serialize-spirv -no-implicit-module -verify-diagnostics -// expected-error@below {{expected a 'builtin.module' op, got 'spirv.module'}} -spirv.module Logical Simple {} +// expected-error@below {{expected a 'spirv.module' op, got 'builtin.module'}} +module {} diff --git a/mlir/test/Target/SPIRV/joint-matrix-ops.mlir b/mlir/test/Target/SPIRV/joint-matrix-ops.mlir --- a/mlir/test/Target/SPIRV/joint-matrix-ops.mlir +++ b/mlir/test/Target/SPIRV/joint-matrix-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @joint_matrix_load diff --git a/mlir/test/Target/SPIRV/logical-ops.mlir b/mlir/test/Target/SPIRV/logical-ops.mlir --- a/mlir/test/Target/SPIRV/logical-ops.mlir +++ b/mlir/test/Target/SPIRV/logical-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @iequal_scalar(%arg0: i32, %arg1: i32) "None" { diff --git a/mlir/test/Target/SPIRV/loop.mlir b/mlir/test/Target/SPIRV/loop.mlir --- a/mlir/test/Target/SPIRV/loop.mlir +++ b/mlir/test/Target/SPIRV/loop.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s // Single loop diff --git a/mlir/test/Target/SPIRV/matrix.mlir b/mlir/test/Target/SPIRV/matrix.mlir --- a/mlir/test/Target/SPIRV/matrix.mlir +++ b/mlir/test/Target/SPIRV/matrix.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @matrix_access_chain diff --git a/mlir/test/Target/SPIRV/memory-ops.mlir b/mlir/test/Target/SPIRV/memory-ops.mlir --- a/mlir/test/Target/SPIRV/memory-ops.mlir +++ b/mlir/test/Target/SPIRV/memory-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { diff --git a/mlir/test/Target/SPIRV/module.mlir b/mlir/test/Target/SPIRV/module.mlir --- a/mlir/test/Target/SPIRV/module.mlir +++ b/mlir/test/Target/SPIRV/module.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s // CHECK: spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-NEXT: spirv.func @foo() "Inline" { diff --git a/mlir/test/Target/SPIRV/non-uniform-ops.mlir b/mlir/test/Target/SPIRV/non-uniform-ops.mlir --- a/mlir/test/Target/SPIRV/non-uniform-ops.mlir +++ b/mlir/test/Target/SPIRV/non-uniform-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @group_non_uniform_ballot diff --git a/mlir/test/Target/SPIRV/ocl-ops.mlir b/mlir/test/Target/SPIRV/ocl-ops.mlir --- a/mlir/test/Target/SPIRV/ocl-ops.mlir +++ b/mlir/test/Target/SPIRV/ocl-ops.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Physical64 OpenCL requires #spirv.vce { spirv.func @float_insts(%arg0 : f32) "None" { diff --git a/mlir/test/Target/SPIRV/phi.mlir b/mlir/test/Target/SPIRV/phi.mlir --- a/mlir/test/Target/SPIRV/phi.mlir +++ b/mlir/test/Target/SPIRV/phi.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s // Test branch with one block argument diff --git a/mlir/test/Target/SPIRV/sampled-image.mlir b/mlir/test/Target/SPIRV/sampled-image.mlir --- a/mlir/test/Target/SPIRV/sampled-image.mlir +++ b/mlir/test/Target/SPIRV/sampled-image.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: !spirv.ptr>, UniformConstant> diff --git a/mlir/test/Target/SPIRV/selection.mlir b/mlir/test/Target/SPIRV/selection.mlir --- a/mlir/test/Target/SPIRV/selection.mlir +++ b/mlir/test/Target/SPIRV/selection.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s // Selection with both then and else branches diff --git a/mlir/test/Target/SPIRV/spec-constant.mlir b/mlir/test/Target/SPIRV/spec-constant.mlir --- a/mlir/test/Target/SPIRV/spec-constant.mlir +++ b/mlir/test/Target/SPIRV/spec-constant.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: spirv.SpecConstant @sc_true = true diff --git a/mlir/test/Target/SPIRV/struct.mlir b/mlir/test/Target/SPIRV/struct.mlir --- a/mlir/test/Target/SPIRV/struct.mlir +++ b/mlir/test/Target/SPIRV/struct.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: !spirv.ptr [0])>, Input> diff --git a/mlir/test/Target/SPIRV/terminator.mlir b/mlir/test/Target/SPIRV/terminator.mlir --- a/mlir/test/Target/SPIRV/terminator.mlir +++ b/mlir/test/Target/SPIRV/terminator.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @ret diff --git a/mlir/test/Target/SPIRV/undef.mlir b/mlir/test/Target/SPIRV/undef.mlir --- a/mlir/test/Target/SPIRV/undef.mlir +++ b/mlir/test/Target/SPIRV/undef.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s +// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @foo() -> () "None" {