Skip to content

Commit

Permalink
Running cleanup prior to iree-stream-outline-constants.
Browse files Browse the repository at this point in the history
This ensures that any constant folding/hoisting/etc has completed prior
to outlining constants.
  • Loading branch information
benvanik authored and stellaraccident committed Aug 2, 2023
1 parent 48f85e3 commit 45e9ff4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ void buildStreamTensorPassPipeline(OpPassManager &passManager,
// Verify we support the program.
passManager.addPass(IREE::Stream::createVerifyInputPass());

// Cleanup the program prior to outlining constants in case there is
// propagation or fusion that needs to happen first.
addCleanupPatterns(passManager);

// Turn all constant ops into global variables and fix up the IR.
// As many locations change and constants are deduplicated we'll end up with
// a lot of extraneous IR (mostly global loads) and clean those up here.
passManager.addPass(IREE::Stream::createOutlineConstantsPass());

// Perform cleanup after constnat simplification as more canonicalizers may be
// Perform cleanup after constant simplification as more canonicalizers may be
// able to kick in.
addCleanupPatterns(passManager);

Expand Down

0 comments on commit 45e9ff4

Please sign in to comment.