[llvm] [Instrumentation] Support verifying machine function (PR #90931)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 23:40:23 PDT 2024


================
@@ -362,6 +363,14 @@ class TriggerVerifierErrorPass
     return PreservedAnalyses::none();
   }
 
+  PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &) {
+    // Intentionally create a virtual register and set NoVRegs property.
+    auto &MRI = MF.getRegInfo();
+    MRI.createGenericVirtualRegister(LLT::scalar(8));
----------------
arsenm wrote:

To be safe, it would be best to introduce an actual instruction with the register. IIRC we permit virtual registers that have no uses in the MIR 

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


More information about the llvm-commits mailing list