From: Matt Arsenault Date: Wed, 2 Jul 2014 17:44:53 +0000 (+0000) Subject: R600: Fix crashes when an illegal type load or store is not handled. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b1fb2ba24d567e7f510d0a695d8fb50486eb44a9;p=oota-llvm.git R600: Fix crashes when an illegal type load or store is not handled. I don't think anything hits this now, but will be exposed in future patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212197 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/R600/AMDGPUISelLowering.cpp b/lib/Target/R600/AMDGPUISelLowering.cpp index 9258e1569e0..64636de959b 100644 --- a/lib/Target/R600/AMDGPUISelLowering.cpp +++ b/lib/Target/R600/AMDGPUISelLowering.cpp @@ -556,6 +556,9 @@ void AMDGPUTargetLowering::ReplaceNodeResults(SDNode *N, return; case ISD::LOAD: { SDNode *Node = LowerLOAD(SDValue(N, 0), DAG).getNode(); + if (!Node) + return; + Results.push_back(SDValue(Node, 0)); Results.push_back(SDValue(Node, 1)); // XXX: LLVM seems not to replace Chain Value inside CustomWidenLowerNode @@ -564,8 +567,9 @@ void AMDGPUTargetLowering::ReplaceNodeResults(SDNode *N, return; } case ISD::STORE: { - SDNode *Node = LowerSTORE(SDValue(N, 0), DAG).getNode(); - Results.push_back(SDValue(Node, 0)); + SDValue Lowered = LowerSTORE(SDValue(N, 0), DAG); + if (Lowered.getNode()) + Results.push_back(Lowered); return; } default: