summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-01-16 22:57:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-01-16 22:57:32 +0000
commit41e9f6a854c1bfa259f890478abd375229232b5c (patch)
treee9e590f0095c151e4f9c2c1e629e872970851f37 /llvm/lib/Target
parentcbc26fdb6ecdebd60cbd6283fc507acf3fe5b96f (diff)
downloadbcm5719-llvm-41e9f6a854c1bfa259f890478abd375229232b5c.tar.gz
bcm5719-llvm-41e9f6a854c1bfa259f890478abd375229232b5c.zip
Fix PPC ISD::Declare isel and eliminate the need for PPCTargetLowering::LowerGlobalAddress to check if isVerifiedDebugInfoDesc() is true. Given the recent changes, it would falsely return true for a lot of GlobalAddressSDNode's.
llvm-svn: 62373
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp20
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp5
2 files changed, 21 insertions, 4 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 0259a728016..276abe77bf3 100644
--- a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -1100,6 +1100,26 @@ SDNode *PPCDAGToDAGISel::Select(SDValue Op) {
Chain), 0);
return CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain);
}
+ case ISD::DECLARE: {
+ SDValue Chain = N->getOperand(0);
+ SDValue N1 = N->getOperand(1);
+ SDValue N2 = N->getOperand(2);
+ FrameIndexSDNode *FINode = dyn_cast<FrameIndexSDNode>(N1);
+ if (!FINode)
+ break;
+ if (N2.getOpcode() == ISD::ADD &&
+ N2.getOperand(0).getOpcode() == PPCISD::Hi &&
+ N2.getOperand(1).getOpcode() == PPCISD::Lo)
+ N2 = N2.getOperand(0).getOperand(0);
+ if (!isa<GlobalAddressSDNode>(N2))
+ break;
+ int FI = cast<FrameIndexSDNode>(N1)->getIndex();
+ GlobalValue *GV = cast<GlobalAddressSDNode>(N2)->getGlobal();
+ SDValue Tmp1 = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
+ SDValue Tmp2 = CurDAG->getTargetGlobalAddress(GV, TLI.getPointerTy());
+ return CurDAG->SelectNodeTo(N, TargetInstrInfo::DECLARE,
+ MVT::Other, Tmp1, Tmp2, Chain);
+ }
}
return SelectCode(Op);
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index c31daccbd55..67c25365467 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -1134,14 +1134,11 @@ SDValue PPCTargetLowering::LowerGlobalTLSAddress(SDValue Op,
}
SDValue PPCTargetLowering::LowerGlobalAddress(SDValue Op,
- SelectionDAG &DAG) {
+ SelectionDAG &DAG) {
MVT PtrVT = Op.getValueType();
GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
GlobalValue *GV = GSDN->getGlobal();
SDValue GA = DAG.getTargetGlobalAddress(GV, PtrVT, GSDN->getOffset());
- // If it's a debug information descriptor, don't mess with it.
- if (DAG.isVerifiedDebugInfoDesc(Op))
- return GA;
SDValue Zero = DAG.getConstant(0, PtrVT);
const TargetMachine &TM = DAG.getTarget();
OpenPOWER on IntegriCloud