]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Move cyclic path redundancy into reduce loop
authorJustin Viiret <justin.viiret@intel.com>
Sun, 10 Jan 2016 22:25:32 +0000 (09:25 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 1 Mar 2016 00:29:00 +0000 (11:29 +1100)
Sometimes cyclic path redundancy can uncover further reduction work that
can be done by the other passes in the reduce loop.

src/nfagraph/ng.cpp

index 75884181958d34427cee803b6855543253dfe02d..bc3aea381b114a7408d8a35618535659aeb82df9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -167,6 +167,7 @@ void reduceGraph(NGHolder &g, som_type som, bool utf8,
         changed |= removeEdgeRedundancy(g, som, cc);
         changed |= reduceGraphEquivalences(g, cc);
         changed |= removeRedundancy(g, som);
+        changed |= removeCyclicPathRedundancy(g);
         if (!changed) {
             DEBUG_PRINTF("graph unchanged after pass %u, stopping\n", pass);
             break;
@@ -183,7 +184,6 @@ void reduceGraph(NGHolder &g, som_type som, bool utf8,
         removeEdgeRedundancy(g, som, cc);
     }
 
-    removeCyclicPathRedundancy(g);
     removeCyclicDominated(g, som);
 
     if (!som) {