forked from OSchip/llvm-project
Add an option to enable StrongPHIElimination, for ease of testing.
llvm-svn: 57259
This commit is contained in:
parent
c084e84028
commit
1d338fc6a4
|
@ -102,6 +102,10 @@ namespace llvm {
|
|||
/// which trades away generated code quality in favor of reducing
|
||||
/// compile time.
|
||||
extern bool EnableFastISel;
|
||||
|
||||
/// StrongPHIElim - This flag enables more aggressive PHI elimination
|
||||
/// wth earlier copy coalescing.
|
||||
extern bool StrongPHIElim;
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
|
@ -67,8 +68,12 @@ void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
|
|||
AU.addRequired<LiveVariables>();
|
||||
AU.addPreservedID(MachineLoopInfoID);
|
||||
AU.addPreservedID(MachineDominatorsID);
|
||||
AU.addPreservedID(PHIEliminationID);
|
||||
AU.addRequiredID(PHIEliminationID);
|
||||
|
||||
if (!StrongPHIElim) {
|
||||
AU.addPreservedID(PHIEliminationID);
|
||||
AU.addRequiredID(PHIEliminationID);
|
||||
}
|
||||
|
||||
AU.addRequiredID(TwoAddressInstructionPassID);
|
||||
MachineFunctionPass::getAnalysisUsage(AU);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "llvm/CodeGen/RegisterCoalescer.h"
|
||||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/ADT/EquivalenceClasses.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
|
@ -107,6 +108,8 @@ namespace {
|
|||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.addRequired<LiveIntervals>();
|
||||
if (StrongPHIElim)
|
||||
AU.addRequiredID(StrongPHIEliminationID);
|
||||
// Make sure PassManager knows which analyses to make available
|
||||
// to coalescing and which analyses coalescing invalidates.
|
||||
AU.addRequiredTransitive<RegisterCoalescer>();
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "llvm/CodeGen/RegisterCoalescer.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/ADT/SmallSet.h"
|
||||
|
@ -72,7 +73,10 @@ void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
|
|||
AU.addRequired<MachineLoopInfo>();
|
||||
AU.addPreserved<MachineLoopInfo>();
|
||||
AU.addPreservedID(MachineDominatorsID);
|
||||
AU.addPreservedID(PHIEliminationID);
|
||||
if (StrongPHIElim)
|
||||
AU.addPreservedID(StrongPHIEliminationID);
|
||||
else
|
||||
AU.addPreservedID(PHIEliminationID);
|
||||
AU.addPreservedID(TwoAddressInstructionPassID);
|
||||
MachineFunctionPass::getAnalysisUsage(AU);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/ADT/BitVector.h"
|
||||
|
@ -76,7 +77,10 @@ namespace {
|
|||
AU.addPreserved<LiveVariables>();
|
||||
AU.addPreservedID(MachineLoopInfoID);
|
||||
AU.addPreservedID(MachineDominatorsID);
|
||||
AU.addPreservedID(PHIEliminationID);
|
||||
if (StrongPHIElim)
|
||||
AU.addPreservedID(StrongPHIEliminationID);
|
||||
else
|
||||
AU.addPreservedID(PHIEliminationID);
|
||||
MachineFunctionPass::getAnalysisUsage(AU);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace llvm {
|
|||
bool RealignStack;
|
||||
bool VerboseAsm;
|
||||
bool DisableJumpTables;
|
||||
bool StrongPHIElim;
|
||||
}
|
||||
|
||||
static cl::opt<bool, true> PrintCode("print-machineinstrs",
|
||||
|
@ -157,6 +158,12 @@ DisableSwitchTables(cl::Hidden, "disable-jump-tables",
|
|||
cl::location(DisableJumpTables),
|
||||
cl::init(false));
|
||||
|
||||
static cl::opt<bool, true>
|
||||
EnableStrongPHIElim(cl::Hidden, "strong-phi-elim",
|
||||
cl::desc("Use strong PHI elimination."),
|
||||
cl::location(StrongPHIElim),
|
||||
cl::init(false));
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// TargetMachine Class
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue