aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86ISelPattern.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-12 02:57:10 +0000
committerChris Lattner <sabre@nondot.org>2005-01-12 02:57:10 +0000
commitdb8c368d7b1d55ef5810cd183ea815ebb0c9e728 (patch)
tree8898556979110fa4b29491c5084c581d57e5c89f /lib/Target/X86/X86ISelPattern.cpp
parentafce4306ec9d9ce5def7c3697654f3bcbbeb5cb9 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86ISelPattern.cpp')
-rw-r--r--lib/Target/X86/X86ISelPattern.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/X86/X86ISelPattern.cpp b/lib/Target/X86/X86ISelPattern.cpp
index 34d1356470..22c926a855 100644
--- a/lib/Target/X86/X86ISelPattern.cpp
+++ b/lib/Target/X86/X86ISelPattern.cpp
@@ -331,6 +331,21 @@ namespace {
// 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());