summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorScott Michel <scottm@aero.org>2008-12-10 00:15:19 +0000
committerScott Michel <scottm@aero.org>2008-12-10 00:15:19 +0000
commita2495508cd71583c6d4352c1ed247b4dd4fb7916 (patch)
tree14999f153f215da065aec369b0c367a9834eb4dc /llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
parentd9f7b1c230703e9fba9b2e4cbabddb6679336d46 (diff)
downloadbcm5719-llvm-a2495508cd71583c6d4352c1ed247b4dd4fb7916.tar.gz
bcm5719-llvm-a2495508cd71583c6d4352c1ed247b4dd4fb7916.zip
CellSPU:
- Fix bug 3185, with misc other cleanups. - Needed to implement SPUInstrInfo::InsertBranch(). CAUTION: Not sure what gets or needs to get passed to InsertBranch() to insert a conditional branch. This will abort for now until a good test case shows up. llvm-svn: 60811
Diffstat (limited to 'llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp b/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
index 14f3edd4d6a..9ac0e2e256c 100644
--- a/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
+++ b/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
@@ -557,10 +557,7 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDValue Op, SDValue N, SDValue &Base,
else
Addr = N; // Register
- if (OpOpc == ISD::STORE)
- Offs = Op.getOperand(3);
- else
- Offs = Op.getOperand(2); // LOAD
+ Offs = ((OpOpc == ISD::STORE) ? Op.getOperand(3) : Op.getOperand(2));
if (Offs.getOpcode() == ISD::Constant || Offs.getOpcode() == ISD::UNDEF) {
if (Offs.getOpcode() == ISD::UNDEF)
@@ -570,6 +567,16 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDValue Op, SDValue N, SDValue &Base,
Index = Addr;
return true;
}
+ } else {
+ /* If otherwise unadorned, default to D-form address with 0 offset: */
+ if (Opc == ISD::CopyFromReg) {
+ Index = N.getOperand(1);
+ } else {
+ Index = N;
+ }
+
+ Base = CurDAG->getTargetConstant(0, Index.getValueType());
+ return true;
}
}
OpenPOWER on IntegriCloud