[PATCH] D89207: [MemCpyOpt] Port to MemorySSA

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 13:57:20 PST 2020


nikic added a comment.

In D89207#2370224 <https://reviews.llvm.org/D89207#2370224>, @asbirlea wrote:

> 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?

I've started implementing this (by returning a DoNothingMemorySSAWalker when a limit is hit), but ended up wondering if it really makes sense: I believe that the number of MSSA walker queries we do in this pass is roughly proportional to the number of memsets/memcpys in the IR. For very big functions we may end up performing many queries, but the overall runtime should still be linear (each individual query is limited by the walker limit). Having a limit would make sense to me if something here had quadratic runtime (like e.g. the AST limit in LICM), but I don't think that's the case here.


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

https://reviews.llvm.org/D89207



More information about the llvm-commits mailing list