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

Chris Lattner lattner at cs.uiuc.edu
Tue Jan 11 18:57:25 PST 2005



Changes in directory llvm/lib/Target/X86:

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

Fix a bug where we didn't insert FP_REG_KILL instructions into MBB's that
contain FP PHI nodes but no other FP defining instructions.  This fixes
183.equake


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

Index: llvm/lib/Target/X86/X86ISelPattern.cpp
diff -u llvm/lib/Target/X86/X86ISelPattern.cpp:1.40 llvm/lib/Target/X86/X86ISelPattern.cpp:1.41
--- llvm/lib/Target/X86/X86ISelPattern.cpp:1.40	Tue Jan 11 20:19:06 2005
+++ llvm/lib/Target/X86/X86ISelPattern.cpp	Tue Jan 11 20:57:10 2005
@@ -331,6 +331,21 @@
       // FP_REG_KILL insertion.
       ContainsFPCode = false;
 
+      // Scan the PHI nodes that already are inserted into this basic block.  If
+      // any of them is a PHI of a floating point value, we need to insert an
+      // FP_REG_KILL.
+      SSARegMap *RegMap = BB->getParent()->getSSARegMap();
+      for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end();
+           I != E; ++I) {
+        assert(I->getOpcode() == X86::PHI &&
+               "Isn't just PHI nodes?");
+        if (RegMap->getRegClass(I->getOperand(0).getReg()) ==
+            X86::RFPRegisterClass) {
+          ContainsFPCode = true;
+          break;
+        }
+      }
+
       // Compute the RegPressureMap, which is an approximation for the number of
       // registers required to compute each node.
       ComputeRegPressure(DAG.getRoot());






More information about the llvm-commits mailing list