[PATCH] D89207: [MemCpyOpt] Port to MemorySSA
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 20 14:41:30 PST 2020
asbirlea added a comment.
In D89207#2408995 <https://reviews.llvm.org/D89207#2408995>, @nikic wrote:
> 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.
Ok, let's leave as is and revisit if we encounter a pathological case where the cost of N memset/memcpy queries is too much and we need to limit that.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89207/new/
https://reviews.llvm.org/D89207
More information about the llvm-commits
mailing list