1//===-- Passes.td - TOSA optimization pass declarations ----*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the optimization passes for the TOSA Dialect in MLIR.
10//
11//===----------------------------------------------------------------------===//
12
13include "mlir/Pass/PassBase.td"
14
15def TosaMakeBroadcastable : FunctionPass<"tosa-make-broadcastable"> {
16  let summary = "TOSA rank Reshape to enable Broadcasting";
17  let description = [{
18    Pass that enables broadcast by making all input arrays have the same
19    number of dimensions. Insert RESHAPE operations to prepend dimensions
20    of size one until the number of dimensions is equal. Implements
21    approach similar to step 1 of Numpy 4-step broadcasting:
22    https://numpy.org/doc/stable/reference/ufuncs.html#broadcasting
23  }];
24
25  let constructor = "createTosaMakeBroadcastablePass()";
26}
27