[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
Mon Jun 26 16:33:37 PDT 2017


MatzeB added a comment.

>From what I remember the notion of a `nullptr` in `Map` for a block we had already `Seen` was introduced with the changes supporting undefs when recalculating liveness. I assumed that had the same role as the special VNI you introduce here. Can you elaborate the difference (and/or eliminate the cases looking for nullptr)?

Could you create a .mir test that just does `llc -run-pass=liveintervals`?



================
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);
----------------
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`).


Repository:
  rL LLVM

https://reviews.llvm.org/D34640





More information about the llvm-commits mailing list