Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Conversion/CFToHandshake/CFToHandshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ void removeBasicBlocks(handshake::FuncOp funcOp) {
}

static LogicalResult isValidMemrefType(Location loc, mlir::MemRefType type) {
if (type.getNumDynamicDims() != 0 || type.getShape().size() != 1)
return emitError(loc) << "memref's must be both statically sized and "
"unidimensional.";
// if (type.getNumDynamicDims() != 0 || type.getShape().size() != 1)
// return emitError(loc) << "memref's must be both statically sized and "
// "unidimensional.";
return success();
}

Expand Down
10 changes: 5 additions & 5 deletions lib/Dialect/Handshake/HandshakeOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,11 +986,11 @@ std::string handshake::MemoryOp::getResultName(unsigned int idx) {
LogicalResult MemoryOp::verify() {
auto memrefType = getMemRefType();

if (memrefType.getNumDynamicDims() != 0)
return emitOpError()
<< "memref dimensions for handshake.memory must be static.";
if (memrefType.getShape().size() != 1)
return emitOpError() << "memref must have only a single dimension.";
// if (memrefType.getNumDynamicDims() != 0)
// return emitOpError()
// << "memref dimensions for handshake.memory must be static.";
// if (memrefType.getShape().size() != 1)
// return emitOpError() << "memref must have only a single dimension.";

unsigned opStCount = getStCount();
unsigned opLdCount = getLdCount();
Expand Down
29 changes: 0 additions & 29 deletions test/Conversion/CFToHandshake/invalid.mlir
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
// RUN: circt-opt -lower-cf-to-handshake %s -split-input-file -verify-diagnostics

func.func @multidim() -> i32 {
// expected-error @+1 {{memref's must be both statically sized and unidimensional.}}
%0 = memref.alloc() : memref<2x2xi32>
%idx = arith.constant 0 : index
%1 = memref.load %0[%idx, %idx] : memref<2x2xi32>
return %1 : i32
}

// -----

func.func @dynsize(%dyn : index) -> i32{
// expected-error @+1 {{memref's must be both statically sized and unidimensional.}}
%0 = memref.alloc(%dyn) : memref<?xi32>
%idx = arith.constant 0 : index
%1 = memref.load %0[%idx] : memref<?xi32>
return %1 : i32
}

// -----

func.func @singleton() -> (){
// expected-error @+1 {{memref's must be both statically sized and unidimensional.}}
%0 = memref.alloc() : memref<i32>
%1 = memref.load %0[] : memref<i32>
return
}

// -----

func.func @non_canon_loop(%arg0 : memref<100xi32>, %arg1 : i32) -> i32 {
// expected-error @below {{expected cmerges to have two operands}}
%c0_i32 = arith.constant 0 : i32
Expand Down
16 changes: 0 additions & 16 deletions test/Dialect/Handshake/errors.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,6 @@ handshake.func @invalid_instance_op(%ctrl : none) -> none {

// -----

handshake.func @invalid_multidim_memory(%ctrl : none) -> none {
// expected-error @+1 {{'handshake.memory' op memref must have only a single dimension.}}
memory [ld = 0, st = 0] () {id = 0 : i32, lsq = false} : memref<10x10xi8>, () -> ()
return %ctrl : none
}

// -----

handshake.func @invalid_missing_lsq(%ctrl : none) -> none {
// expected-error @+1 {{'handshake.memory' op requires attribute 'lsq'}}
memory [ld = 0, st = 0] () {id = 0 : i32} : memref<10xi8>, () -> ()
Expand All @@ -119,14 +111,6 @@ handshake.func @invalid_missing_lsq(%ctrl : none) -> none {

// -----

handshake.func @invalid_dynamic_memory(%ctrl : none) -> none {
// expected-error @+1 {{'handshake.memory' op memref dimensions for handshake.memory must be static.}}
memory [ld = 0, st = 0] () {id = 0 : i32, lsq = false} : memref<?xi8>, () -> ()
return %ctrl : none
}

// -----

// expected-error @+1 {{'handshake.func' op attribute 'argNames' has 2 entries but is expected to have 3.}}
handshake.func @invalid_num_argnames(%a : i32, %b : i32, %c : none) -> none attributes {argNames = ["a", "b"]} {
return %c : none
Expand Down