29 lines · plain
1// RUN: mlir-opt %s -pass-pipeline='builtin.module(builtin.module(test-dynamic-pipeline{op-name=inner_mod1 dynamic-pipeline=cse}))' --mlir-disable-threading -mlir-print-ir-before-all 2>&1 | FileCheck %s --check-prefix=NOTNESTED --check-prefix=CHECK2// RUN: mlir-opt %s -pass-pipeline='builtin.module(builtin.module(test-dynamic-pipeline{op-name=inner_mod1 run-on-nested-operations=1 dynamic-pipeline=cse}))' --mlir-disable-threading -mlir-print-ir-before-all 2>&1 | FileCheck %s --check-prefix=NESTED --check-prefix=CHECK3 4 5// Verify that we can schedule a dynamic pipeline on a nested operation6 7func.func @f() {8 return9}10 11// CHECK: IR Dump Before12// CHECK-SAME: TestDynamicPipelinePass13// CHECK-NEXT: module @inner_mod114module @inner_mod1 {15// We use the mlir-print-ir-after-all dumps to check the granularity of the16// scheduling: if we are nesting we expect to see to individual "Dump Before17// CSE" output: one for each of the function. If we don't nest, then we expect18// the CSE pass to run on the `inner_mod1` module directly.19 20// CHECK: Dump Before CSE21// NOTNESTED-NEXT: @inner_mod122// NESTED-NEXT: @foo23 module @foo {}24// Only in the nested case we have a second run of the pass here.25// NESTED: Dump Before CSE26// NESTED-NEXT: @baz27 module @baz {}28}29