From 5468e0928bcbfc18890d32c7525d281c14e6c303 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Fri, 14 May 2010 21:18:04 +0000 Subject: [PATCH] add cmd line option to leave dbgvalues in during post-RA sceduling. Useful while debugging what's mishandled about them in the post-RA pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103805 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/PostRASchedulerList.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp index d3e1295df3a..4f1e04bb0e5 100644 --- a/lib/CodeGen/PostRASchedulerList.cpp +++ b/lib/CodeGen/PostRASchedulerList.cpp @@ -80,6 +80,12 @@ DebugMod("postra-sched-debugmod", cl::desc("Debug control MBBs that are scheduled"), cl::init(0), cl::Hidden); +static cl::opt +EnablePostRADbgValue("post-RA-dbg-value", + cl::desc("Enable processing of dbg_value in post-RA"), + cl::init(false), cl::Hidden); + + AntiDepBreaker::~AntiDepBreaker() { } namespace { @@ -269,11 +275,14 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) { // scheduler has some sort of problem with DebugValue instructions that // causes an assertion in LeaksContext.h to fail occasionally. Just // remove all those instructions for now. - for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); - I != E; ) { - MachineInstr *MI = &*I++; - if (MI->isDebugValue()) - MI->eraseFromParent(); + if (!EnablePostRADbgValue) { + DEBUG(dbgs() << "*** Maintaining DbgValues in PostRAScheduler\n"); + for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); + I != E; ) { + MachineInstr *MI = &*I++; + if (MI->isDebugValue()) + MI->eraseFromParent(); + } } // Schedule each sequence of instructions not interrupted by a label