Handle loading from/storing to undef pointers on SPU by inserting a
random load/store, rather than crashing llc. llvm-svn: 105710
This commit is contained in:
parent
af80f66997
commit
056113a211
|
@ -606,7 +606,9 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDNode *Op, SDValue N, SDValue &Base,
|
||||||
Base = CurDAG->getTargetConstant(0, N.getValueType());
|
Base = CurDAG->getTargetConstant(0, N.getValueType());
|
||||||
Index = N;
|
Index = N;
|
||||||
return true;
|
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();
|
unsigned OpOpc = Op->getOpcode();
|
||||||
|
|
||||||
if (OpOpc == ISD::STORE || OpOpc == ISD::LOAD) {
|
if (OpOpc == ISD::STORE || OpOpc == ISD::LOAD) {
|
||||||
|
|
|
@ -31,3 +31,8 @@ define <4 x i32> @func() {
|
||||||
ret <4 x i32> %rv3
|
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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue