-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MLIR][SPIRVToLLVM] Implementation of SPIR-V module conversion pattern
This patch introduces conversion patterns for `spv.module` and `spv._module_end`. SPIR-V module is converted into `ModuleOp`. This will play a role of enclosing scope to LLVM ops. At the moment, SPIR-V module attributes (such as memory model, etc) are ignored. Differential Revision: https://reviews.llvm.org/D82468
- Loading branch information
1 parent
e6a343e
commit b5c24c2
Showing
4 changed files
with
81 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// RUN: mlir-opt -convert-spirv-to-llvm %s | FileCheck %s | ||
|
||
//===----------------------------------------------------------------------===// | ||
// spv.module | ||
//===----------------------------------------------------------------------===// | ||
|
||
// CHECK: module | ||
spv.module Logical GLSL450 {} | ||
|
||
// CHECK: module | ||
spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], [SPV_KHR_16bit_storage]> {} | ||
|
||
// CHECK: module | ||
spv.module Logical GLSL450 { | ||
// CHECK: } | ||
spv._module_end | ||
} | ||
|
||
// CHECK: module | ||
spv.module Logical GLSL450 { | ||
// CHECK-LABEL: llvm.func @empty() | ||
spv.func @empty() -> () "None" { | ||
// CHECK: llvm.return | ||
spv.Return | ||
} | ||
} |