mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-27 23:33:55 +00:00
Add an option to disable critical edge splitting in PHIElimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127398 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2f5565d21c
commit
6a951ac63f
@ -28,12 +28,18 @@
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
using namespace llvm;
|
||||
|
||||
static cl::opt<bool>
|
||||
DisableEdgeSplitting("disable-phi-elim-edge-splitting", cl::init(false),
|
||||
cl::Hidden, cl::desc("Disable critical edge splitting "
|
||||
"during PHI elimination"));
|
||||
|
||||
namespace {
|
||||
class PHIElimination : public MachineFunctionPass {
|
||||
MachineRegisterInfo *MRI; // Machine register information
|
||||
@ -105,10 +111,12 @@ bool PHIElimination::runOnMachineFunction(MachineFunction &MF) {
|
||||
bool Changed = false;
|
||||
|
||||
// Split critical edges to help the coalescer
|
||||
if (LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>()) {
|
||||
MachineLoopInfo *MLI = getAnalysisIfAvailable<MachineLoopInfo>();
|
||||
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
|
||||
Changed |= SplitPHIEdges(MF, *I, *LV, MLI);
|
||||
if (!DisableEdgeSplitting) {
|
||||
if (LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>()) {
|
||||
MachineLoopInfo *MLI = getAnalysisIfAvailable<MachineLoopInfo>();
|
||||
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
|
||||
Changed |= SplitPHIEdges(MF, *I, *LV, MLI);
|
||||
}
|
||||
}
|
||||
|
||||
// Populate VRegPHIUseCount
|
||||
|
Loading…
x
Reference in New Issue
Block a user