| Issue |
60940
|
| Summary |
both of affine.ama_op and memref.dma_op missing sideeffect traits
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
lipracer
|
When I write the dataflow analysis to eliminate the common express`memref.dma_start %arg1[%8], %2[%c0], %14, %15[%c0] : memref<9408xf32>, memref<192xf32, 2>, memref<0xf32, 2>` and `memref.dma_start %arg1[%8], %2[%c0], %14, %16[%c0] : memref<9408xf32>, memref<192xf32, 2>, memref<0xf32, 2>`.I think the `dma.startOp`'s `srcMemref` should has `ReadEffect` and the `dstMemref` should has the `writeEffect`,but unfortunate those has not yet.
```
func.fuc @main(%arg0: memref<1xf32>, %arg1: memref<9408xf32>, %arg2: memref<9408xf32>, %arg3: memref<9408xf32>, %arg4: memref<9408xf32>, %arg5: memref<9408xf32>) {
%c32 = arith.constant 32 : index
%c9408 = arith.constant 9408 : index
%c-2048 = arith.constant -2048 : index
%c2048 = arith.constant 2048 : index
%c-32 = arith.constant -32 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = memref.alloc() {alignment = 16 : i64} : memref<1024xf32, 2>
%1 = memref.subview %0[960] [1] [1] : memref<1024xf32, 2> to memref<1xf32, #map, 2>
%2 = memref.subview %0[0] [192] [1] : memref<1024xf32, 2> to memref<192xf32, 2>
%3 = call @cluster_id() : () -> index
%4 = call @core_id() : () -> index
%5 = memref.alloc() {alignment = 16 : i64} : memref<0xf32, 2>
memref.dma_start %arg0[%c0], %1[%c0], %c1, %5[%c0] : memref<1xf32>, memref<1xf32, #map, 2>, memref<0xf32, 2>
%6 = arith.muli %3, %c2048 : index
%7 = arith.muli %4, %c32 : index
%8 = arith.addi %6, %7 : index
%9 = arith.muli %3, %c-2048 : index
%10 = arith.muli %4, %c-32 : index
%11 = arith.addi %9, %10 : index
%12 = arith.addi %11, %c9408 : index
%13 = arith.cmpi slt, %12, %c32 : index
%14 = select %13, %12, %c32 : index
%15 = memref.alloc() {alignment = 16 : i64} : memref<0xf32, 2>
memref.dma_start %arg1[%8], %2[%c0], %14, %15[%c0] : memref<9408xf32>, memref<192xf32, 2>, memref<0xf32, 2>
%16 = memref.alloc() {alignment = 16 : i64} : memref<0xf32, 2>
memref.dma_start %arg1[%8], %2[%c0], %14, %16[%c0] : memref<9408xf32>, memref<192xf32, 2>, memref<0xf32, 2>
return
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs