[PATCH] D34640: Create a PHI value when merging with a known undef live-in

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 14:42:44 PDT 2017


MatzeB added inline comments.


================
Comment at: lib/CodeGen/LiveRangeCalc.cpp:500-501
         // Cache the DomTree node that defined the value.
-        if (IDomValue.first && !IDomValue.second)
-          Map[IDom->getBlock()].second = IDomValue.second =
-            DomTree->getNode(Indexes->getMBBFromIndex(IDomValue.first->def));
+        if (IDomValue.first && IDomValue.first != &UndefVNI)
+          if (!IDomValue.second)
+            Map[IDom->getBlock()].second = IDomValue.second =
----------------
kparzysz wrote:
> MatzeB wrote:
> > This can be `&&` instead of a nested if.
> But then the condition wouldn't fit in a single line.
But it's two lines either way, isn't it? Not that I care too deeply about it, but my motivation for a single if, is that when I see two ifs, I usually start looking for "else code" or "common code after the inner if" that aren't present here.


Repository:
  rL LLVM

https://reviews.llvm.org/D34640





More information about the llvm-commits mailing list