Files
clang-p2996/mlir/test/Transforms/composite-pass.mlir
Ivan Butygin 5b66b6a32a [mlir][pass] Add composite pass utility (#87166)
Composite pass allows to run sequence of passes in the loop until fixed
point or maximum number of iterations is reached. The usual candidates
are canonicalize+CSE as canonicalize can open more opportunities for CSE
and vice-versa.
2024-04-02 13:30:45 +03:00

27 lines
883 B
MLIR

// RUN: mlir-opt %s --log-actions-to=- --test-composite-fixed-point-pass -split-input-file | FileCheck %s
// RUN: mlir-opt %s --log-actions-to=- --composite-fixed-point-pass='name=TestCompositePass pipeline=any(canonicalize,cse)' -split-input-file | FileCheck %s
// CHECK-LABEL: running `TestCompositePass`
// CHECK: running `Canonicalizer`
// CHECK: running `CSE`
// CHECK-NOT: running `Canonicalizer`
// CHECK-NOT: running `CSE`
func.func @test() {
return
}
// -----
// CHECK-LABEL: running `TestCompositePass`
// CHECK: running `Canonicalizer`
// CHECK: running `CSE`
// CHECK: running `Canonicalizer`
// CHECK: running `CSE`
// CHECK-NOT: running `Canonicalizer`
// CHECK-NOT: running `CSE`
func.func @test() {
// this constant will be canonicalized away, causing another pass iteration
%0 = arith.constant 1.5 : f32
return
}