summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-21 03:37:00 +0000
committerChris Lattner <sabre@nondot.org>2010-09-21 03:37:00 +0000
commitbb0a1c44bf614faa101673b0322a84d7581cf5bb (patch)
tree598695692684825bcc26e792e3e40f60df45d5d4 /llvm/lib
parent7108ece0771a813451ea3ee2390aee1ab26451dd (diff)
downloadbcm5719-llvm-bb0a1c44bf614faa101673b0322a84d7581cf5bb.tar.gz
bcm5719-llvm-bb0a1c44bf614faa101673b0322a84d7581cf5bb.zip
fix rdar://8453210, a crash handling a call through a GS relative load.
For now, just disable folding the load into the call. llvm-svn: 114386
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelDAGToDAG.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index 0e650c06ab0..ad515414a65 100644
--- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -403,6 +403,12 @@ static bool isCalleeLoad(SDValue Callee, SDValue &Chain, bool HasCallSeq) {
LD->getExtensionType() != ISD::NON_EXTLOAD)
return false;
+ // FIXME: Calls can't fold loads through segment registers yet.
+ if (const Value *Src = LD->getSrcValue())
+ if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
+ if (PT->getAddressSpace() >= 256)
+ return false;
+
// Now let's find the callseq_start.
while (HasCallSeq && Chain.getOpcode() != ISD::CALLSEQ_START) {
if (!Chain.hasOneUse())
@@ -563,7 +569,7 @@ bool X86DAGToDAGISel::MatchLoad(SDValue N, X86ISelAddressMode &AM) {
SDValue Address = N.getOperand(1);
if (Address.getOpcode() == X86ISD::SegmentBaseAddress &&
- !MatchSegmentBaseAddress (Address, AM))
+ !MatchSegmentBaseAddress(Address, AM))
return false;
return true;
OpenPOWER on IntegriCloud