The masked op can currently not bufferize out-of-place. Such IR would be rejected by the One-Shot Bufferize because it would mean that a new buffer allocation is yielded from a block. Furthermore, only one operation is currently allowed inside `vector.mask`. Differential Revision: https://reviews.llvm.org/D141686
10 lines
467 B
MLIR
10 lines
467 B
MLIR
// RUN: mlir-opt %s -vector-bufferize -split-input-file -verify-diagnostics
|
|
// | FileCheck %s
|
|
|
|
// CHECK-LABEL: func @mask(
|
|
func.func @mask(%t0: tensor<?xf32>, %val: vector<16xf32>, %idx: index, %m0: vector<16xi1>) -> tensor<?xf32> {
|
|
// expected-error @+1 {{'vector.mask' op body must bufferize in-place}}
|
|
%0 = vector.mask %m0 { vector.transfer_write %val, %t0[%idx] : vector<16xf32>, tensor<?xf32> } : vector<16xi1> -> tensor<?xf32>
|
|
return %0 : tensor<?xf32>
|
|
}
|