]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
tighten ghost vertex checks
authorJustin Viiret <justin.viiret@intel.com>
Mon, 20 Jun 2016 00:37:22 +0000 (10:37 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 8 Jul 2016 00:59:40 +0000 (10:59 +1000)
src/rose/rose_build_role_aliasing.cpp

index cbd56b9062b1cdabaf2a67b7b4a1919f76c02e0f..e3b8be2f6fa98fd38ed27cd62c117cfc49290490 100644 (file)
@@ -380,15 +380,19 @@ bool sameGhostProperties(const RoseBuildImpl &build, RoseVertex a,
             ghost_b.push_back(e.first);
         }
     }
-    if (!ghost_a.empty() || !ghost_a.empty()) {
-        DEBUG_PRINTF("ghost map targets\n");
-        if (build.g[a].literals != build.g[b].literals) {
-            DEBUG_PRINTF("diff literals\n");
-            return false;
-        }
+
+    if (ghost_a.empty() && ghost_b.empty()) {
+        return true;
     }
 
-    return true;
+    if (ghost_a.empty() || ghost_b.empty()) {
+        DEBUG_PRINTF("only one is a ghost vertex\n");
+        return false;
+    }
+
+    // Both are ghost vertices: it is only safe to merge them if their literals
+    // are the same.
+    return build.g[a].literals == build.g[b].literals;
 }
 
 static