When fuse-into-containing a fill producer which has multiple fully overlapped extract_slice consumers, we can fuse and fill a single extracted slice for the first consumer and reuse the same filled slice for the other fully overlapped consumers. Fully overlapped is defined as having the same offset, size, stride parameters.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Hello @ftynse @springerm @nicolasvasilache would really appreciate your feedback on this PR. Thank you!
Comment Actions
Thanks @kaitingwang, quick question, couldn't you achieve what you are doing here automatically with cse instead of extending the capabilities of fusion?
I would expect it to be the case and if not I would like to understand whether something is missing?
Comment Actions
@nicolasvasilache Thank you for the reminder! I looked into our pipeline and we indeed use -cse. However, we had missed running -canonicalize before -cse (we mistakenly ran canonicalize after cse). After switching the order of the flags, cse is indeed able to remove the duplicated computation. I'll close the PR!