Skip to content

Commit

Permalink
remove usage of SCFDialect (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwc authored Sep 12, 2024
1 parent f26ad2f commit 73c9028
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
2 changes: 0 additions & 2 deletions nautilus/src/nautilus/compiler/backends/mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ if (ENABLE_MLIR_BACKEND)
MLIRExecutionEngine
MLIRFuncAllExtensions
# Dialects
MLIRSCFDialect
MLIRFuncToLLVM
MLIRSCFToControlFlow
)

add_source_files(nautilus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <mlir/Dialect/Func/IR/FuncOps.h>
#include <mlir/Dialect/LLVMIR/LLVMDialect.h>
#include <mlir/Dialect/LLVMIR/LLVMTypes.h>
#include <mlir/Dialect/SCF/IR/SCF.h>
#include <mlir/IR/Attributes.h>
#include <mlir/IR/Builders.h>
#include <mlir/IR/BuiltinAttributes.h>
Expand Down Expand Up @@ -212,7 +211,6 @@ MLIRLoweringProvider::MLIRLoweringProvider(mlir::MLIRContext& context) : context
builder->getContext()->loadDialect<mlir::cf::ControlFlowDialect>();
builder->getContext()->loadDialect<mlir::LLVM::LLVMDialect>();
builder->getContext()->loadDialect<mlir::func::FuncDialect>();
builder->getContext()->loadDialect<mlir::scf::SCFDialect>();
this->theModule = mlir::ModuleOp::create(getNameLoc("module"));
// Store InsertPoint for inserting globals such as Strings or TupleBuffers.
globalInsertPoint = new mlir::RewriterBase::InsertPoint(theModule.getBody(), theModule.begin());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "nautilus/exceptions/NotImplementedException.hpp"
#include <mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h>
#include <mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h>
#include <mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h>
#include <mlir/ExecutionEngine/OptUtils.h>
#include <mlir/Pass/PassManager.h>
#include <mlir/Transforms/Passes.h>
Expand All @@ -25,8 +24,6 @@ std::unique_ptr<mlir::Pass> getMLIRLoweringPass(MLIRPassManager::LoweringPass lo
switch (loweringPass) {
case MLIRPassManager::LoweringPass::LLVM:
return mlir::createConvertControlFlowToLLVMPass();
case MLIRPassManager::LoweringPass::SCF:
return mlir::createConvertSCFToCFPass();
}
throw NotImplementedException("pass is not supported");
}
Expand Down Expand Up @@ -64,7 +61,6 @@ int MLIRPassManager::lowerAndOptimizeMLIRModule(mlir::OwningOpRef<mlir::ModuleOp
passManager.addPass(getMLIRLoweringPass(loweringPass));
}
} else {
passManager.addPass(mlir::createConvertSCFToCFPass());
passManager.addPass(mlir::createConvertFuncToLLVMPass());
passManager.addPass(mlir::createConvertControlFlowToLLVMPass());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace nautilus::compiler::mlir {
// and applies configured lowering & optimization passes to it.
class MLIRPassManager {
public:
enum class LoweringPass : uint8_t { SCF, LLVM };
enum class LoweringPass : uint8_t { LLVM };
enum class OptimizationPass : uint8_t { Inline };

MLIRPassManager(); // Disable default constructor
Expand Down

0 comments on commit 73c9028

Please sign in to comment.