diff options
| author | Dan Gohman <gohman@apple.com> | 2008-09-23 21:53:34 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-09-23 21:53:34 +0000 |
| commit | d57dd5f4e6740520820bc0fca42a540e31c27a73 (patch) | |
| tree | 97f5958b5fa50b87f9dbc56a6018955c87f5e18a /lib/CodeGen | |
| parent | 8468d1a84527ca5dbf0a6476b11fc0730810d2fa (diff) | |
| download | llvm-d57dd5f4e6740520820bc0fca42a540e31c27a73.tar.gz llvm-d57dd5f4e6740520820bc0fca42a540e31c27a73.tar.bz2 llvm-d57dd5f4e6740520820bc0fca42a540e31c27a73.tar.xz | |
Arrange for FastISel code to have access to the MachineModuleInfo
object. This will be needed to support debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 4 | ||||
| -rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 3139cb3bc7..4b77322607 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -450,7 +450,7 @@ FastISel::SelectOperator(User *I, unsigned Opcode) { UpdateValueMap(I, Reg); return true; } - + default: // Unhandled instruction. Halt "fast" selection and bail. return false; @@ -458,6 +458,7 @@ FastISel::SelectOperator(User *I, unsigned Opcode) { } FastISel::FastISel(MachineFunction &mf, + MachineModuleInfo *mmi, DenseMap<const Value *, unsigned> &vm, DenseMap<const BasicBlock *, MachineBasicBlock *> &bm, DenseMap<const AllocaInst *, int> &am) @@ -466,6 +467,7 @@ FastISel::FastISel(MachineFunction &mf, MBBMap(bm), StaticAllocaMap(am), MF(mf), + MMI(mmi), MRI(MF.getRegInfo()), MFI(*MF.getFrameInfo()), MCP(*MF.getConstantPool()), diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index c2938e35f8..c1e80fc788 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -309,7 +309,8 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) { 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) @@ -317,7 +318,7 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) { // 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 @@ -710,7 +711,8 @@ void SelectionDAGISel::CodeGenAndEmitDAG() { 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]; @@ -726,7 +728,8 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) { // 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 |
