Skip to content

Commit 9e24980

Browse files
ftynsewsmoses
authored andcommitted
Use symbol-DCE pass instead of inefficient custom code
1 parent aa4972f commit 9e24980

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

lib/polygeist/Passes/ParallelLower.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -520,14 +520,6 @@ void ParallelLower::runOnOperation() {
520520
}
521521
});
522522

523-
auto ST = symbolTable.getSymbolTable(getOperation());
524-
for (auto f : toErase) {
525-
bool empty = ST.symbolKnownUseEmpty(f, getOperation());
526-
if (empty) {
527-
f->erase();
528-
}
529-
}
530-
531523
// Fold the copy memtype cast
532524
{
533525
mlir::RewritePatternSet rpl(getOperation()->getContext());

tools/mlir-clang/mlir-clang.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ int main(int argc, char **argv) {
487487
mlir::OpPassManager &optPM = pm.nest<mlir::FuncOp>();
488488
optPM.addPass(mlir::createCanonicalizerPass());
489489
pm.addPass(polygeist::createParallelLowerPass());
490+
pm.addPass(mlir::createSymbolDCEPass());
490491
mlir::OpPassManager &noptPM = pm.nest<mlir::FuncOp>();
491492
noptPM.addPass(mlir::createCanonicalizerPass());
492493
noptPM.addPass(polygeist::createMem2RegPass());

0 commit comments

Comments
 (0)