Cleanup after going to `llvm` dialect.

This reduces IR size a lot, which can help when staring at it.
pull/1/head
Sean Silva 2020-07-13 16:15:42 -07:00
parent d0f15d2cec
commit a9d7610f9d
1 changed files with 8 additions and 1 deletions

View File

@ -432,7 +432,7 @@ void mlir::NPCOMP::createE2ELoweringPipeline(
// pass that checks no !shape.shape types left.
pm.addPass(createLowerRankedShapesPass());
// Run a some final cleanups.
// Run a some cleanups.
if (options.optimize) {
pm.addPass(createCanonicalizerPass());
pm.addPass(createCSEPass());
@ -449,4 +449,11 @@ void mlir::NPCOMP::createE2ELoweringPipeline(
// which reuses the upstream patterns and gives us a place to add our own
// patterns for any custom ops and types we wish to lower.
pm.addPass(createLowerToLLVMPass());
// Although LLVM will clean everything up eventually, for the sake of IR
// clarity while still in MLIR, run some cleanups.
if (options.optimize) {
pm.addPass(createCanonicalizerPass());
pm.addPass(createCSEPass());
}
}