[llvm-branch-commits] [llvm-branch] r89792 - in /llvm/branches/Apple/Zoidberg: include/llvm/CodeGen/MachineModuleInfo.h include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/MachineModuleInfo.cpp
Devang Patel
dpatel at apple.com
Tue Nov 24 11:41:26 PST 2009
Author: dpatel
Date: Tue Nov 24 13:41:25 2009
New Revision: 89792
URL: http://llvm.org/viewvc/llvm-project?rev=89792&view=rev
Log:
Merge r89790 from trunk.
Modified:
llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineModuleInfo.h
llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/Passes.h
llvm/branches/Apple/Zoidberg/lib/CodeGen/LLVMTargetMachine.cpp
llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineModuleInfo.cpp
Modified: llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineModuleInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineModuleInfo.h?rev=89792&r1=89791&r2=89792&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineModuleInfo.h (original)
+++ llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineModuleInfo.h Tue Nov 24 13:41:25 2009
@@ -135,9 +135,6 @@
/// llvm.compiler.used.
SmallPtrSet<const Function *, 32> UsedFunctions;
- /// UsedDbgLabels - labels are used by debug info entries.
- SmallSet<unsigned, 8> UsedDbgLabels;
-
bool CallsEHReturn;
bool CallsUnwindInit;
@@ -232,19 +229,6 @@
return LabelID ? LabelIDList[LabelID - 1] : 0;
}
- /// isDbgLabelUsed - Return true if label with LabelID is used by
- /// DwarfWriter.
- bool isDbgLabelUsed(unsigned LabelID) {
- return UsedDbgLabels.count(LabelID);
- }
-
- /// RecordUsedDbgLabel - Mark label with LabelID as used. This is used
- /// by DwarfWriter to inform DebugLabelFolder that certain labels are
- /// not to be deleted.
- void RecordUsedDbgLabel(unsigned LabelID) {
- UsedDbgLabels.insert(LabelID);
- }
-
/// getFrameMoves - Returns a reference to a list of moves done in the current
/// function's prologue. Used to construct frame maps for debug and exception
/// handling comsumers.
Modified: llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/Passes.h?rev=89792&r1=89791&r2=89792&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/Passes.h (original)
+++ llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/Passes.h Tue Nov 24 13:41:25 2009
@@ -136,11 +136,6 @@
/// headers to target specific alignment boundary.
FunctionPass *createCodePlacementOptPass();
- /// DebugLabelFoldingPass - This pass prunes out redundant debug labels. This
- /// allows a debug emitter to determine if the range of two labels is empty,
- /// by seeing if the labels map to the same reduced label.
- FunctionPass *createDebugLabelFoldingPass();
-
/// getRegisterAllocator - This creates an instance of the register allocator
/// for the Sparc.
FunctionPass *getRegisterAllocator(TargetMachine &T);
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/LLVMTargetMachine.cpp?rev=89792&r1=89791&r2=89792&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/LLVMTargetMachine.cpp Tue Nov 24 13:41:25 2009
@@ -338,10 +338,6 @@
if (PrintGCInfo)
PM.add(createGCInfoPrinter(errs()));
- // Fold redundant debug labels.
- PM.add(createDebugLabelFoldingPass());
- printAndVerify(PM, "After DebugLabelFolding");
-
if (OptLevel != CodeGenOpt::None && !DisableCodePlace) {
PM.add(createCodePlacementOptPass());
printAndVerify(PM, "After CodePlacementOpt");
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineModuleInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineModuleInfo.cpp?rev=89792&r1=89791&r2=89792&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineModuleInfo.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineModuleInfo.cpp Tue Nov 24 13:41:25 2009
@@ -293,75 +293,3 @@
return 0;
}
-//===----------------------------------------------------------------------===//
-/// DebugLabelFolding pass - This pass prunes out redundant labels. This allows
-/// a info consumer to determine if the range of two labels is empty, by seeing
-/// if the labels map to the same reduced label.
-
-namespace llvm {
-
-struct DebugLabelFolder : public MachineFunctionPass {
- static char ID;
- DebugLabelFolder() : MachineFunctionPass(&ID) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesCFG();
- AU.addPreservedID(MachineLoopInfoID);
- AU.addPreservedID(MachineDominatorsID);
- MachineFunctionPass::getAnalysisUsage(AU);
- }
-
- virtual bool runOnMachineFunction(MachineFunction &MF);
- virtual const char *getPassName() const { return "Label Folder"; }
-};
-
-char DebugLabelFolder::ID = 0;
-
-bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
- // Get machine module info.
- MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- if (!MMI) return false;
-
- // Track if change is made.
- bool MadeChange = false;
- // No prior label to begin.
- unsigned PriorLabel = 0;
-
- // Iterate through basic blocks.
- for (MachineFunction::iterator BB = MF.begin(), E = MF.end();
- BB != E; ++BB) {
- // Iterate through instructions.
- for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
- // Is it a label.
- if (I->isDebugLabel() && !MMI->isDbgLabelUsed(I->getOperand(0).getImm())){
- // The label ID # is always operand #0, an immediate.
- unsigned NextLabel = I->getOperand(0).getImm();
-
- // If there was an immediate prior label.
- if (PriorLabel) {
- // Remap the current label to prior label.
- MMI->RemapLabel(NextLabel, PriorLabel);
- // Delete the current label.
- I = BB->erase(I);
- // Indicate a change has been made.
- MadeChange = true;
- continue;
- } else {
- // Start a new round.
- PriorLabel = NextLabel;
- }
- } else {
- // No consecutive labels.
- PriorLabel = 0;
- }
-
- ++I;
- }
- }
-
- return MadeChange;
-}
-
-FunctionPass *createDebugLabelFoldingPass() { return new DebugLabelFolder(); }
-
-}
More information about the llvm-branch-commits
mailing list