<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [BDW] GPU hang in Shogun2"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=92234#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [BDW] GPU hang in Shogun2"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=92234">bug 92234</a>
              from <span class="vcard"><a class="email" href="mailto:pavel.e.popov@intel.com" title="pavel.e.popov@intel.com">pavel.e.popov@intel.com</a>
</span></b>
        <pre>Found that hangs on "Total War: Napoleon" and "Total War: Empire" are gone
without this commit (nir/opt_algebraic: Add some constant bcsel reductions):
   
<a href="http://cgit.freedesktop.org/mesa/mesa/commit/?id=604ae33c8b95a97ba586780324566fd21c59b695">http://cgit.freedesktop.org/mesa/mesa/commit/?id=604ae33c8b95a97ba586780324566fd21c59b695</a>

Observed that these additional optimizations somehow lead to hangs:
+# Add optimizations to handle the case where the result of a ternary is
+# compared to a constant.  This way we can take things like
+#
+# (a ? 0 : 1) > 0
+#
+# and turn it into
+#
+# a ? (0 > 0) : (1 > 0)
+#
+# which constant folding will eat for lunch.  The resulting ternary will
+# further get cleaned up by the boolean reductions above and we will be
+# left with just the original variable "a".
+for op in ['flt', 'fge', 'feq', 'fne',
+           'ilt', 'ige', 'ieq', 'ine', 'ult', 'uge']:
+   optimizations += [
+      ((op, ('bcsel', 'a', '#b', '#c'), '#d'),
+       ('bcsel', 'a', (op, 'b', 'd'), (op, 'c', 'd'))),
+      ((op, '#d', ('bcsel', a, '#b', '#c')),
+       ('bcsel', 'a', (op, 'd', 'b'), (op, 'd', 'c'))),
+   ]
+

Also made sure that hangs on "Total War: Shogun2" are gone without this commit
(nir: Recognize (a < c || b < c) as min(a, b) < c.)
   
<a href="http://cgit.freedesktop.org/mesa/mesa/commit/?id=f5cf74d8ba8ce30b9d53b2198e5122ed72f1dcff">http://cgit.freedesktop.org/mesa/mesa/commit/?id=f5cf74d8ba8ce30b9d53b2198e5122ed72f1dcff</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>