[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 13:50:43 PDT 2017


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

Thanks, LGTM.



================
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 =
----------------
This can be `&&` instead of a nested if.


================
Comment at: test/CodeGen/Hexagon/regalloc-liveout-undef.mir:3-6
+# If there is no consumer of the live intervals, the live intervals pass
+# will be freed immediately after it runs, before the verifier. Add a
+# user (register coalescer in this case), so that the verification will
+# cover live intervals as well.
----------------
Sounds like we need some `AU.addUsedIfAvailable<>()` calls in the getUsageInfo of the MachineVerifier. Doesn't need to be in this patch though.


Repository:
  rL LLVM

https://reviews.llvm.org/D34640





More information about the llvm-commits mailing list