diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp --- a/llvm/lib/Transforms/Utils/Debugify.cpp +++ b/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); diff --git a/llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir b/llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir --- a/llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir +++ b/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 ... ---