Commit 048922e
authored
[mlir][memref-to-spirv]: Remap Image Load Coordinates (llvm#160495)
When converting a `memref.load` from the image address space to a
`spirv.ImageFetch` ensure that we correctly map the load indices to
width, height and depth.
The lowering currently assumes a linear image tiling, that is row-major
memory layout. This allows us to support any memref layout that is a
permutation of the dimensions, more complex layouts are not currently
supported. Because the ordering of the dimensions in the vector passed
to image fetch is the opposite to that in the memref directions a final
reversal of the mapped dimensions is always required.
---------
Signed-off-by: Jack Frankland <[email protected]>1 parent 55054db commit 048922e
File tree
2 files changed
+197
-62
lines changed- mlir
- lib/Conversion/MemRefToSPIRV
- test/Conversion/MemRefToSPIRV
2 files changed
+197
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
702 | 731 | | |
703 | 732 | | |
704 | 733 | | |
| |||
755 | 784 | | |
756 | 785 | | |
757 | 786 | | |
758 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
759 | 794 | | |
760 | 795 | | |
761 | 796 | | |
762 | | - | |
763 | | - | |
764 | | - | |
| 797 | + | |
765 | 798 | | |
766 | 799 | | |
767 | 800 | | |
| |||
0 commit comments