[llvm-commits] [llvm] r62516 - /llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Evan Cheng
evan.cheng at apple.com
Mon Jan 19 10:31:51 PST 2009
Author: evancheng
Date: Mon Jan 19 12:31:51 2009
New Revision: 62516
URL: http://llvm.org/viewvc/llvm-project?rev=62516&view=rev
Log:
Handle ISD::DECLARE with PIC relocation model.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp?rev=62516&r1=62515&r2=62516&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Mon Jan 19 12:31:51 2009
@@ -1107,10 +1107,21 @@
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 (N2.getOpcode() == ISD::ADD) {
+ if (N2.getOperand(0).getOpcode() == ISD::ADD &&
+ N2.getOperand(0).getOperand(0).getOpcode() == PPCISD::GlobalBaseReg &&
+ N2.getOperand(0).getOperand(1).getOpcode() == PPCISD::Hi &&
+ N2.getOperand(1).getOpcode() == PPCISD::Lo)
+ N2 = N2.getOperand(0).getOperand(1).getOperand(0);
+ else if (N2.getOperand(0).getOpcode() == ISD::ADD &&
+ N2.getOperand(0).getOperand(0).getOpcode() == PPCISD::GlobalBaseReg &&
+ N2.getOperand(0).getOperand(1).getOpcode() == PPCISD::Lo &&
+ N2.getOperand(1).getOpcode() == PPCISD::Hi)
+ N2 = N2.getOperand(0).getOperand(1).getOperand(0);
+ else if (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();
More information about the llvm-commits
mailing list