Differential D115491 Diff 393462 mlir/test/Dialect/Linalg/comprehensive-module-bufferize-invalid.mlir
Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Dialect/Linalg/comprehensive-module-bufferize-invalid.mlir
Show All 32 Lines | ^bb2: | ||||
return %t2, %t1 : tensor<f32>, tensor<f32> | return %t2, %t1 : tensor<f32>, tensor<f32> | ||||
} | } | ||||
// ----- | // ----- | ||||
func @scf_if_not_equivalent( | func @scf_if_not_equivalent( | ||||
%cond: i1, %t1: tensor<?xf32> {linalg.inplaceable = true}, | %cond: i1, %t1: tensor<?xf32> {linalg.inplaceable = true}, | ||||
%idx: index) -> tensor<?xf32> { | %idx: index) -> tensor<?xf32> { | ||||
// expected-error @+1 {{result buffer is ambiguous}} | |||||
%r = scf.if %cond -> (tensor<?xf32>) { | %r = scf.if %cond -> (tensor<?xf32>) { | ||||
scf.yield %t1 : tensor<?xf32> | scf.yield %t1 : tensor<?xf32> | ||||
} else { | } else { | ||||
// This buffer aliases, but is not equivalent. | // This buffer aliases, but is not equivalent. | ||||
%t2 = tensor.extract_slice %t1 [%idx] [%idx] [1] : tensor<?xf32> to tensor<?xf32> | %t2 = tensor.extract_slice %t1 [%idx] [%idx] [1] : tensor<?xf32> to tensor<?xf32> | ||||
// expected-error @+1 {{Yield operand #0 does not bufferize to a buffer that is equivalent to a buffer defined outside of the scf::if op}} | |||||
scf.yield %t2 : tensor<?xf32> | scf.yield %t2 : tensor<?xf32> | ||||
} | } | ||||
return %r : tensor<?xf32> | return %r : tensor<?xf32> | ||||
} | } | ||||
// ----- | // ----- | ||||
// expected-error @-3 {{expected callgraph to be free of circular dependencies}} | // expected-error @-3 {{expected callgraph to be free of circular dependencies}} | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | func @extract_slice_fun(%A : tensor<?xf32> {linalg.inplaceable = true}) | ||||
// argument aliasing). | // argument aliasing). | ||||
%r0 = tensor.extract_slice %A[0][4][1] : tensor<?xf32> to tensor<4xf32> | %r0 = tensor.extract_slice %A[0][4][1] : tensor<?xf32> to tensor<4xf32> | ||||
return %r0: tensor<4xf32> | return %r0: tensor<4xf32> | ||||
} | } | ||||
// ----- | // ----- | ||||
// expected-error @+1 {{memref return type is unsupported}} | |||||
func @scf_yield(%b : i1, %A : tensor<4xf32>, %B : tensor<4xf32>) -> tensor<4xf32> | func @scf_yield(%b : i1, %A : tensor<4xf32>, %B : tensor<4xf32>) -> tensor<4xf32> | ||||
{ | { | ||||
// expected-error @+1 {{result buffer is ambiguous}} | |||||
%r = scf.if %b -> (tensor<4xf32>) { | %r = scf.if %b -> (tensor<4xf32>) { | ||||
scf.yield %A : tensor<4xf32> | scf.yield %A : tensor<4xf32> | ||||
} else { | } else { | ||||
scf.yield %B : tensor<4xf32> | scf.yield %B : tensor<4xf32> | ||||
} | } | ||||
return %r: tensor<4xf32> | return %r: tensor<4xf32> | ||||
} | } | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |