[PATCH] D25791: [Hexagon] Weaken over-aggressive assertion in RDFGraph

Nirav Dave via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 13:43:52 PDT 2016


niravd created this revision.
niravd added a reviewer: kparzysz.
niravd added a subscriber: llvm-commits.

Improvements in consecutive merge stores in SelectionDAG (https://reviews.llvm.org/D14834)
trigger assertion failures in getNextRef during clang
bootstrapping. Rework to make cases that assertion failure return
default "nullptr" instead.


https://reviews.llvm.org/D25791

Files:
  lib/Target/Hexagon/RDFGraph.h


Index: lib/Target/Hexagon/RDFGraph.h
===================================================================
--- lib/Target/Hexagon/RDFGraph.h
+++ lib/Target/Hexagon/RDFGraph.h
@@ -946,11 +946,12 @@
         if (NextOnly)
           break;
         NA = G.addr<NodeBase*>(NA.Addr->getNext());
-      } else {
+      } else if (NA.Addr->getType() == NodeAttrs::Code) {
         // We've hit the beginning of the chain.
-        assert(NA.Addr->getType() == NodeAttrs::Code);
         NodeAddr<CodeNode*> CA = NA;
         NA = CA.Addr->getFirstMember(G);
+      } else { // No node found.
+        break;
       }
     }
     // Return the equivalent of "nullptr" if such a node was not found.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25791.75213.patch
Type: text/x-patch
Size: 689 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161019/4743b88f/attachment.bin>


More information about the llvm-commits mailing list