summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorScott Michel <scottm@aero.org>2008-11-22 23:50:42 +0000
committerScott Michel <scottm@aero.org>2008-11-22 23:50:42 +0000
commit0be0339baaa6d1a333c3be0d46c1ccd5cec365ef (patch)
tree7245fd81d22e0770d8ecd35c3be5a7f56de13ea9 /llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
parentfe96a906ef739a900685247af4fdb1b70d423bf0 (diff)
downloadbcm5719-llvm-0be0339baaa6d1a333c3be0d46c1ccd5cec365ef.tar.gz
bcm5719-llvm-0be0339baaa6d1a333c3be0d46c1ccd5cec365ef.zip
CellSPU: Fix bug 3056. Varadic extract_element was not implemented (nor was it
ever conceived to occur). llvm-svn: 59891
Diffstat (limited to 'llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp b/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
index 109cd5ee1ee..4fbd5bb467a 100644
--- a/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
+++ b/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
@@ -591,13 +591,24 @@ SPUDAGToDAGISel::SelectXFormAddr(SDValue Op, SDValue N, SDValue &Base,
SDValue &Index) {
if (!SelectAFormAddr(Op, N, Base, Index)
&& !SelectDFormAddr(Op, N, Base, Index)) {
- // default form of a X-form address is r(r) in operands 0 and 1:
+ // Default form of a X-form address is r(r) in operands 0 and 1:
SDValue Op0 = N.getOperand(0);
SDValue Op1 = N.getOperand(1);
- if (Op0.getOpcode() == ISD::Register && Op1.getOpcode() == ISD::Register) {
- Base = Op0;
- Index = Op1;
+ if ((Op0.getOpcode() == ISD::Register
+ || Op.getOpcode() == ISD::CopyFromReg)
+ && (Op1.getOpcode() == ISD::Register
+ || Op.getOpcode() == ISD::CopyFromReg)) {
+ if (Op.getOpcode() == ISD::Register)
+ Base = Op0;
+ else
+ Base = Op0.getOperand(1);
+
+ if (Op1.getOpcode() == ISD::Register)
+ Index = Op1;
+ else
+ Index = Op1.getOperand(1);
+
return true;
}
}
OpenPOWER on IntegriCloud