147cbd9f9SNicolas Vasilache //===- VectorInterfaces.cpp - Unrollable vector operations -*- C++ -*-===// 247cbd9f9SNicolas Vasilache // 347cbd9f9SNicolas Vasilache // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 447cbd9f9SNicolas Vasilache // See https://llvm.org/LICENSE.txt for license information. 547cbd9f9SNicolas Vasilache // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 647cbd9f9SNicolas Vasilache // 747cbd9f9SNicolas Vasilache //===----------------------------------------------------------------------===// 847cbd9f9SNicolas Vasilache 947cbd9f9SNicolas Vasilache #include "mlir/Interfaces/VectorInterfaces.h" 1047cbd9f9SNicolas Vasilache 1147cbd9f9SNicolas Vasilache using namespace mlir; 1247cbd9f9SNicolas Vasilache transferMaskType(VectorType vecType,AffineMap map)13c52cbe63SMatthias SpringerVectorType mlir::vector::detail::transferMaskType(VectorType vecType, 14c52cbe63SMatthias Springer AffineMap map) { 15c52cbe63SMatthias Springer auto i1Type = IntegerType::get(map.getContext(), 1); 16c52cbe63SMatthias Springer SmallVector<int64_t, 8> shape; 17c52cbe63SMatthias Springer for (int64_t i = 0; i < vecType.getRank(); ++i) { 18c52cbe63SMatthias Springer // Only result dims have a corresponding dim in the mask. 199b77be55SMatthias Springer if (map.getResult(i).template isa<AffineDimExpr>()) { 20c52cbe63SMatthias Springer shape.push_back(vecType.getDimSize(i)); 21c52cbe63SMatthias Springer } 22c52cbe63SMatthias Springer } 23*c537a943SNicolas Vasilache return VectorType::get(shape, i1Type); 24c52cbe63SMatthias Springer } 25c52cbe63SMatthias Springer 2647cbd9f9SNicolas Vasilache //===----------------------------------------------------------------------===// 2747cbd9f9SNicolas Vasilache // VectorUnroll Interfaces 2847cbd9f9SNicolas Vasilache //===----------------------------------------------------------------------===// 2947cbd9f9SNicolas Vasilache 3041b09f4eSKazuaki Ishizaki /// Include the definitions of the VectorUnroll interfaces. 3147cbd9f9SNicolas Vasilache #include "mlir/Interfaces/VectorInterfaces.cpp.inc" 32