[llvm] [MachineVerifier] Query TargetInstrInfo for PHI nodes. (PR #110507)

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 06:46:05 PDT 2024


Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/110507 at github.com>


================
@@ -3211,17 +3211,22 @@ void MachineVerifier::calcRegsRequired() {
         todo.insert(Pred);
     }
 
-    // Handle the PHI node.
-    for (const MachineInstr &MI : MBB.phis()) {
-      for (unsigned i = 1, e = MI.getNumOperands(); i != e; i += 2) {
+    // Handle the PHI nodes.
+    // Note: MBB.phis() only returns range containing PHI/G_PHI instructions.
+    // MachineVerifier checks MIR post-ISel, and some backends do have their own
----------------
VyacheslavLevytskyy wrote:

Maybe instead "and some backends do have their own phi nodes" something like "and a backend may have a phi node instruction in the instruction set (e.g., SPIR-V backend)". The point of the suggestion is that I'm not aware of another backend with a phi node instruction.

https://github.com/llvm/llvm-project/pull/110507


More information about the llvm-commits mailing list