[PATCH] D138417: [Debugify] Strip llvm.mir.debugify metadata

Anton Sidorenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 01:28:27 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9ee8d2e081d2: [Debugify] Strip llvm.mir.debugify metadata (authored by asi-sc).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138417

Files:
  llvm/lib/Transforms/Utils/Debugify.cpp
  llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir


Index: llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir
===================================================================
--- llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir
+++ llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir
@@ -27,7 +27,7 @@
   ; VALUE: [[VAR1:![0-9]+]] = !DILocalVariable(name: "1"
   ; VALUE: [[VAR2:![0-9]+]] = !DILocalVariable(name: "2"
   ; STRIP-NOT: !llvm.debugify
-  ; STRIP: !llvm.mir.debugify
+  ; STRIP-NOT: !llvm.mir.debugify
 
 ...
 ---
Index: llvm/lib/Transforms/Utils/Debugify.cpp
===================================================================
--- llvm/lib/Transforms/Utils/Debugify.cpp
+++ llvm/lib/Transforms/Utils/Debugify.cpp
@@ -243,13 +243,18 @@
 bool llvm::stripDebugifyMetadata(Module &M) {
   bool Changed = false;
 
-  // Remove the llvm.debugify module-level named metadata.
+  // Remove the llvm.debugify and llvm.mir.debugify module-level named metadata.
   NamedMDNode *DebugifyMD = M.getNamedMetadata("llvm.debugify");
   if (DebugifyMD) {
     M.eraseNamedMetadata(DebugifyMD);
     Changed = true;
   }
 
+  if (auto *MIRDebugifyMD = M.getNamedMetadata("llvm.mir.debugify")) {
+    M.eraseNamedMetadata(MIRDebugifyMD);
+    Changed = true;
+  }
+
   // Strip out all debug intrinsics and supporting metadata (subprograms, types,
   // variables, etc).
   Changed |= StripDebugInfo(M);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138417.477703.patch
Type: text/x-patch
Size: 1387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221124/f2ff47c9/attachment.bin>


More information about the llvm-commits mailing list