Handle loading from/storing to undef pointers on SPU by inserting a
authorKalle Raiskila <kalle.raiskila@nokia.com>
Wed, 9 Jun 2010 08:29:41 +0000 (08:29 +0000)
committerKalle Raiskila <kalle.raiskila@nokia.com>
Wed, 9 Jun 2010 08:29:41 +0000 (08:29 +0000)
random load/store, rather than crashing llc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105710 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CellSPU/SPUISelDAGToDAG.cpp
test/CodeGen/CellSPU/loads.ll

index bfb57d361364814fdc0eeae702cbb4788b3da5f5..f76ad7638480ae63427dea7fa758051ca4c74ad5 100644 (file)
@@ -606,7 +606,9 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDNode *Op, SDValue N, SDValue &Base,
     Base = CurDAG->getTargetConstant(0, N.getValueType());
     Index = N;
     return true;
-  } else if (Opc == ISD::Register || Opc == ISD::CopyFromReg) {
+  } else if (Opc == ISD::Register 
+           ||Opc == ISD::CopyFromReg 
+           ||Opc == ISD::UNDEF) {
     unsigned OpOpc = Op->getOpcode();
 
     if (OpOpc == ISD::STORE || OpOpc == ISD::LOAD) {
index 37c6d4f1517740e48dde2140010fe90fedf4c1ca..c46bcd18c15af5473f023130a71f0cf61c22cde2 100644 (file)
@@ -31,3 +31,8 @@ define <4 x i32> @func() {
         ret <4 x i32> %rv3
 }
 
+define <4 x float> @load_undef(){
+       ;CHECK lqd      $3, 0($3)
+       %val = load <4 x float>* undef
+       ret <4 x float> %val
+}