2020-05-07 09:41:54 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "npcomp/Dialect/TCP/IR/TCPOps.h"
|
2020-05-12 12:22:40 +08:00
|
|
|
#include "mlir/Dialect/Shape/IR/Shape.h"
|
2020-05-07 09:41:54 +08:00
|
|
|
|
|
|
|
using namespace mlir;
|
|
|
|
using namespace mlir::NPCOMP;
|
|
|
|
using namespace mlir::NPCOMP::tcp;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2020-05-19 04:35:25 +08:00
|
|
|
// ShapeObserveErrorOp
|
2020-05-07 09:41:54 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-05-19 04:35:25 +08:00
|
|
|
LogicalResult ShapeObserveErrorOp::inferReturnTypes(
|
2020-05-07 09:41:54 +08:00
|
|
|
MLIRContext *context, Optional<Location> location, ValueRange operands,
|
2020-05-09 11:42:40 +08:00
|
|
|
DictionaryAttr attributes, RegionRange regions,
|
2020-05-07 09:41:54 +08:00
|
|
|
SmallVectorImpl<Type> &inferredReturnTypes) {
|
|
|
|
inferredReturnTypes.push_back(NoneType::get(context));
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// GetExtentOp
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
LogicalResult GetExtentOp::inferReturnTypes(
|
|
|
|
MLIRContext *context, Optional<Location> location, ValueRange operands,
|
2020-05-09 11:42:40 +08:00
|
|
|
DictionaryAttr attributes, RegionRange regions,
|
2020-05-07 09:41:54 +08:00
|
|
|
SmallVectorImpl<Type> &inferredReturnTypes) {
|
|
|
|
inferredReturnTypes.push_back(IndexType::get(context));
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace mlir {
|
|
|
|
namespace NPCOMP {
|
|
|
|
namespace tcp {
|
|
|
|
#define GET_OP_CLASSES
|
|
|
|
#include "npcomp/Dialect/TCP/IR/TCPOps.cpp.inc"
|
|
|
|
} // namespace tcp
|
|
|
|
} // namespace NPCOMP
|
|
|
|
} // namespace mlir
|