[Mlir-commits] [mlir] cde203e - [mlir][Pass] Coalesce dynamic pass pipelines before running

River Riddle llvmlistbot at llvm.org
Fri Mar 19 14:35:55 PDT 2021


Author: River Riddle
Date: 2021-03-19T14:35:42-07:00
New Revision: cde203e0f9438a4bba3b9b50bd437444852b9909

URL: https://github.com/llvm/llvm-project/commit/cde203e0f9438a4bba3b9b50bd437444852b9909
DIFF: https://github.com/llvm/llvm-project/commit/cde203e0f9438a4bba3b9b50bd437444852b9909.diff

LOG: [mlir][Pass] Coalesce dynamic pass pipelines before running

This was missed when dynamic pass pipelines were added, and is necessary for maximizing the performance/parallelism potential of the pass pipeline.

Added: 
    

Modified: 
    mlir/lib/Pass/Pass.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Pass/Pass.cpp b/mlir/lib/Pass/Pass.cpp
index 8507fd6d3451..7e9e3b569962 100644
--- a/mlir/lib/Pass/Pass.cpp
+++ b/mlir/lib/Pass/Pass.cpp
@@ -381,6 +381,10 @@ LogicalResult OpToOpPassAdaptor::run(Pass *pass, Operation *op,
                 "nested under the current operation the pass is processing";
     assert(pipeline.getOpName() == root->getName().getStringRef());
 
+    // Before running, make sure to coalesce any adjacent pass adaptors in the
+    // pipeline.
+    pipeline.getImpl().coalesceAdjacentAdaptorPasses();
+
     // Initialize the user provided pipeline and execute the pipeline.
     if (failed(pipeline.initialize(root->getContext(), parentInitGeneration)))
       return failure();


        


More information about the Mlir-commits mailing list