- Enable x86 isel preprocessing by default unless -fast is specified.

- Also disable isel load folding if -fast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29956 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-08-29 18:28:33 +00:00
parent 718996654b
commit e50794adda
3 changed files with 13 additions and 8 deletions

View File

@ -28,7 +28,7 @@ class MachineCodeEmitter;
/// createX86ISelDag - This pass converts a legalized DAG into a /// createX86ISelDag - This pass converts a legalized DAG into a
/// X86-specific DAG, ready for instruction scheduling. /// X86-specific DAG, ready for instruction scheduling.
/// ///
FunctionPass *createX86ISelDag(X86TargetMachine &TM); FunctionPass *createX86ISelDag(X86TargetMachine &TM, bool Fast);
/// createX86FloatingPointStackifierPass - This function returns a pass which /// createX86FloatingPointStackifierPass - This function returns a pass which
/// converts floating point register references and pseudo instructions into /// converts floating point register references and pseudo instructions into

View File

@ -92,6 +92,10 @@ namespace {
/// register should set this to true. /// register should set this to true.
bool ContainsFPCode; bool ContainsFPCode;
/// FastISel - Enable fast(er) instruction selection.
///
bool FastISel;
/// X86Lowering - This object fully describes how to lower LLVM code to an /// X86Lowering - This object fully describes how to lower LLVM code to an
/// X86-specific SelectionDAG. /// X86-specific SelectionDAG.
X86TargetLowering X86Lowering; X86TargetLowering X86Lowering;
@ -103,8 +107,9 @@ namespace {
unsigned GlobalBaseReg; unsigned GlobalBaseReg;
public: public:
X86DAGToDAGISel(X86TargetMachine &TM) X86DAGToDAGISel(X86TargetMachine &TM, bool fast)
: SelectionDAGISel(X86Lowering), : SelectionDAGISel(X86Lowering),
ContainsFPCode(false), FastISel(fast),
X86Lowering(*TM.getTargetLowering()), X86Lowering(*TM.getTargetLowering()),
Subtarget(&TM.getSubtarget<X86Subtarget>()) {} Subtarget(&TM.getSubtarget<X86Subtarget>()) {}
@ -237,7 +242,7 @@ bool X86DAGToDAGISel::CanBeFoldedBy(SDNode *N, SDNode *U) {
// / [X] // / [X]
// | ^ // | ^
// [U]--------| // [U]--------|
return !isNonImmUse(U, N); return !FastISel && !isNonImmUse(U, N);
} }
/// MoveBelowTokenFactor - Replace TokenFactor operand with load's chain operand /// MoveBelowTokenFactor - Replace TokenFactor operand with load's chain operand
@ -370,7 +375,7 @@ void X86DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
DEBUG(BB->dump()); DEBUG(BB->dump());
MachineFunction::iterator FirstMBB = BB; MachineFunction::iterator FirstMBB = BB;
if (X86ISelPreproc) if (!FastISel)
InstructionSelectPreprocess(DAG); InstructionSelectPreprocess(DAG);
// Codegen the basic block. // Codegen the basic block.
@ -1071,6 +1076,6 @@ SelectInlineAsmMemoryOperand(const SDOperand &Op, char ConstraintCode,
/// createX86ISelDag - This pass converts a legalized DAG into a /// createX86ISelDag - This pass converts a legalized DAG into a
/// X86-specific DAG, ready for instruction scheduling. /// X86-specific DAG, ready for instruction scheduling.
/// ///
FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM) { FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM, bool Fast) {
return new X86DAGToDAGISel(TM); return new X86DAGToDAGISel(TM, Fast);
} }

View File

@ -103,7 +103,7 @@ bool X86TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
PM.add(createUnreachableBlockEliminationPass()); PM.add(createUnreachableBlockEliminationPass());
// Install an instruction selector. // Install an instruction selector.
PM.add(createX86ISelDag(*this)); PM.add(createX86ISelDag(*this, Fast));
// Print the instruction selected machine code... // Print the instruction selected machine code...
if (PrintMachineCode) if (PrintMachineCode)
@ -168,7 +168,7 @@ void X86JITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
PM.add(createUnreachableBlockEliminationPass()); PM.add(createUnreachableBlockEliminationPass());
// Install an instruction selector. // Install an instruction selector.
PM.add(createX86ISelDag(TM)); PM.add(createX86ISelDag(TM, false));
// Print the instruction selected machine code... // Print the instruction selected machine code...
if (PrintMachineCode) if (PrintMachineCode)