Commit 4c0f2a7
committed
[mlir][vector] Convert vector.transfer_read to scalar load and broadcast
If we use vector.transfer_read to read from a 0-d value, we can convert it
to memref.load from the 0-d value then broadcast the value to the target
vector type.
It can avoid generating vector operations breaking the requirements of
convertVectorToMMAOps. The patterns in convertVectorToMMAOps expect all
vector.transfer_read have 2-D vector types.
Instead of
%s0 = vector.transfer_read %base[] : memref<dtype> to vector<dtype>
%s1 = vector.broadcast %s0 : vector<dtype> to vector<d0...d1 x dtype>
Use
%s0 = memref.load %base[] : memref<dtype>
%s1 = vector.broadcast %s0 : dtype to vector<d0...d1 x dtype>1 parent d6315a2 commit 4c0f2a7
File tree
2 files changed
+47
-11
lines changed- mlir
- lib/Dialect/Vector/Transforms
- test/Dialect/Vector
2 files changed
+47
-11
lines changedLines changed: 29 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
374 | 392 | | |
375 | 393 | | |
376 | 394 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
391 | 409 | | |
392 | 410 | | |
393 | 411 | | |
| |||
0 commit comments