[llvm-commits] CVS: llvm/lib/Target/SparcV8/FPMover.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Jan 29 21:51:25 PST 2006



Changes in directory llvm/lib/Target/SparcV8:

FPMover.cpp updated: 1.10 -> 1.11
---
Log message:

If the target has V9 instructions, this pass is a noop, don't bother
running it.


---
Diffs of the changes:  (+16 -8)

 FPMover.cpp |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)


Index: llvm/lib/Target/SparcV8/FPMover.cpp
diff -u llvm/lib/Target/SparcV8/FPMover.cpp:1.10 llvm/lib/Target/SparcV8/FPMover.cpp:1.11
--- llvm/lib/Target/SparcV8/FPMover.cpp:1.10	Sun Jan 22 17:37:17 2006
+++ llvm/lib/Target/SparcV8/FPMover.cpp	Sun Jan 29 23:51:14 2006
@@ -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 @@
     }
 
     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 @@
   }
   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;
+}






More information about the llvm-commits mailing list