[PATCH] D17157: Add the beginnings of an update API for preserving MemorySSA

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 11:34:10 PST 2016


dberlin marked 5 inline comments as done.

================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:492
@@ +491,3 @@
+  // Re-point the uses at our defining access
+  MA->replaceAllUsesWith(NewDefTarget);
+
----------------
george.burgess.iv wrote:
> It seems that if `MA` is a Phi with no Uses (e.g. they were removed, ...), `NewDefTarget` may be null here. Is this intentional/possible?
Yes, this is possible, and was originally intentional.
I used to handle the replacing logic myself, but shoved it off to replaceAllUsesWith, which looks like it does make an assert that you don't pass null.
(in my code, it simply did nothing, because it has a while (!use_empty) loop)
So i've modified this code to only do replacement if !use_empty.



http://reviews.llvm.org/D17157





More information about the llvm-commits mailing list