[PATCH] D89207: [MemCpyOpt] Port to MemorySSA

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 18:43:24 PST 2020


asbirlea added a comment.

Thank you for working on this, the compile times look very promising and the tests results are great!

Since this is using MSSA walker API with a MemoryLocation (which does not cache), could this become costly in a pathologically constructed example? If so, could we have a (reasonably large) upper bound on the number of getClobbering (Access, Location) calls to avoid such cases?



================
Comment at: llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp:342
+                           const MemoryUseOrDef *End) {
+  // TODO: Only walk until we hit Start.
+  MemoryAccess *Clobber = MSSA->getWalker()->getClobberingMemoryAccess(
----------------
nikic wrote:
> What would be a good way to do that?
There isn't a way to do that currently.
This needs support added in the walker. Draft: D90660; it lacks support in `tryOptimizePhi`, which means it may make sense to extend the query. This is tricky though because it depends on the path that access Start is on.  If the new API is used in a scenario where it doesn't dominate End, the given "StopAt" (Start) access may be bypassed entirely.
So even if it's not the case in MemCpyOptimizer, the MSSAWalker needs to account for such a case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89207



More information about the llvm-commits mailing list