[PATCH] D117926: [SLP] Optionally preserve MemorySSA

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 17:03:06 PST 2022


asbirlea added a comment.

Any chance you could profile where most time is spent?

As Nikita mentioned, the `insertDef` and `moveTo` (which calls `insertDef`) methods are very expensive if they need to do renaming. Can you check if most time is spent in `MSSA->renamePass`?
I'm asking this just to get a confirmation on where the issue lies (even the walk from 7714 can be an issue if the block is that huge and there are only MemoryAccesses only at the very beginning and end, though I sincerely doubt it).

There is no good capping for these updates, as renaming is often required to do a correct update, but if all the accesses are in a single block which already contains MemoryDefs, the changes shouldn't be so invasive (no new MemoryPhis should be inserted) so there's a chance to make this manageable.

Also echoing @nikic, an artificial test to replicate the issue would be great.



================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7741
+              MSSAU.moveToPlace(Access, BS->BB,
+                                MemorySSA::InsertionPlace::End);
+          }
----------------
Without knowing SLPVectorizer details, I think this should be:
s/MemorySSA::InsertionPlace::End/MemorySSA::InsertionPlace::BeforeTerminator.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117926/new/

https://reviews.llvm.org/D117926



More information about the llvm-commits mailing list