[PATCH] D80274: [MachineVerifier] Handle the PHI node for verifyLiveVariables()

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 06:28:54 PDT 2020


bjope added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:135
       // Vregs that must be live in because they are used without being
       // defined. Map value is the user.
       RegMap vregsLiveIn;
----------------
Add a comment here that vregsLiveIn doesn't include regs that only are used by PHI nodes.


================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:2304
     }
+
+    // Handle the PHI node.
----------------
Can't you just simply loop over the PHI nodes belonging to MBB here, finding all the PHI-related <vreg, pred> pairs.
That should give you all the additional vregs that should be live in (that earlier has been left our from the vregsLiveIn map), and from which predecessors the value should be required.

That way you do not need the PHIVarFrom map (and being even more dependant on what visitMachineInstrBefore is doing). I mean the map is only caching the information stored in the PHI instructions anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80274/new/

https://reviews.llvm.org/D80274





More information about the llvm-commits mailing list