aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/IfConversion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/IfConversion.cpp')
-rw-r--r--lib/CodeGen/IfConversion.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index 45f08b1..be9e1f1 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -148,9 +148,11 @@ namespace {
const TargetInstrInfo *TII;
bool MadeChange;
int FnNum;
+ CodeGenOpt::Level OptLevel;
public:
static char ID;
- IfConverter() : MachineFunctionPass(&ID), FnNum(-1) {}
+ IfConverter(CodeGenOpt::Level OL) :
+ MachineFunctionPass(&ID), FnNum(-1), OptLevel(OL) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "If Converter"; }
@@ -219,10 +221,9 @@ namespace {
char IfConverter::ID = 0;
}
-static RegisterPass<IfConverter>
-X("if-converter", "If Converter");
-
-FunctionPass *llvm::createIfConverterPass() { return new IfConverter(); }
+FunctionPass *llvm::createIfConverterPass(CodeGenOpt::Level OptLevel) {
+ return new IfConverter(OptLevel);
+}
bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
TLI = MF.getTarget().getTargetLowering();
@@ -362,7 +363,7 @@ bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
BBAnalysis.clear();
if (MadeChange) {
- BranchFolder BF(false);
+ BranchFolder BF(false, OptLevel);
BF.OptimizeFunction(MF, TII,
MF.getTarget().getRegisterInfo(),
getAnalysisIfAvailable<MachineModuleInfo>());