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

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 06:14:32 PDT 2017


kparzysz marked an inline comment as done.
kparzysz added a comment.

The case where a block is in Seen, but the value is null refers to the situation where the register is live-through this block, but at the moment we don't know what value it has.  The "UndefVNI" case denotes a situation where we know that this block undefines the register.



================
Comment at: lib/CodeGen/LiveRangeCalc.cpp:289
     MachineBasicBlock &B = *MF->getBlockNumbered(N);
-    if (Seen[N] && Map[&B].first != nullptr)
+    if (Seen[N] && Map[&B].first != nullptr && Map[&B].first != &UndefVNI)
       return MarkDefined(B);
----------------
MatzeB wrote:
> Doesn't the `Map[&B].first == nullptr` case only exist to deal with undefs? Does it still happen with your changes?
> 
> (If you still need it, at least refactor it so we only do 1 lookup in `Map`).
Yes, it still happens.  Actually there are 3 testcases in test/CodeGen/Hexagon where this occurs with these changes.


Repository:
  rL LLVM

https://reviews.llvm.org/D34640





More information about the llvm-commits mailing list