Fix compilation issues due to llvm-project version bump.

* Redundant infer type implementations removed.
* Update to the linalg GenericOp build calls.
pull/2/head
Stella Laurenzo 2020-08-01 15:23:57 -07:00
parent c695db7ae7
commit 9d5d802cc8
3 changed files with 7 additions and 34 deletions

View File

@ -91,8 +91,7 @@ def TCP_GetGlobalMemrefOp : TCP_Op<"get_global_memref"> {
// produce the error in practice. The ops like shape.broadcast itself, when
// lowered, immediately produce errors.
// TODO: This should eventually be moved to a shape dialect.
def TCP_ShapeObserveErrorOp : TCP_Op<"shape_observe_error",
[DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
def TCP_ShapeObserveErrorOp : TCP_Op<"shape_observe_error", []> {
let summary = "Observes the fact that a shape might be an error.";
let description = [{
This op is a structural placeholder that captures a shape such that it
@ -110,8 +109,7 @@ def TCP_ShapeObserveErrorOp : TCP_Op<"shape_observe_error",
}
// TODO: This probably belongs in the shape dialect.
def TCP_GetExtentOp : TCP_Op<"get_extent",
[NoSideEffect, DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
def TCP_GetExtentOp : TCP_Op<"get_extent", [NoSideEffect]> {
let summary = "Gets the specified extent from a shape.";
let description = [{
Gets the specified extent from a shape.

View File

@ -31,11 +31,11 @@ public:
auto genericOp = rewriter.create<linalg::GenericOp>(
op.getLoc(), llvm::makeArrayRef({op.getType()}),
ValueRange({op.lhs(), op.rhs()}),
/*args_in=*/rewriter.getI64IntegerAttr(2),
/*args_out=*/rewriter.getI64IntegerAttr(1),
/*indexing_maps=*/rewriter.getAffineMapArrayAttr(accesses),
/*iterator_types=*/rewriter.getStrArrayAttr(iterators), /*doc=*/nullptr,
/*library_call=*/nullptr);
/*args_in=*/2,
/*args_out=*/1,
/*indexing_maps=*/accesses,
/*iterator_types=*/iterators,
/*function_ref=*/nullptr);
Region &region = genericOp.region();
Block *block = rewriter.createBlock(&region, region.begin());

View File

@ -58,31 +58,6 @@ static LogicalResult verifyGetGlobalMemrefOp(GetGlobalMemrefOp op) {
return success();
}
//===----------------------------------------------------------------------===//
// ShapeObserveErrorOp
//===----------------------------------------------------------------------===//
LogicalResult ShapeObserveErrorOp::inferReturnTypes(
MLIRContext *context, Optional<Location> location, ValueRange operands,
DictionaryAttr attributes, RegionRange regions,
SmallVectorImpl<Type> &inferredReturnTypes) {
inferredReturnTypes.push_back(NoneType::get(context));
return success();
}
//===----------------------------------------------------------------------===//
// GetExtentOp
//===----------------------------------------------------------------------===//
LogicalResult
GetExtentOp::inferReturnTypes(MLIRContext *context, Optional<Location> location,
ValueRange operands, DictionaryAttr attributes,
RegionRange regions,
SmallVectorImpl<Type> &inferredReturnTypes) {
inferredReturnTypes.push_back(IndexType::get(context));
return success();
}
namespace mlir {
namespace NPCOMP {
namespace tcp {