[llvm-commits] CVS: llvm/lib/Target/X86/X86FloatingPoint.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Jan 23 15:14:12 PST 2005



Changes in directory llvm/lib/Target/X86:

X86FloatingPoint.cpp updated: 1.40 -> 1.41
---
Log message:

Allow the FP stackifier to completely ignore functions that do not use FP at
all.  This should speed up the X86 backend fairly significantly on integer
codes.  Now if only we didn't have to compute livevar still... ;-)


---
Diffs of the changes:  (+15 -0)

 X86FloatingPoint.cpp |   15 +++++++++++++++
 1 files changed, 15 insertions(+)


Index: llvm/lib/Target/X86/X86FloatingPoint.cpp
diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.40 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.41
--- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.40	Wed Sep  1 17:55:36 2004
+++ llvm/lib/Target/X86/X86FloatingPoint.cpp	Sun Jan 23 17:13:59 2005
@@ -157,6 +157,21 @@
 /// register references into FP stack references.
 ///
 bool FPS::runOnMachineFunction(MachineFunction &MF) {
+  // We only need to run this pass if there are any FP registers used in this
+  // function.  If it is all integer, there is nothing for us to do!
+  const bool *PhysRegsUsed = MF.getUsedPhysregs();
+  bool FPIsUsed = false;
+
+  assert(X86::FP6 == X86::FP0+6 && "Register enums aren't sorted right!");
+  for (unsigned i = 0; i <= 6; ++i)
+    if (PhysRegsUsed[X86::FP0+i]) {
+      FPIsUsed = true;
+      break;
+    }
+
+  // Early exit.
+  if (!FPIsUsed) return false;
+
   LV = &getAnalysis<LiveVariables>();
   StackTop = 0;
 






More information about the llvm-commits mailing list