From b598f0ffca9991858f5ed2e78c8bfdcf2cffc6e5 Mon Sep 17 00:00:00 2001 From: Quentin Bourgerie Date: Fri, 12 Nov 2021 09:11:22 +0100 Subject: [PATCH] refactor(compiler): Move the conversion from scf to std on the pipeline intead of embedded in a pass --- .../MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp | 2 -- compiler/lib/Support/Pipeline.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp b/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp index 83d8f4dd8..e147b7d38 100644 --- a/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp +++ b/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp @@ -7,7 +7,6 @@ #include "mlir/Conversion/LLVMCommon/ConversionTarget.h" #include "mlir/Conversion/LLVMCommon/TypeConverter.h" #include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h" -#include "mlir/Conversion/SCFToStandard/SCFToStandard.h" #include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h" #include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" @@ -53,7 +52,6 @@ void MLIRLowerableDialectsToLLVMPass::runOnOperation() { // Setup the set of the patterns rewriter. At this point we want to // convert the `scf` operations to `std` and `std` operations to `llvm`. mlir::RewritePatternSet patterns(&getContext()); - mlir::populateLoopToStdConversionPatterns(patterns); mlir::populateStdToLLVMConversionPatterns(typeConverter, patterns); mlir::arith::populateArithmeticToLLVMConversionPatterns(typeConverter, patterns); diff --git a/compiler/lib/Support/Pipeline.cpp b/compiler/lib/Support/Pipeline.cpp index e367d1f5a..310247e25 100644 --- a/compiler/lib/Support/Pipeline.cpp +++ b/compiler/lib/Support/Pipeline.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include #include @@ -164,6 +165,7 @@ lowerStdToLLVMDialect(mlir::MLIRContext &context, mlir::ModuleOp &module, addPotentiallyNestedPass(pm, mlir::createFuncBufferizePass(), enablePass); addPotentiallyNestedPass(pm, mlir::createFinalizingBufferizePass(), enablePass); + addPotentiallyNestedPass(pm, mlir::createLowerToCFGPass(), enablePass); // Convert to MLIR LLVM Dialect addPotentiallyNestedPass(