[llvm-commits] [llvm] r45309 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Owen Anderson
resistor at mac.com
Fri Dec 21 20:50:12 PST 2007
Author: resistor
Date: Fri Dec 21 22:50:11 2007
New Revision: 45309
URL: http://llvm.org/viewvc/llvm-project?rev=45309&view=rev
Log:
Remove critical edge breaking. It won't be necessary as long as we are very careful when inserting copies.
Modified:
llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=45309&r1=45308&r2=45309&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Fri Dec 21 22:50:11 2007
@@ -21,7 +21,6 @@
#define DEBUG_TYPE "strongphielim"
#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/BreakCriticalMachineEdge.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
@@ -101,7 +100,6 @@
std::set<unsigned>& PHIUnion,
std::vector<StrongPHIElimination::DomForestNode*>& DF,
std::vector<std::pair<unsigned, unsigned> >& locals);
- void breakCriticalEdges(MachineFunction &Fn);
};
@@ -501,42 +499,7 @@
}
}
-/// breakCriticalEdges - Break critical edges coming into blocks with PHI
-/// nodes, preserving dominator and livevariable info.
-void StrongPHIElimination::breakCriticalEdges(MachineFunction &Fn) {
- typedef std::pair<MachineBasicBlock*, MachineBasicBlock*> MBB_pair;
-
- MachineDominatorTree& MDT = getAnalysis<MachineDominatorTree>();
- LiveVariables& LV = getAnalysis<LiveVariables>();
-
- // Find critical edges
- std::vector<MBB_pair> criticals;
- for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
- if (!I->empty() &&
- I->begin()->getOpcode() == TargetInstrInfo::PHI &&
- I->pred_size() > 1)
- for (MachineBasicBlock::pred_iterator PI = I->pred_begin(),
- PE = I->pred_end(); PI != PE; ++PI)
- if ((*PI)->succ_size() > 1)
- criticals.push_back(std::make_pair(*PI, I));
-
- for (std::vector<MBB_pair>::iterator I = criticals.begin(),
- E = criticals.end(); I != E; ++I) {
- // Split the edge
- MachineBasicBlock* new_bb = SplitCriticalMachineEdge(I->first, I->second);
-
- // Update dominators
- MDT.splitBlock(I->first);
-
- // Update livevariables
- for (unsigned var = 1024; var < Fn.getSSARegMap()->getLastVirtReg(); ++var)
- if (isLiveOut(LV.getVarInfo(var), I->first))
- LV.getVarInfo(var).AliveBlocks.set(new_bb->getNumber());
- }
-}
-
bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) {
- breakCriticalEdges(Fn);
computeDFS(Fn);
for (MachineFunction::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
More information about the llvm-commits
mailing list