1//===- VectorTransformBase.td - Vector transform ops --------*- 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#ifndef VECTOR_TRANSFORMS_BASE 10#define VECTOR_TRANSFORMS_BASE 11 12include "mlir/IR/EnumAttr.td" 13 14// Lower transpose into element-wise extract and inserts. 15def VectorTransposeLowering_Elementwise: 16 I32EnumAttrCase<"EltWise", 0, "eltwise">; 17// Lower 2-D transpose to `vector.flat_transpose`, maps 1-1 to LLVM matrix 18// intrinsics. 19def VectorTransposeLowering_FlatTranspose: 20 I32EnumAttrCase<"Flat", 1, "flat_transpose">; 21// Lower 2-D transpose to `vector.shuffle` on 1-D vector. 22def VectorTransposeLowering_Shuffle1D: 23 I32EnumAttrCase<"Shuffle1D", 2, "shuffle_1d">; 24// Lower 2-D transpose to `vector.shuffle` on 16x16 vector. 25def VectorTransposeLowering_Shuffle16x16: 26 I32EnumAttrCase<"Shuffle16x16", 3, "shuffle_16x16">; 27def VectorTransposeLoweringAttr : I32EnumAttr< 28 "VectorTransposeLowering", 29 "control the lowering of `vector.transpose` operations.", 30 [VectorTransposeLowering_Elementwise, VectorTransposeLowering_FlatTranspose, 31 VectorTransposeLowering_Shuffle1D, VectorTransposeLowering_Shuffle16x16]> { 32 let cppNamespace = "::mlir::vector"; 33} 34 35// Lower multi_reduction into outer-reduction and inner-parallel ops. 36def VectorMultiReductionLowering_InnerParallel: 37 I32EnumAttrCase<"InnerParallel", 0, "innerparallel">; 38// Lower multi_reduction into outer-parallel and inner-reduction ops. 39def VectorMultiReductionLowering_InnerReduction: 40 I32EnumAttrCase<"InnerReduction", 1, "innerreduction">; 41def VectorMultiReductionLoweringAttr: I32EnumAttr< 42 "VectorMultiReductionLowering", 43 "control the lowering of `vector.multi_reduction`.", 44 [VectorMultiReductionLowering_InnerParallel, 45 VectorMultiReductionLowering_InnerReduction]> { 46 let cppNamespace = "::mlir::vector"; 47} 48 49// Progressively lower to finer grained `vector.contract` and dot-products. 50def VectorContractLowering_Dot: I32EnumAttrCase<"Dot", 0, "dot">; 51// Lower to `vector.matrix_multiply`, maps 1-1 to LLVM matrix intrinsics. 52def VectorContractLowering_Matmul: 53 I32EnumAttrCase<"Matmul", 1, "matmulintrinsics">; 54// Lower to `vector.outerproduct`. 55def VectorContractLowering_OuterProduct: 56 I32EnumAttrCase<"OuterProduct", 2, "outerproduct">; 57// Lower contract with all reduction dimensions unrolled to 1 to a vector 58// elementwise operations. 59def VectorContractLowering_ParallelArith: 60 I32EnumAttrCase<"ParallelArith", 3, "parallelarith">; 61def VectorContractLoweringAttr: I32EnumAttr< 62 "VectorContractLowering", 63 "control the lowering of `vector.contract` operations.", 64 [VectorContractLowering_Dot, VectorContractLowering_Matmul, 65 VectorContractLowering_OuterProduct, VectorContractLowering_ParallelArith]> { 66 let cppNamespace = "::mlir::vector"; 67} 68 69// Do not split vector transfer operations. 70def VectorTransferSplit_None: I32EnumAttrCase<"None", 0, "none">; 71// Split using in-bounds + out-of-bounds vector.transfer operations. 72def VectorTransferSplit_VectorTransfer: 73 I32EnumAttrCase<"VectorTransfer", 1, "vector-transfer">; 74// Split using an in-bounds vector.transfer + linalg.fill + linalg.copy 75// operations. 76def VectorTransferSplit_LinalgCopy: 77 I32EnumAttrCase<"LinalgCopy", 2, "linalg-copy">; 78// Do not split vector transfer operation but instead mark it as "in-bounds". 79def VectorTransferSplit_ForceInBounds: 80 I32EnumAttrCase<"ForceInBounds", 3, "force-in-bounds">; 81def VectorTransferSplitAttr: I32EnumAttr< 82 "VectorTransferSplit", 83 "control the splitting of `vector.transfer` operations into in-bounds" 84 " and out-of-bounds variants.", 85 [VectorTransferSplit_None, VectorTransferSplit_VectorTransfer, 86 VectorTransferSplit_LinalgCopy, VectorTransferSplit_ForceInBounds]> { 87 let cppNamespace = "::mlir::vector"; 88} 89#endif 90