This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] ComprehensiveBufferize: Do not copy InitTensorOp results
ClosedPublic

Authored by springerm on Sep 13 2021, 11:49 PM.

Details

Summary

E.g.:

%2 = memref.alloc() {alignment = 128 : i64} : memref<256x256xf32>
%3 = memref.alloc() {alignment = 128 : i64} : memref<256x256xf32>

// ... (%3 is not written to)

linalg.copy(%3, %2) : memref<256x256xf32>, memref<256x256xf32>
vector.transfer_write %11, %2[%c0, %c0] {in_bounds = [true, true]} : vector<256x256xf32>, memref<256x256xf32>

Avoid copies of %3 if %3 came directly from an InitTensorOp.

Depends On D109741

Diff Detail

Event Timeline

springerm created this revision.Sep 13 2021, 11:49 PM
springerm requested review of this revision.Sep 13 2021, 11:49 PM
This revision is now accepted and ready to land.Sep 15 2021, 12:31 AM