diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-06-18 02:48:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-06-18 02:48:27 +0000 |
commit | 651e1440ecdc0ae3e04c44b48aad501c5109563a (patch) | |
tree | b8cef921b539822e73d6f173f176a04b9467352a | |
parent | 6dfc43803c79f9e322c3faf539ee4e522d17d039 (diff) | |
download | external_llvm-651e1440ecdc0ae3e04c44b48aad501c5109563a.zip external_llvm-651e1440ecdc0ae3e04c44b48aad501c5109563a.tar.gz external_llvm-651e1440ecdc0ae3e04c44b48aad501c5109563a.tar.bz2 |
Unbreak DECLARE isel in pic mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52439 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86ISelDAGToDAG.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index e0b8e01..3a4496f 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -1585,10 +1585,14 @@ SDNode *X86DAGToDAGISel::Select(SDOperand N) { SDOperand Chain = Node->getOperand(0); SDOperand N1 = Node->getOperand(1); SDOperand N2 = Node->getOperand(2); - if (isa<FrameIndexSDNode>(N1) && - N2.getOpcode() == X86ISD::Wrapper && + if (!isa<FrameIndexSDNode>(N1)) + break; + int FI = cast<FrameIndexSDNode>(N1)->getIndex(); + if (N2.getOpcode() == ISD::ADD && + N2.getOperand(0).getOpcode() == X86ISD::GlobalBaseReg) + N2 = N2.getOperand(1); + if (N2.getOpcode() == X86ISD::Wrapper && isa<GlobalAddressSDNode>(N2.getOperand(0))) { - int FI = cast<FrameIndexSDNode>(N1)->getIndex(); GlobalValue *GV = cast<GlobalAddressSDNode>(N2.getOperand(0))->getGlobal(); SDOperand Tmp1 = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy()); |