brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 6b25a20 Raw
53 lines · cpp
1//===- ArmSVEDialect.cpp - MLIR ArmSVE dialect implementation -------------===//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-exception6//7//===----------------------------------------------------------------------===//8//9// This file implements the ArmSVE dialect and its operations.10//11//===----------------------------------------------------------------------===//12 13#include "mlir/Dialect/ArmSVE/IR/ArmSVEDialect.h"14#include "mlir/Dialect/LLVMIR/LLVMTypes.h"15#include "mlir/Dialect/Vector/IR/VectorOps.h"16#include "mlir/IR/Builders.h"17#include "mlir/IR/TypeUtilities.h"18 19using namespace mlir;20using namespace mlir::arm_sve;21 22//===----------------------------------------------------------------------===//23// ScalableVector versions of general helpers for comparison ops24//===----------------------------------------------------------------------===//25 26/// Return the scalable vector of the same shape and containing i1.27static Type getI1SameShape(Type type) {28  auto i1Type = IntegerType::get(type.getContext(), 1);29  if (auto sVectorType = llvm::dyn_cast<VectorType>(type))30    return VectorType::get(sVectorType.getShape(), i1Type,31                           sVectorType.getScalableDims());32  return nullptr;33}34 35//===----------------------------------------------------------------------===//36// Tablegen Definitions37//===----------------------------------------------------------------------===//38 39#include "mlir/Dialect/ArmSVE/IR/ArmSVEDialect.cpp.inc"40 41#define GET_OP_CLASSES42#include "mlir/Dialect/ArmSVE/IR/ArmSVE.cpp.inc"43 44#define GET_TYPEDEF_CLASSES45#include "mlir/Dialect/ArmSVE/IR/ArmSVETypes.cpp.inc"46 47void ArmSVEDialect::initialize() {48  addOperations<49#define GET_OP_LIST50#include "mlir/Dialect/ArmSVE/IR/ArmSVE.cpp.inc"51      >();52}53