Pass optLevel to XCoreDAGToDAGISel.

Patch by Kyriakos Georgiou.

llvm-svn: 146656
This commit is contained in:
Richard Osborne 2011-12-15 15:18:35 +00:00
parent fac8c8866d
commit 275e874c67
3 changed files with 8 additions and 6 deletions

View File

@ -24,7 +24,8 @@ namespace llvm {
class XCoreTargetMachine;
class formatted_raw_ostream;
FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM);
FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM,
CodeGenOpt::Level OptLevel);
} // end namespace llvm;

View File

@ -41,8 +41,8 @@ namespace {
const XCoreSubtarget &Subtarget;
public:
XCoreDAGToDAGISel(XCoreTargetMachine &TM)
: SelectionDAGISel(TM),
XCoreDAGToDAGISel(XCoreTargetMachine &TM, CodeGenOpt::Level OptLevel)
: SelectionDAGISel(TM, OptLevel),
Lowering(*TM.getTargetLowering()),
Subtarget(*TM.getSubtargetImpl()) { }
@ -83,8 +83,9 @@ namespace {
/// createXCoreISelDag - This pass converts a legalized DAG into a
/// XCore-specific DAG, ready for instruction scheduling.
///
FunctionPass *llvm::createXCoreISelDag(XCoreTargetMachine &TM) {
return new XCoreDAGToDAGISel(TM);
FunctionPass *llvm::createXCoreISelDag(XCoreTargetMachine &TM,
CodeGenOpt::Level OptLevel) {
return new XCoreDAGToDAGISel(TM, OptLevel);
}
bool XCoreDAGToDAGISel::SelectADDRspii(SDValue Addr, SDValue &Base,

View File

@ -35,7 +35,7 @@ XCoreTargetMachine::XCoreTargetMachine(const Target &T, StringRef TT,
}
bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM) {
PM.add(createXCoreISelDag(*this));
PM.add(createXCoreISelDag(*this, getOptLevel()));
return false;
}