mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-21 05:21:28 +00:00
fix PR3538 for PPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1823c92aa7
commit
f902d246b6
@ -1110,8 +1110,13 @@ SDNode *PPCDAGToDAGISel::Select(SDValue Op) {
|
||||
SDValue N1 = N->getOperand(1);
|
||||
SDValue N2 = N->getOperand(2);
|
||||
FrameIndexSDNode *FINode = dyn_cast<FrameIndexSDNode>(N1);
|
||||
if (!FINode)
|
||||
break;
|
||||
|
||||
// FIXME: We need to handle this for VLAs.
|
||||
if (!FINode) {
|
||||
ReplaceUses(Op.getValue(0), Chain);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (N2.getOpcode() == ISD::ADD) {
|
||||
if (N2.getOperand(0).getOpcode() == ISD::ADD &&
|
||||
N2.getOperand(0).getOperand(0).getOpcode() == PPCISD::GlobalBaseReg &&
|
||||
@ -1127,8 +1132,13 @@ SDNode *PPCDAGToDAGISel::Select(SDValue Op) {
|
||||
N2.getOperand(1).getOpcode() == PPCISD::Lo)
|
||||
N2 = N2.getOperand(0).getOperand(0);
|
||||
}
|
||||
if (!isa<GlobalAddressSDNode>(N2))
|
||||
break;
|
||||
|
||||
// If we don't have a global address here, the debug info is mangled, just
|
||||
// drop it.
|
||||
if (!isa<GlobalAddressSDNode>(N2)) {
|
||||
ReplaceUses(Op.getValue(0), Chain);
|
||||
return NULL;
|
||||
}
|
||||
int FI = cast<FrameIndexSDNode>(N1)->getIndex();
|
||||
GlobalValue *GV = cast<GlobalAddressSDNode>(N2)->getGlobal();
|
||||
SDValue Tmp1 = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
||||
|
Loading…
x
Reference in New Issue
Block a user