summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCheckDebugify.cpp
diff options
context:
space:
mode:
authorShengchen Kan <shengchen.kan@intel.com>2022-02-16 12:43:08 +0800
committerShengchen Kan <shengchen.kan@intel.com>2022-02-16 18:37:26 +0800
commitce02c79dc67601af7dcf9adcaaaff8cd98d85381 (patch)
treee211637372982811f3ec29af6d2dea827f043aab /llvm/lib/CodeGen/MachineCheckDebugify.cpp
parent9bde88182317325bb95c13190a4cf303d3ce4b54 (diff)
[Debugify] Mark mir-check-debugify change nothing of input
Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D119914
Diffstat (limited to 'llvm/lib/CodeGen/MachineCheckDebugify.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCheckDebugify.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineCheckDebugify.cpp b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
index bd7f0f862947..49b2c822eaeb 100644
--- a/llvm/lib/CodeGen/MachineCheckDebugify.cpp
+++ b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
@@ -27,9 +27,6 @@ namespace {
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 @@ struct CheckDebugMachineModule : public ModulePass {
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 @@ struct CheckDebugMachineModule : public ModulePass {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<MachineModuleInfoWrapperPass>();
- AU.addPreserved<MachineModuleInfoWrapperPass>();
- AU.setPreservesCFG();
+ AU.setPreservesAll();
}
static char ID; // Pass identification.