/// createX86ISelDag - This pass converts a legalized DAG into a
/// X86-specific DAG, ready for instruction scheduling.
///
-FunctionPass *createX86ISelDag(X86TargetMachine &TM);
+FunctionPass *createX86ISelDag(X86TargetMachine &TM, bool Fast);
/// createX86FloatingPointStackifierPass - This function returns a pass which
/// converts floating point register references and pseudo instructions into
/// register should set this to true.
bool ContainsFPCode;
+ /// FastISel - Enable fast(er) instruction selection.
+ ///
+ bool FastISel;
+
/// X86Lowering - This object fully describes how to lower LLVM code to an
/// X86-specific SelectionDAG.
X86TargetLowering X86Lowering;
unsigned GlobalBaseReg;
public:
- X86DAGToDAGISel(X86TargetMachine &TM)
+ X86DAGToDAGISel(X86TargetMachine &TM, bool fast)
: SelectionDAGISel(X86Lowering),
+ ContainsFPCode(false), FastISel(fast),
X86Lowering(*TM.getTargetLowering()),
Subtarget(&TM.getSubtarget<X86Subtarget>()) {}
// / [X]
// | ^
// [U]--------|
- return !isNonImmUse(U, N);
+ return !FastISel && !isNonImmUse(U, N);
}
/// MoveBelowTokenFactor - Replace TokenFactor operand with load's chain operand
DEBUG(BB->dump());
MachineFunction::iterator FirstMBB = BB;
- if (X86ISelPreproc)
+ if (!FastISel)
InstructionSelectPreprocess(DAG);
// Codegen the basic block.
/// createX86ISelDag - This pass converts a legalized DAG into a
/// X86-specific DAG, ready for instruction scheduling.
///
-FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM) {
- return new X86DAGToDAGISel(TM);
+FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM, bool Fast) {
+ return new X86DAGToDAGISel(TM, Fast);
}
PM.add(createUnreachableBlockEliminationPass());
// Install an instruction selector.
- PM.add(createX86ISelDag(*this));
+ PM.add(createX86ISelDag(*this, Fast));
// Print the instruction selected machine code...
if (PrintMachineCode)
PM.add(createUnreachableBlockEliminationPass());
// Install an instruction selector.
- PM.add(createX86ISelDag(TM));
+ PM.add(createX86ISelDag(TM, false));
// Print the instruction selected machine code...
if (PrintMachineCode)