Commit e96e3c0
authored
[VectorLayout] Fix insertion of new constOp for non dominate issue. (#18894)
Main motivation of this patch is to resolve issue where we have the same
constOp being used by multiple operations.
But with a twist where first time the constOp needs a layout is on a op
that topologically comes after other ops that use constOp. This will
generate a copy of constOp in the location right before the latter op,
which is problematic because this constOp will be used by other ops
before it.
Previously for the test added we get this error:
```
within split at contraction_layout.mlir:1 offset :24:10: note: see current operation: %9 = "arith.addf"(%8, %6) <{fastmath = #arith.fastmath<none>}> : (vector<96x64xf16>, vector<96x64xf16>) -> vector<96x64xf16>
within split at contraction_layout.mlir:1 offset :22:19: error: operand #1 does not dominate this use
%scaled_rhs = arith.mulf %read_1, %cst_1 : vector<96x64xf16>
```
While minor, this is also problematic because this error seem to stopped
layout analysis (but not fatally) S.T it fails to vector distribute in
some cases, making it hard to debug.
Signed-off-by: Stanley Winata <[email protected]>1 parent aef6e1f commit e96e3c0
File tree
3 files changed
+46
-4
lines changed- compiler/src/iree/compiler/Codegen/Common
- GPU/test
- test
3 files changed
+46
-4
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
467 | 508 | | |
468 | 509 | | |
469 | 510 | | |
| |||
0 commit comments