Revert "i965/fs: Reduce restrictions on interference in register coalescing."
authorMatt Turner <mattst88@gmail.com>
Mon, 26 May 2014 18:44:09 +0000 (11:44 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 26 May 2014 18:46:52 +0000 (11:46 -0700)
This reverts commit f770123f58b46459e8dbd27525162ee8ba89f30b.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78692

src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp

index 13b678afdc4d3574362a2fb08abec0a2b7e573b9..b2ab386ab6631e5285d762b7d19bd35e092f3718 100644 (file)
@@ -83,6 +83,19 @@ can_coalesce_vars(brw::fs_live_variables *live_intervals,
    if (!live_intervals->vars_interfere(var_from, var_to))
       return true;
 
+   /* We know that the live ranges of A (var_from) and B (var_to)
+    * interfere because of the ->vars_interfere() call above. If the end
+    * of B's live range is after the end of A's range, then we know two
+    * things:
+    *  - the start of B's live range must be in A's live range (since we
+    *    already know the two ranges interfere, this is the only remaining
+    *    possibility)
+    *  - the interference isn't of the form we're looking for (where B is
+    *    entirely inside A)
+    */
+   if (live_intervals->end[var_to] > live_intervals->end[var_from])
+      return false;
+
    assert(ip >= live_intervals->start[var_to]);
 
    fs_inst *scan_inst;