[PATCH] D28934: Write a new SSAUpdater

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 18:15:46 PST 2017

dberlin added a comment.

At least right now, it should avoid extra phis in all but the irreducible case (unlike the previous attempt, which, again, quite admirable :P)
There, it will not create them more than once (or shouldn't).

If those turn out to matter, we can use the SCC algorithm to minimize them (and i can build it on the fly, it's just uglier to do scc finding as we go instead of after).

Comment at: lib/Transforms/Utils/SSAUpdaterNew.cpp:175-176
+  // Never found a non-self reference, the phi is undef
+  if (Same == nullptr)
+    return UndefValue::get(CurrentType.lookup(Var));
+  if (Phi) {
davide wrote:
> Also, I understand that we don't need to call `replaceAllUsesWith` as there are no non-self uses, but shouldn't we call `eraseFromParent` here?
Yes, if phi is not null, we do need to erase it in that case.


More information about the llvm-commits mailing list