[mlir] [VectorOps] Expose lowering pass options programmatically
The ConvertVectorToLLVM pass defines options that can be passed on the command line (currently only reassociation of FP reductions through -convert-vector-to-llvm='reassociate-fp-reductions). This CL enables setting these options programmatically (forward looking to more options than just reassociation, as well as setting the values from code rather than command line). Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D83420
This commit is contained in:
@@ -1180,6 +1180,9 @@ void mlir::populateVectorToLLVMMatrixConversionPatterns(
|
||||
namespace {
|
||||
struct LowerVectorToLLVMPass
|
||||
: public ConvertVectorToLLVMBase<LowerVectorToLLVMPass> {
|
||||
LowerVectorToLLVMPass(const LowerVectorToLLVMOptions &options) {
|
||||
this->reassociateFPReductions = options.reassociateFPReductions;
|
||||
}
|
||||
void runOnOperation() override;
|
||||
};
|
||||
} // namespace
|
||||
@@ -1210,6 +1213,7 @@ void LowerVectorToLLVMPass::runOnOperation() {
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<OperationPass<ModuleOp>> mlir::createConvertVectorToLLVMPass() {
|
||||
return std::make_unique<LowerVectorToLLVMPass>();
|
||||
std::unique_ptr<OperationPass<ModuleOp>>
|
||||
mlir::createConvertVectorToLLVMPass(const LowerVectorToLLVMOptions &options) {
|
||||
return std::make_unique<LowerVectorToLLVMPass>(options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user