summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Raiskila <kalle.raiskila@nokia.com>2010-06-01 13:34:47 +0000
committerKalle Raiskila <kalle.raiskila@nokia.com>2010-06-01 13:34:47 +0000
commit11fe24624a307575eec82e9825ab8ba5435024a5 (patch)
tree058bfe4c8d38e5e7c01fd0fd77823507594549ea
parent21330544df104c1551978888007076297407e110 (diff)
downloadllvm-11fe24624a307575eec82e9825ab8ba5435024a5.tar.gz
llvm-11fe24624a307575eec82e9825ab8ba5435024a5.tar.bz2
llvm-11fe24624a307575eec82e9825ab8ba5435024a5.tar.xz
Fix handling of 'load' nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105269 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/CellSPU/SPUISelDAGToDAG.cpp10
-rw-r--r--test/CodeGen/CellSPU/loads.ll13
2 files changed, 15 insertions, 8 deletions
diff --git a/lib/Target/CellSPU/SPUISelDAGToDAG.cpp b/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
index 9afdb2b97f..bfb57d3613 100644
--- a/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
+++ b/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
@@ -611,13 +611,7 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDNode *Op, SDValue N, SDValue &Base,
if (OpOpc == ISD::STORE || OpOpc == ISD::LOAD) {
// Direct load/store without getelementptr
- SDValue Addr, Offs;
-
- // Get the register from CopyFromReg
- if (Opc == ISD::CopyFromReg)
- Addr = N.getOperand(1);
- else
- Addr = N; // Register
+ SDValue Offs;
Offs = ((OpOpc == ISD::STORE) ? Op->getOperand(3) : Op->getOperand(2));
@@ -626,7 +620,7 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDNode *Op, SDValue N, SDValue &Base,
Offs = CurDAG->getTargetConstant(0, Offs.getValueType());
Base = Offs;
- Index = Addr;
+ Index = N;
return true;
}
} else {
diff --git a/test/CodeGen/CellSPU/loads.ll b/test/CodeGen/CellSPU/loads.ll
index 8e5422c58e..37c6d4f151 100644
--- a/test/CodeGen/CellSPU/loads.ll
+++ b/test/CodeGen/CellSPU/loads.ll
@@ -18,3 +18,16 @@ entry:
ret <4 x float> %tmp1
; CHECK: lqd $3, 16($3)
}
+
+
+declare <4 x i32>* @getv4f32ptr()
+define <4 x i32> @func() {
+ ;CHECK: brasl
+ ;CHECK: lr {{\$[0-9]*, \$3}}
+ ;CHECK: brasl
+ %rv1 = call <4 x i32>* @getv4f32ptr()
+ %rv2 = call <4 x i32>* @getv4f32ptr()
+ %rv3 = load <4 x i32>* %rv1
+ ret <4 x i32> %rv3
+}
+