[PATCH] This patch introduces MemorySSA, a virtual SSA form for memory.Details on what it looks like are in MemorySSA.h

Daniel Berlin dberlin at dberlin.org
Tue Feb 24 17:17:00 PST 2015


On Tue, Feb 24, 2015 at 5:01 PM, Sanjoy Das <sanjoy at playingwithpointers.com>
wrote:

> ================
> Comment at: lib/Transforms/Utils/MemorySSA.cpp:151
> @@ +150,3 @@
> +  // In both of these cases, we should arrive at the same version
> +  // number for all arguments. If we don't. we can't ignore this phi
> +  // node, because this means at least one of the arguments has a
> ----------------
> Nit: should probably be `If we don't, we can't`
>
> ================
> Comment at: lib/Transforms/Utils/MemorySSA.cpp:205
> @@ +204,3 @@
> +      MemoryAccess *Arg = P->getIncomingValue(i);
> +      if (Arg == DominatingArg)
> +        continue;
> ----------------
> A very basic question:  why do we need to treat the most dominating input
> to the memory PHI node specially?  Why not just check if every input agrees
> on the clobbering instruction?
>

We don't treat it specially, we actually do exactly what you say.
We could just pick any argument and end up with the same results. We just
happen to figure it's most likely to find the version closest to the top of
the function, which is most likely to be the highest (in the dominator
tree) version we are trying to reach.
Otherwise,  we always check to make sure the version of all arguments agree.

There is one caveat here: We have to skip cyclic phi node arguments (IE
arguments that lead us back to this phi node). So we can't pick one of
those to be the argument to check against :)




It's
> http://reviews.llvm.org/D7864
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150224/56e16571/attachment.html>


More information about the llvm-commits mailing list