Add some cleanup passes.

This makes the IR more presentable before going to the next phase of
lowering (ops on memref/buffers -> LLVM ops).
pull/1/head
Sean Silva 2020-05-11 15:27:37 -07:00
parent 83db558db9
commit 174ab19c5f
1 changed files with 6 additions and 0 deletions

View File

@ -49,6 +49,7 @@
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassRegistry.h"
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Transforms/Passes.h"
#include "npcomp/Conversion/TCFToTCP/TCFToTCP.h"
#include "npcomp/Conversion/TCPToLinalg/TCPToLinalg.h"
#include "npcomp/Dialect/TCP/IR/TCPDialect.h"
@ -249,6 +250,11 @@ void mlir::NPCOMP::createE2ELoweringPipeline(OpPassManager &pm) {
// planning on just inlining the islands, so there is little value in
// doing this, but we should look at the layering aspects here later.
// At this point, we have loose shape calculations floating around, so
// it's a good time to do some general cleanups.
pm.addPass(createCanonicalizerPass());
pm.addPass(createCSEPass());
// TODO:
// lower linalg to loops: mlir::createConvertLinalgToLoopsPass()
// lower shape stuff to ssa values.