Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Conversion/Passes.td
Show First 20 Lines • Show All 486 Lines • ▼ Show 20 Lines | let dependentDialects = [ | |||||||||||
"vector::VectorDialect", | "vector::VectorDialect", | |||||||||||
]; | ]; | |||||||||||
} | } | |||||||||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | |||||||||||
// MathToLLVM | // MathToLLVM | |||||||||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | |||||||||||
def ConvertMathToLLVM : Pass<"convert-math-to-llvm"> { | def ConvertMathToLLVM : Pass<"convert-math-to-llvm"> { | |||||||||||
Mogball: Please change this back to a generic pass. | ||||||||||||
let summary = "Convert Math dialect to LLVM dialect"; | let summary = "Convert Math dialect to LLVM dialect"; | |||||||||||
let description = [{ | let description = [{ | |||||||||||
This pass converts supported Math ops to LLVM dialect intrinsics. | This pass converts supported Math ops to LLVM dialect intrinsics. | |||||||||||
}]; | }]; | |||||||||||
let constructor = "mlir::createConvertMathToLLVMPass()"; | let constructor = "mlir::createConvertMathToLLVMPass()"; | |||||||||||
let dependentDialects = ["LLVM::LLVMDialect"]; | let dependentDialects = ["LLVM::LLVMDialect"]; | |||||||||||
} | } | |||||||||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | |||||||||||
// MathToSPIRV | // MathToSPIRV | |||||||||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | |||||||||||
def ConvertMathToSPIRV : Pass<"convert-math-to-spirv"> { | def ConvertMathToSPIRV : Pass<"convert-math-to-spirv"> { | |||||||||||
let summary = "Convert Math dialect to SPIR-V dialect"; | let summary = "Convert Math dialect to SPIR-V dialect"; | |||||||||||
let constructor = "mlir::createConvertMathToSPIRVPass()"; | let constructor = "mlir::createConvertMathToSPIRVPass()"; | |||||||||||
let dependentDialects = ["spirv::SPIRVDialect"]; | let dependentDialects = ["spirv::SPIRVDialect"]; | |||||||||||
} | } | |||||||||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | |||||||||||
// MathToFuncs | ||||||||||||
//===----------------------------------------------------------------------===// | ||||||||||||
def ConvertMathToFuncs : Pass<"convert-math-to-funcs", "ModuleOp"> { | ||||||||||||
let summary = "Convert Math operations to calls of outlined implementations"; | ||||||||||||
Mogball: | ||||||||||||
let description = [{ | ||||||||||||
This pass converts supported Math ops to calls of compiler generated | ||||||||||||
functions implementing these operations. | ||||||||||||
MogballUnsubmitted
Mogball: | ||||||||||||
LLVMDialect is used for LinkonceODR linkage of the generated functions. | ||||||||||||
Why is this type of linkage needed? It's unfortunate that this pass depends on the LLVM dialect just for this. Mogball: Why is this type of linkage needed? It's unfortunate that this pass depends on the LLVM dialect… | ||||||||||||
In FuncToLLVM conversion all func.func operations have external linkage by default. We cannot use external linkage for the generated functions, because there may be multiple definitions in different translation modules and the linking will fail. So we have to specify either internal or linkonce_odr linkage - the latter is better, because it allows the linker to keep only one copy of the generated function across multiple modules being linked. I do not know of any other way to control linkage in MLIR. vzakhari: In `FuncToLLVM` conversion all `func.func` operations have external linkage by default. We… | ||||||||||||
Adding linkage to FuncDialect appears to be a TODO. It's fine for now then. Mogball: Adding linkage to FuncDialect appears to be a TODO. It's fine for now then. | ||||||||||||
Mogball: | ||||||||||||
}]; | ||||||||||||
let constructor = "mlir::createConvertMathToFuncsPass()"; | ||||||||||||
let dependentDialects = [ | ||||||||||||
"arith::ArithmeticDialect", | ||||||||||||
"cf::ControlFlowDialect", | ||||||||||||
"func::FuncDialect", | ||||||||||||
"vector::VectorDialect", | ||||||||||||
"LLVM::LLVMDialect", | ||||||||||||
]; | ||||||||||||
} | ||||||||||||
//===----------------------------------------------------------------------===// | ||||||||||||
// MemRefToLLVM | // MemRefToLLVM | |||||||||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | |||||||||||
def ConvertMemRefToLLVM : Pass<"convert-memref-to-llvm", "ModuleOp"> { | def ConvertMemRefToLLVM : Pass<"convert-memref-to-llvm", "ModuleOp"> { | |||||||||||
let summary = "Convert operations from the MemRef dialect to the LLVM " | let summary = "Convert operations from the MemRef dialect to the LLVM " | |||||||||||
"dialect"; | "dialect"; | |||||||||||
let constructor = "mlir::createMemRefToLLVMPass()"; | let constructor = "mlir::createMemRefToLLVMPass()"; | |||||||||||
let dependentDialects = ["LLVM::LLVMDialect"]; | let dependentDialects = ["LLVM::LLVMDialect"]; | |||||||||||
▲ Show 20 Lines • Show All 448 Lines • Show Last 20 Lines |
Please change this back to a generic pass.