<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [regression][hang] Trine1EE hangs GPU after loading screen on Mesa3D-17.3 and later"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105670#c19">Comment # 19</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [regression][hang] Trine1EE hangs GPU after loading screen on Mesa3D-17.3 and later"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105670">bug 105670</a>
              from <span class="vcard"><a class="email" href="mailto:t_arceri@yahoo.com.au" title="Timothy Arceri <t_arceri@yahoo.com.au>"> <span class="fn">Timothy Arceri</span></a>
</span></b>
        <pre>Ok here is a piglit test for the original GLSL IR bug:

<a href="https://patchwork.freedesktop.org/patch/213332/">https://patchwork.freedesktop.org/patch/213332/</a>

The NIR bug is a little harder to test reliably for since it depends on the
order in which optimisations are called so I just going to leave it for now.

Anyway this bug should now be fixed with the following commits:

commit 56b867395dee1a48594b27987d3bf68a4e745dda
Author: Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>>
Date:   Mon Mar 26 10:31:26 2018 +1100

    glsl: fix infinite loop caused by bug in loop unrolling pass

    Just checking for 2 jumps is not enough to be sure we can do a
    complex loop unroll. We need to make sure we also have also found
    2 loop terminators.

    Without this we were attempting to unroll a loop where the second
    jump was nested inside multiple ifs which loop analysis is unable
    to detect as a terminator. We ended up splicing out the first
    terminator but failed to actually unroll the loop, this resulted
    in the creation of a possible infinite loop.

    Fixes: 646621c66da9 "glsl: make loop unrolling more like the nir unrolling
path"

    Tested-by: Gert Wollny <<a href="mailto:gw.fossdev@gmail.com">gw.fossdev@gmail.com</a>>
    Reviewed-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>
    Bugzilla: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [regression][hang] Trine1EE hangs GPU after loading screen on Mesa3D-17.3 and later"
   href="show_bug.cgi?id=105670">https://bugs.freedesktop.org/show_bug.cgi?id=105670</a>

commit 629ee690addad9b3dc8f68cfff5ae09858f31caf
Author: Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>>
Date:   Mon Mar 26 11:41:51 2018 +1100

    nir: fix crash in loop unroll corner case

    When an if nesting inside anouther if is optimised away we can
    end up with a loop terminator and following block that looks like
    this:

            if ssa_596 {
                    block block_5:
                    /* preds: block_4 */
                    vec1 32 ssa_601 = load_const (0xffffffff /* -nan */)
                    break
                    /* succs: block_8 */
            } else {
                    block block_6:
                    /* preds: block_4 */
                    /* succs: block_7 */
            }
            block block_7:
            /* preds: block_6 */
            vec1 32 ssa_602 = phi block_6: ssa_552
            vec1 32 ssa_603 = phi block_6: ssa_553
            vec1 32 ssa_604 = iadd ssa_551, ssa_66

    The problem is the phis. Loop unrolling expects the last block in
    the loop to be empty once we splice the instructions in the last
    block into the continue branch. The problem is we cant move phis
    so here we lower the phis to regs when preparing the loop for
    unrolling. As it could be possible to have multiple additional
    blocks/ifs following the terminator we just convert all phis at
    the top level of the loop body for simplicity.

    We also add some comments to loop_prepare_for_unroll() while we
    are here.

    Fixes: 51daccb289eb "nir: add a loop unrolling pass"

    Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>>
    Bugzilla: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [regression][hang] Trine1EE hangs GPU after loading screen on Mesa3D-17.3 and later"
   href="show_bug.cgi?id=105670">https://bugs.freedesktop.org/show_bug.cgi?id=105670</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>