class MachineConstantPool;
class MachineFunction;
class MachineFrameInfo;
+class MachineModuleInfo;
class MachineRegisterInfo;
class TargetData;
class TargetInstrInfo;
DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap;
DenseMap<const AllocaInst *, int> &StaticAllocaMap;
MachineFunction &MF;
+ MachineModuleInfo *MMI;
MachineRegisterInfo &MRI;
MachineFrameInfo &MFI;
MachineConstantPool &MCP;
protected:
FastISel(MachineFunction &mf,
+ MachineModuleInfo *mmi,
DenseMap<const Value *, unsigned> &vm,
DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
DenseMap<const AllocaInst *, int> &am);
class MachineBasicBlock;
class MachineFunction;
class MachineInstr;
+ class MachineModuleInfo;
class TargetLowering;
class FunctionLoweringInfo;
class HazardRecognizer;
int64_t DesiredMaskS) const;
private:
- void SelectAllBasicBlocks(Function &Fn, MachineFunction &MF);
+ void SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
+ MachineModuleInfo *MMI);
void FinishBasicBlock();
void SelectBasicBlock(BasicBlock *LLVMBB,
class MachineFunction;
class MachineFrameInfo;
class MachineInstr;
+ class MachineModuleInfo;
class SDNode;
class SDValue;
class SelectionDAG;
/// or null if the target does not support "fast" ISel.
virtual FastISel *
createFastISel(MachineFunction &,
+ MachineModuleInfo *,
DenseMap<const Value *, unsigned> &,
DenseMap<const BasicBlock *, MachineBasicBlock *> &,
DenseMap<const AllocaInst *, int> &) {
UpdateValueMap(I, Reg);
return true;
}
-
+
default:
// Unhandled instruction. Halt "fast" selection and bail.
return false;
}
FastISel::FastISel(MachineFunction &mf,
+ MachineModuleInfo *mmi,
DenseMap<const Value *, unsigned> &vm,
DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
DenseMap<const AllocaInst *, int> &am)
MBBMap(bm),
StaticAllocaMap(am),
MF(mf),
+ MMI(mmi),
MRI(MF.getRegInfo()),
MFI(*MF.getFrameInfo()),
MCP(*MF.getConstantPool()),
DOUT << "\n\n\n=== " << Fn.getName() << "\n";
FuncInfo->set(Fn, MF, EnableFastISel);
- CurDAG->init(MF, getAnalysisToUpdate<MachineModuleInfo>());
+ MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
+ CurDAG->init(MF, MMI);
SDL->init(GFI, *AA);
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
// Mark landing pad.
FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad();
- SelectAllBasicBlocks(Fn, MF);
+ SelectAllBasicBlocks(Fn, MF, MMI);
// If the first basic block in the function has live ins that need to be
// copied into vregs, emit the copies into the top of the block before
DEBUG(BB->dump());
}
-void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) {
+void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
+ MachineModuleInfo *MMI) {
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) {
BasicBlock *LLVMBB = &*I;
BB = FuncInfo->MBBMap[LLVMBB];
// Before doing SelectionDAG ISel, see if FastISel has been requested.
// FastISel doesn't support EH landing pads, which require special handling.
if (EnableFastISel && !BB->isLandingPad()) {
- if (FastISel *F = TLI.createFastISel(*FuncInfo->MF, FuncInfo->ValueMap,
+ if (FastISel *F = TLI.createFastISel(*FuncInfo->MF, MMI,
+ FuncInfo->ValueMap,
FuncInfo->MBBMap,
FuncInfo->StaticAllocaMap)) {
// Emit code for any incoming arguments. This must happen before
public:
explicit X86FastISel(MachineFunction &mf,
+ MachineModuleInfo *mmi,
DenseMap<const Value *, unsigned> &vm,
DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
DenseMap<const AllocaInst *, int> &am)
- : FastISel(mf, vm, bm, am) {
+ : FastISel(mf, mmi, vm, bm, am) {
Subtarget = &TM.getSubtarget<X86Subtarget>();
StackPtr = Subtarget->is64Bit() ? X86::RSP : X86::ESP;
X86ScalarSSEf64 = Subtarget->hasSSE2();
namespace llvm {
llvm::FastISel *X86::createFastISel(MachineFunction &mf,
+ MachineModuleInfo *mmi,
DenseMap<const Value *, unsigned> &vm,
DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
DenseMap<const AllocaInst *, int> &am) {
- return new X86FastISel(mf, vm, bm, am);
+ return new X86FastISel(mf, mmi, vm, bm, am);
}
}
FastISel *
X86TargetLowering::createFastISel(MachineFunction &mf,
+ MachineModuleInfo *mmo,
DenseMap<const Value *, unsigned> &vm,
DenseMap<const BasicBlock *,
MachineBasicBlock *> &bm,
DenseMap<const AllocaInst *, int> &am) {
- return X86::createFastISel(mf, vm, bm, am);
+ return X86::createFastISel(mf, mmo, vm, bm, am);
}
/// or null if the target does not support "fast" ISel.
virtual FastISel *
createFastISel(MachineFunction &mf,
+ MachineModuleInfo *mmi,
DenseMap<const Value *, unsigned> &,
DenseMap<const BasicBlock *, MachineBasicBlock *> &,
DenseMap<const AllocaInst *, int> &);
namespace X86 {
FastISel *createFastISel(MachineFunction &mf,
+ MachineModuleInfo *mmi,
DenseMap<const Value *, unsigned> &,
DenseMap<const BasicBlock *, MachineBasicBlock *> &,
DenseMap<const AllocaInst *, int> &);