aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-01-07 19:45:14 +0000
committerEric Christopher <echristo@apple.com>2010-01-07 19:45:14 +0000
commite6c74c9c2a49be4500d52c2531c1a45221a530a4 (patch)
treecfc5dee881727ec299410d261cfdb73924bf2978 /lib/Target
parenta07b7504050e10508144b294b2c7996fe8794e0c (diff)
downloadexternal_llvm-e6c74c9c2a49be4500d52c2531c1a45221a530a4.zip
external_llvm-e6c74c9c2a49be4500d52c2531c1a45221a530a4.tar.gz
external_llvm-e6c74c9c2a49be4500d52c2531c1a45221a530a4.tar.bz2
If the data requires a relocation then don't attempt to
add it to the constant pool for fast-isel. We already don't add it for the normal case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/X86FastISel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp
index 10fba24..31ae50e 100644
--- a/lib/Target/X86/X86FastISel.cpp
+++ b/lib/Target/X86/X86FastISel.cpp
@@ -19,6 +19,7 @@
#include "X86RegisterInfo.h"
#include "X86Subtarget.h"
#include "X86TargetMachine.h"
+#include "llvm/Constant.h"
#include "llvm/CallingConv.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalVariable.h"
@@ -1652,6 +1653,12 @@ unsigned X86FastISel::TargetMaterializeConstant(Constant *C) {
PICBase = X86::RIP;
}
+ // If we've gotten here we need to make sure we don't have a constant
+ // that needs a relocation, because then we shouldn't put it into the
+ // constant pool.
+ if (C->getRelocationInfo() != Constant::NoRelocation)
+ return 0;
+
// Create the load from the constant pool.
unsigned MCPOffset = MCP.getConstantPoolIndex(C, Align);
unsigned ResultReg = createResultReg(RC);