-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathPolygeistPasses.td
More file actions
64 lines (56 loc) · 2.44 KB
/
PolygeistPasses.td
File metadata and controls
64 lines (56 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef MLIR_CONVERSION_POLYGEISTPASSES
#define MLIR_CONVERSION_POLYGEISTPASSES
include "mlir/Pass/PassBase.td"
include "mlir/Rewrite/PassUtil.td"
def ConvertPolygeistToLLVM : Pass<"convert-polygeist-to-llvm", "mlir::ModuleOp"> {
let summary = "Convert scalar and vector operations from the Standard to the "
"LLVM dialect";
let description = [{
Convert standard operations into the LLVM IR dialect operations.
#### Input invariant
- operations including: arithmetic on integers and floats, constants,
direct calls, returns and branches;
- no `tensor` types;
- all `vector` are one-dimensional;
- all blocks are reachable by following the successors of the first basic
block;
If other operations are present and their results are required by the LLVM
IR dialect operations, the pass will fail. Any LLVM IR operations or types
already present in the IR will be kept as is.
#### Output IR
Functions converted to LLVM IR. Function arguments types are converted
one-to-one. Function results are converted one-to-one and, in case more than
1 value is returned, packed into an LLVM IR struct type. Function calls and
returns are updated accordingly. Block argument types are updated to use
LLVM IR types.
}];
let constructor = "mlir::polygeist::createConvertPolygeistToLLVMPass()";
let dependentDialects = [
"polygeist::PolygeistDialect",
"func::FuncDialect",
"LLVM::LLVMDialect",
"memref::MemRefDialect",
"gpu::GPUDialect",
"arith::ArithDialect",
"cf::ControlFlowDialect",
"scf::SCFDialect",
];
let options = [
Option<"useBarePtrCallConv", "use-bare-ptr-memref-call-conv", "bool",
/*default=*/"false",
"Replace FuncOp's MemRef arguments with bare pointers to the MemRef "
"element types">,
Option<"indexBitwidth", "index-bitwidth", "unsigned",
/*default=kDeriveIndexBitwidthFromDataLayout*/"0",
"Bitwidth of the index type, 0 to use size of machine word">,
Option<"dataLayout", "data-layout", "std::string",
/*default=*/"\"\"",
"String description (LLVM format) of the data layout that is "
"expected on the produced module">,
Option<"useCStyleMemRef", "use-c-style-memref", "bool",
/*default=*/"true",
"Use C-style nested-array lowering of memref instead of "
"the default MLIR descriptor structure">
];
}
#endif