aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-09 03:36:39 +0000
committerChris Lattner <sabre@nondot.org>2005-05-09 03:36:39 +0000
commite3e0f2765afbafa0378a58d2c1b0171df7309e91 (patch)
treec5eab5cd7499b225585a8093dab06e9036c479b7
parent49b8b70008f53f464a79fc236ce084ec516473ae (diff)
Fix X86/2005-05-08-FPStackifierPHI.ll: ugly gross hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21801 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86ISelPattern.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/Target/X86/X86ISelPattern.cpp b/lib/Target/X86/X86ISelPattern.cpp
index 78561fac67..61acb2e9d7 100644
--- a/lib/Target/X86/X86ISelPattern.cpp
+++ b/lib/Target/X86/X86ISelPattern.cpp
@@ -14,9 +14,10 @@
#include "X86.h"
#include "X86InstrBuilder.h"
#include "X86RegisterInfo.h"
-#include "llvm/Constants.h" // FIXME: REMOVE
+#include "llvm/Constants.h"
+#include "llvm/Instructions.h"
#include "llvm/Function.h"
-#include "llvm/CodeGen/MachineConstantPool.h" // FIXME: REMOVE
+#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
@@ -25,6 +26,7 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetOptions.h"
+#include "llvm/Support/CFG.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/ADT/Statistic.h"
#include <set>
@@ -461,6 +463,21 @@ void ISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
}
}
+ // Final check, check LLVM BB's that are successors to the LLVM BB
+ // corresponding to BB for FP PHI nodes.
+ const BasicBlock *LLVMBB = BB->getBasicBlock();
+ const PHINode *PN;
+ if (!ContainsFPCode)
+ for (succ_const_iterator SI = succ_begin(LLVMBB), E = succ_end(LLVMBB);
+ SI != E && !ContainsFPCode; ++SI)
+ for (BasicBlock::const_iterator II = SI->begin();
+ (PN = dyn_cast<PHINode>(II)); ++II)
+ if (PN->getType()->isFloatingPoint()) {
+ ContainsFPCode = true;
+ break;
+ }
+
+
// Insert FP_REG_KILL instructions into basic blocks that need them. This
// only occurs due to the floating point stackifier not being aggressive
// enough to handle arbitrary global stackification.