diff options
| author | Aart Bik <ajcbik@google.com> | 2019-11-26 19:52:02 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-11-26 19:52:38 -0800 |
| commit | e2232fbcee8a4bf4e2a6ab181f8fabb57633dda6 (patch) | |
| tree | 826c3e2f33dab6d38433ac7fa6ec6f9d81c6d72c /mlir/test/Dialect/VectorOps | |
| parent | f27ceb726188d0b16c979fddf644e33886139006 (diff) | |
| download | bcm5719-llvm-e2232fbcee8a4bf4e2a6ab181f8fabb57633dda6.tar.gz bcm5719-llvm-e2232fbcee8a4bf4e2a6ab181f8fabb57633dda6.zip | |
[VectorOps] Refine BroadcastOp in VectorOps dialect
Since second argument is always fully overwritten and
shape is define in "to" clause, it is not needed.
Also renamed "into" to "to" now that arg is dropped.
PiperOrigin-RevId: 282686475
Diffstat (limited to 'mlir/test/Dialect/VectorOps')
| -rw-r--r-- | mlir/test/Dialect/VectorOps/invalid.mlir | 4 | ||||
| -rw-r--r-- | mlir/test/Dialect/VectorOps/ops.mlir | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/mlir/test/Dialect/VectorOps/invalid.mlir b/mlir/test/Dialect/VectorOps/invalid.mlir index 92e956ef29a..d672b1bf140 100644 --- a/mlir/test/Dialect/VectorOps/invalid.mlir +++ b/mlir/test/Dialect/VectorOps/invalid.mlir @@ -2,9 +2,9 @@ // ----- -func @broadcast_rank_too_high(%arg0: vector<4x4xf32>, %arg1: vector<4xf32>) { +func @broadcast_rank_too_high(%arg0: vector<4x4xf32>) { // expected-error@+1 {{source rank higher than destination rank}} - %2 = vector.broadcast %arg0, %arg1 : vector<4x4xf32> into vector<4xf32> + %1 = vector.broadcast %arg0 : vector<4x4xf32> to vector<4xf32> } // ----- diff --git a/mlir/test/Dialect/VectorOps/ops.mlir b/mlir/test/Dialect/VectorOps/ops.mlir index 51dbc4f0435..d167559ac0c 100644 --- a/mlir/test/Dialect/VectorOps/ops.mlir +++ b/mlir/test/Dialect/VectorOps/ops.mlir @@ -23,12 +23,12 @@ func @vector_transfer_ops(%arg0: memref<?x?xf32>) { } // CHECK-LABEL: @vector_broadcast -func @vector_broadcast(%a: f32, %b: vector<16xf32>, %c: vector<8x16xf32>) { - // CHECK: vector.broadcast %{{.*}}, %{{.*}} : f32 into vector<16xf32> - %0 = vector.broadcast %a, %b : f32 into vector<16xf32> - // CHECK-NEXT: vector.broadcast %{{.*}}, %{{.*}} : vector<16xf32> into vector<8x16xf32> - %1 = vector.broadcast %b, %c : vector<16xf32> into vector<8x16xf32> - return +func @vector_broadcast(%a: f32, %b: vector<16xf32>) -> vector<8x16xf32> { + // CHECK: vector.broadcast %{{.*}} : f32 to vector<16xf32> + %0 = vector.broadcast %a : f32 to vector<16xf32> + // CHECK-NEXT: vector.broadcast %{{.*}} : vector<16xf32> to vector<8x16xf32> + %1 = vector.broadcast %b : vector<16xf32> to vector<8x16xf32> + return %1 : vector<8x16xf32> } // CHECK-LABEL: @extractelement |

