Skip to content

Commit

Permalink
Enable arithmetic optimizations as part of the stream simplification …
Browse files Browse the repository at this point in the history
…pipeline. (#18806)

I ran this on some relatively large models and couldn't really discern a
performance difference at the whole model level.

This unblocks a number of latent optimizations in the pipeline.
Specifically, the compiler will now very often discover that dispatch
arguments are only 32bit, elide the high bits and then cast from i32 in
the dispatch.

Signed-off-by: Stella Laurenzo <[email protected]>
  • Loading branch information
stellaraccident authored Oct 17, 2024
1 parent 929a7da commit 05bbcf1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ static void addCleanupPatterns(OpPassManager &passManager) {
.addPass(mlir::createCanonicalizerPass)
.addPass(mlir::createCSEPass)

// Integer optimizations. These operate best on a canonical form both
// for performance (post-simplifications cause less analysis) and
// simplified pattern matching.
.addPass(IREE::Util::createOptimizeIntArithmeticPass)

// Simplify util.global accesses; this can help with data flow tracking as
// redundant store-loads are removed.
.addPass(IREE::Util::createSimplifyGlobalAccessesPass);
Expand Down

0 comments on commit 05bbcf1

Please sign in to comment.