From f895dbeb29b63f775e341f53ab92609c8da25392 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 23 Feb 2010 00:28:53 +0000 Subject: [PATCH] Dead code elimination git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96837 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/PHIElimination.cpp | 5 ----- lib/CodeGen/PHIElimination.h | 9 --------- 2 files changed, 14 deletions(-) diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index bc49d0de223..9e4bc0c273f 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -55,7 +55,6 @@ void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const { bool llvm::PHIElimination::runOnMachineFunction(MachineFunction &Fn) { MRI = &Fn.getRegInfo(); - PHIDefs.clear(); bool Changed = false; // Split critical edges to help the coalescer @@ -214,10 +213,6 @@ void llvm::PHIElimination::LowerAtomicPHINode( TII->copyRegToReg(MBB, AfterPHIsIt, DestReg, IncomingReg, RC, RC); } - // Record PHI def. - assert(!hasPHIDef(DestReg) && "Vreg has multiple phi-defs?"); - PHIDefs[DestReg] = &MBB; - // Update live variable information if there is any. LiveVariables *LV = getAnalysisIfAvailable(); if (LV) { diff --git a/lib/CodeGen/PHIElimination.h b/lib/CodeGen/PHIElimination.h index 110721d01d6..ff4aa209185 100644 --- a/lib/CodeGen/PHIElimination.h +++ b/lib/CodeGen/PHIElimination.h @@ -22,10 +22,8 @@ namespace llvm { /// Lower PHI instructions to copies. class PHIElimination : public MachineFunctionPass { MachineRegisterInfo *MRI; // Machine register information - typedef DenseMap PHIDefMap; public: - static char ID; // Pass identification, replacement for typeid PHIElimination() : MachineFunctionPass(&ID) {} @@ -33,12 +31,6 @@ namespace llvm { virtual void getAnalysisUsage(AnalysisUsage &AU) const; - /// Return true if the given vreg was defined by a PHI intsr prior to - /// lowering. - bool hasPHIDef(unsigned vreg) const { - return PHIDefs.count(vreg); - } - private: /// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions /// in predecessor basic blocks. @@ -106,7 +98,6 @@ namespace llvm { typedef DenseMap VRegPHIUse; VRegPHIUse VRegPHIUseCount; - PHIDefMap PHIDefs; // Defs of PHI sources which are implicit_def. SmallPtrSet ImpDefs; -- 2.34.1