[PATCH] D119914: [Debugify] Mark mir-check-debugify change nothing of input

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 02:36:04 PST 2022


skan updated this revision to Diff 409182.
skan marked 2 inline comments as done.
skan added a comment.

Address review comments


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119914

Files:
  llvm/lib/CodeGen/MachineCheckDebugify.cpp


Index: llvm/lib/CodeGen/MachineCheckDebugify.cpp
===================================================================
--- llvm/lib/CodeGen/MachineCheckDebugify.cpp
+++ llvm/lib/CodeGen/MachineCheckDebugify.cpp
@@ -27,9 +27,6 @@
 
 struct CheckDebugMachineModule : public ModulePass {
   bool runOnModule(Module &M) override {
-    MachineModuleInfo &MMI =
-        getAnalysis<MachineModuleInfoWrapperPass>().getMMI();
-
     NamedMDNode *NMD = M.getNamedMetadata("llvm.mir.debugify");
     if (!NMD) {
       errs() << "WARNING: Please run mir-debugify to generate "
@@ -37,6 +34,9 @@
       return false;
     }
 
+    MachineModuleInfo &MMI =
+        getAnalysis<MachineModuleInfoWrapperPass>().getMMI();
+
     auto getDebugifyOperand = [&](unsigned Idx) -> unsigned {
       return mdconst::extract<ConstantInt>(NMD->getOperand(Idx)->getOperand(0))
           ->getZExtValue();
@@ -106,8 +106,7 @@
 
   void getAnalysisUsage(AnalysisUsage &AU) const override {
     AU.addRequired<MachineModuleInfoWrapperPass>();
-    AU.addPreserved<MachineModuleInfoWrapperPass>();
-    AU.setPreservesCFG();
+    AU.setPreservesAll();
   }
 
   static char ID; // Pass identification.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119914.409182.patch
Type: text/x-patch
Size: 1177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220216/b57c8d8a/attachment.bin>


More information about the llvm-commits mailing list