[llvm] 5e04d8b - Revert "[Debugify] Accumulate the number of variables in debugify metadata"
Anton Sidorenko via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 24 08:10:09 PST 2022
Author: Anton Sidorenko
Date: 2022-11-24T19:09:52+03:00
New Revision: 5e04d8b72e849a6f0678cb5343d03dc3a9d310a0
URL: https://github.com/llvm/llvm-project/commit/5e04d8b72e849a6f0678cb5343d03dc3a9d310a0
DIFF: https://github.com/llvm/llvm-project/commit/5e04d8b72e849a6f0678cb5343d03dc3a9d310a0.diff
LOG: Revert "[Debugify] Accumulate the number of variables in debugify metadata"
This brokes some builds
This reverts commit a1bbe8a4e2e50e7100dc17d9ddd1bfc3bfe44977.
Added:
Modified:
llvm/lib/CodeGen/MachineDebugify.cpp
llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/MachineDebugify.cpp b/llvm/lib/CodeGen/MachineDebugify.cpp
index adf1b51a950d8..b726a032ca180 100644
--- a/llvm/lib/CodeGen/MachineDebugify.cpp
+++ b/llvm/lib/CodeGen/MachineDebugify.cpp
@@ -153,15 +153,10 @@ bool applyDebugifyMetadataToMachineFunction(MachineModuleInfo &MMI,
NMD->setOperand(Idx, MDNode::get(Ctx, ValueAsMetadata::getConstant(
ConstantInt::get(Int32Ty, N))));
};
- auto getDebugifyOperand = [&](unsigned Idx) {
- return mdconst::extract<ConstantInt>(NMD->getOperand(Idx)->getOperand(0))
- ->getZExtValue();
- };
// Set number of lines.
setDebugifyOperand(0, NextLine - 1);
// Set number of variables.
- auto OldNumVars = getDebugifyOperand(1);
- setDebugifyOperand(1, OldNumVars + VarSet.size());
+ setDebugifyOperand(1, VarSet.size());
}
return true;
@@ -171,9 +166,6 @@ bool applyDebugifyMetadataToMachineFunction(MachineModuleInfo &MMI,
/// legacy module pass manager.
struct DebugifyMachineModule : public ModulePass {
bool runOnModule(Module &M) override {
- // We will insert new debugify metadata, so erasing the old one.
- assert(!M.getNamedMetadata("llvm.mir.debugify") &&
- "llvm.mir.debugify metadata already exists! Strip it first");
MachineModuleInfo &MMI =
getAnalysis<MachineModuleInfoWrapperPass>().getMMI();
return applyDebugifyMetadata(
diff --git a/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir b/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir
index ca811632580dc..56e9351926563 100644
--- a/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir
+++ b/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir
@@ -1,7 +1,6 @@
-# RUN: llc -run-pass=mir-debugify,mir-check-debugify -o - %s 2>&1 | FileCheck %s
+# RUN: llc -run-pass=mir-debugify,mir-check-debugify %s
-# CHECK: Machine IR debug info check: PASS
-# CHECK-NOT: Assertion `Var <= NumVars && "Unexpected name for DILocalVariable"'
+# XFAIL: *
--- |
define i32 @foo(i32 %a0, i32 %a1, i32 %a2, i32 %a3) {
More information about the llvm-commits
mailing list