Commit 7c08a8b
committed
[mlir][vector] Clarify the semantics of BroadcastOp
Clarifies the semantics of `vector.broadcast` in the context of scalable
vectors. In particular, broadcasting a unit scalable dim, `[1]`, is not
valid unless there's a match between the output and the input dims.
See the examples below for an illustration:
```mlir
// VALID
%0 = vector.broadcast %arg0 : vector<[1]xf32> to vector<4x[1]xf32>
// INVALID
%0 = vector.broadcast %arg0 : vector<[1]xf32> to vector<[4]xf32>
// VALID FIXED-WIDTH EQUIVALENT
%0 = vector.broadcast %arg0 : vector<1xf32> to vector<4xf32>
```
Documentation, the Op verifier and tests are updated accordingly.1 parent 0dcada9 commit 7c08a8b
File tree
4 files changed
+56
-11
lines changed- mlir
- include/mlir/Dialect/Vector/IR
- lib/Dialect/Vector/IR
- test/Dialect/Vector
4 files changed
+56
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | | - | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
370 | 372 | | |
371 | 373 | | |
372 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2371 | 2371 | | |
2372 | 2372 | | |
2373 | 2373 | | |
2374 | | - | |
2375 | | - | |
2376 | | - | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
2377 | 2377 | | |
2378 | 2378 | | |
2379 | 2379 | | |
| |||
2391 | 2391 | | |
2392 | 2392 | | |
2393 | 2393 | | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
2394 | 2397 | | |
2395 | 2398 | | |
2396 | | - | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
2397 | 2410 | | |
2398 | | - | |
2399 | | - | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
2400 | 2416 | | |
2401 | 2417 | | |
2402 | 2418 | | |
| |||
2406 | 2422 | | |
2407 | 2423 | | |
2408 | 2424 | | |
2409 | | - | |
| 2425 | + | |
2410 | 2426 | | |
2411 | 2427 | | |
2412 | 2428 | | |
2413 | 2429 | | |
2414 | 2430 | | |
2415 | 2431 | | |
2416 | | - | |
2417 | | - | |
2418 | | - | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
2419 | 2444 | | |
2420 | 2445 | | |
2421 | 2446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
| |||
0 commit comments