summaryrefslogtreecommitdiff
path: root/lib/Target/Sparc/FPMover.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-30 05:51:14 +0000
committerChris Lattner <sabre@nondot.org>2006-01-30 05:51:14 +0000
commit5295de7c41058e7e89cbdc255f86e8c623566f5a (patch)
treec6111f4dece33c3fbc0a854222862fcb617d8e2e /lib/Target/Sparc/FPMover.cpp
parentb34d3fd4cf8f7882afd320b83f564146875d5116 (diff)
downloadllvm-5295de7c41058e7e89cbdc255f86e8c623566f5a.tar.gz
llvm-5295de7c41058e7e89cbdc255f86e8c623566f5a.tar.bz2
llvm-5295de7c41058e7e89cbdc255f86e8c623566f5a.tar.xz
If the target has V9 instructions, this pass is a noop, don't bother
running it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/FPMover.cpp')
-rw-r--r--lib/Target/Sparc/FPMover.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/Target/Sparc/FPMover.cpp b/lib/Target/Sparc/FPMover.cpp
index cc3d781766..8bc1009d37 100644
--- a/lib/Target/Sparc/FPMover.cpp
+++ b/lib/Target/Sparc/FPMover.cpp
@@ -12,8 +12,10 @@
//===----------------------------------------------------------------------===//
#include "SparcV8.h"
+#include "SparcV8Subtarget.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/Target/TargetMachine.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Debug.h"
#include <iostream>
@@ -36,14 +38,7 @@ namespace {
}
bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
- bool runOnMachineFunction(MachineFunction &F) {
- bool Changed = false;
- for (MachineFunction::iterator FI = F.begin(), FE = F.end();
- FI != FE; ++FI)
- Changed |= runOnMachineBasicBlock(*FI);
- return Changed;
- }
-
+ bool runOnMachineFunction(MachineFunction &F);
};
} // end of anonymous namespace
@@ -122,3 +117,16 @@ bool FPMover::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
}
return Changed;
}
+
+bool FPMover::runOnMachineFunction(MachineFunction &F) {
+ // If the target has V9 instructions, the fp-mover pseudos will never be
+ // emitted. Avoid a scan of the instructions to improve compile time.
+ if (TM.getSubtarget<SparcV8Subtarget>().isV9())
+ return false;
+
+ bool Changed = false;
+ for (MachineFunction::iterator FI = F.begin(), FE = F.end();
+ FI != FE; ++FI)
+ Changed |= runOnMachineBasicBlock(*FI);
+ return Changed;
+}