This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] Hoist redundant singleton vector transfer reads
ClosedPublic

Authored by harsh on Mar 24 2023, 10:39 AM.

Details

Summary

For singleton transfer reads, we allow hoisting them out
of the enclosing loop if there are no other accesses to
the source memref within the loop.

Diff Detail

Event Timeline

harsh created this revision.Mar 24 2023, 10:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2023, 10:39 AM
harsh requested review of this revision.Mar 24 2023, 10:39 AM
ThomasRaoux added inline comments.
mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
116

I think the logic you want is slightly different, you want to check that there are no other use of the memref by ops with side effects (read side-effects are okay).

harsh updated this revision to Diff 508222.Mar 24 2023, 3:00 PM

Updates based on Thomas' comments

mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
116

Sounds good. I have updated the patch.

ThomasRaoux added inline comments.Mar 24 2023, 3:10 PM
mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
55

nit: I would rename it to noAliasingUseInLoop

harsh updated this revision to Diff 508225.Mar 24 2023, 3:13 PM

Updated unit test to be more concise

harsh updated this revision to Diff 508226.Mar 24 2023, 3:15 PM
harsh marked an inline comment as done.

Fix naming of function

ThomasRaoux accepted this revision.Mar 24 2023, 3:16 PM

Looks good!

This revision is now accepted and ready to land.Mar 24 2023, 3:16 PM
This revision was landed with ongoing or failed builds.Mar 24 2023, 3:22 PM
This revision was automatically updated to reflect the committed changes.