Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir-translate] Support parsing operations other than 'builtin.modul…
…e' as top-level This adds a '--no-implicit-module' option, which disables the insertion of a top-level 'builtin.module' during parsing. The translation APIs are also updated to take/return 'Operation*' instead of 'ModuleOp', to allow other operation types to be used. To simplify translations which are restricted to specific operation types, 'TranslateFromMLIRRegistration' has an overload which performs the necessary cast and error checking. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D134237
- Loading branch information
Showing
10 changed files
with
62 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// RUN: mlir-translate -verify-diagnostics -mlir-to-llvmir --no-implicit-module %s | ||
|
||
// expected-error@below {{'llvm.func' op can not be translated to an LLVMIR module}} | ||
llvm.func @foo() { | ||
llvm.return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 {} |