aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-05-17 23:09:50 +0000
committerBill Wendling <isanbard@gmail.com>2010-05-17 23:09:50 +0000
commit53f7602b61157ed56ccbf91379c188c55235f619 (patch)
treee1cd0097e5d5c0834c66fe2a69514a7656f49df6 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parentebe7fcd041e1e9c3a0c535b26d8cdb45805bbeb8 (diff)
downloadexternal_llvm-53f7602b61157ed56ccbf91379c188c55235f619.zip
external_llvm-53f7602b61157ed56ccbf91379c188c55235f619.tar.gz
external_llvm-53f7602b61157ed56ccbf91379c188c55235f619.tar.bz2
- Set the "HasCalls" flag after instruction selection is finished.
- Change the logic DisableFramePointerElim() to check for the -disable-non-leaf-fp-elim before -disable-fp-elim. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 8c0a61f..5988688 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -233,6 +233,24 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
}
}
+ // Determine if there are any calls in this machine function.
+ MachineFrameInfo *MFI = MF->getFrameInfo();
+ if (!MFI->hasCalls()) {
+ for (MachineFunction::const_iterator
+ I = MF->begin(), E = MF->end(); I != E; ++I) {
+ const MachineBasicBlock *MBB = I;
+ for (MachineBasicBlock::const_iterator
+ II = MBB->begin(), IE = MBB->end(); II != IE; ++II) {
+ const TargetInstrDesc &TID = TM.getInstrInfo()->get(II->getOpcode());
+ if (II->isInlineAsm() || (TID.isCall() && !TID.isReturn())) {
+ MFI->setHasCalls(true);
+ goto done;
+ }
+ }
+ }
+ done:;
+ }
+
// Release function-specific state. SDB and CurDAG are already cleared
// at this point.
FuncInfo->clear();
@@ -606,19 +624,6 @@ MachineBasicBlock *SelectionDAGISel::CodeGenAndEmitDAG(MachineBasicBlock *BB) {
delete Scheduler;
}
- // Determine if there are any calls in this machine function.
- MachineFrameInfo *MFI = MF->getFrameInfo();
- if (!MFI->hasCalls()) {
- for (MachineBasicBlock::iterator
- I = BB->begin(), E = BB->end(); I != E; ++I) {
- const TargetInstrDesc &TID = TM.getInstrInfo()->get(I->getOpcode());
- if (I->isInlineAsm() || (TID.isCall() && !TID.isReturn())) {
- MFI->setHasCalls(true);
- break;
- }
- }
- }
-
// Free the SelectionDAG state, now that we're finished with it.
CurDAG->clear();
@@ -676,6 +681,7 @@ void SelectionDAGISel::DoInstructionSelection() {
CurDAG->setRoot(Dummy.getValue());
}
+
DEBUG(errs() << "===== Instruction selection ends:\n");
PostprocessISelDAG();