[llvm] r212197 - R600: Fix crashes when an illegal type load or store is not handled.

Matt Arsenault Matthew.Arsenault at amd.com
Wed Jul 2 10:44:53 PDT 2014


Author: arsenm
Date: Wed Jul  2 12:44:53 2014
New Revision: 212197

URL: http://llvm.org/viewvc/llvm-project?rev=212197&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp

Modified: llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp?rev=212197&r1=212196&r2=212197&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp Wed Jul  2 12:44:53 2014
@@ -556,6 +556,9 @@ void AMDGPUTargetLowering::ReplaceNodeRe
     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::ReplaceNodeRe
     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:





More information about the llvm-commits mailing list