Files
clang-p2996/mlir/test/Dialect/Vector/vector-materialize-mask.mlir
Oleksandr "Alex" Zinenko 5a9bdd85ee [mlir] split transform interfaces into a separate library (#85221)
Transform interfaces are implemented, direction or via extensions, in
libraries belonging to multiple other dialects. Those dialects don't
need to depend on the non-interface part of the transform dialect, which
includes the growing number of ops and transitive dependency footprint.

Split out the interfaces into a separate library. This in turn requires
flipping the dependency from the interface on the dialect that has crept
in because both co-existed in one library. The interface shouldn't
depend on the transform dialect either.

As a consequence of splitting, the capability of the interpreter to
automatically walk the payload IR to identify payload ops of a certain
kind based on the type used for the entry point symbol argument is
disabled. This is a good move by itself as it simplifies the interpreter
logic. This functionality can be trivially replaced by a
`transform.structured.match` operation.
2024-03-20 22:15:17 +01:00

24 lines
985 B
MLIR

// RUN: mlir-opt %s --transform-interpreter --split-input-file | FileCheck %s
func.func @select_single_i1_vector(%cond : i1) -> vector<1xi1> {
%true = arith.constant dense<true> : vector<1xi1>
%false = arith.constant dense<false> : vector<1xi1>
%select = arith.select %cond, %true, %false : i1, vector<1xi1>
return %select : vector<1xi1>
}
module attributes {transform.with_named_sequence} {
transform.named_sequence @__transform_main(%root : !transform.any_op {transform.readonly}) {
%func_op = transform.structured.match ops{["func.func"]} in %root : (!transform.any_op) -> !transform.op<"func.func">
transform.apply_patterns to %func_op {
transform.apply_patterns.vector.materialize_masks
} : !transform.op<"func.func">
transform.yield
}
}
// CHECK-LABEL: func @select_single_i1_vector
// CHECK-SAME: %[[COND:.*]]: i1
// CHECK: %[[BCAST:.*]] = vector.broadcast %[[COND]] : i1 to vector<1xi1>
// CHECK: return %[[BCAST]] : vector<1xi1>