<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - i965: Relax accumulator dependency scheduling on Gen < 6"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=77740#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - i965: Relax accumulator dependency scheduling on Gen < 6"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=77740">bug 77740</a>
              from <span class="vcard"><a class="email" href="mailto:itoral@igalia.com" title="Iago Toral <itoral@igalia.com>"> <span class="fn">Iago Toral</span></a>
</span></b>
        <pre>There seems to be a 'writes_accumulator' flag that is set to TRUE for
instructions that are known to write to the accumulator. The scheduling code
currently checks this flag on Gen >= 6 to compute dependencies among
instruction that read/write the accumulator.

For Gen < 6, there seems that for some very specific cases where this flag is
set to TRUE even if the scheduling code is not going to use it. As far as I can
see this is because the 'writes_accumulator' flag can also be used in the
optimization passes to remove dead code (and we don't want to eliminate code
that writes to the accumulator values that we intend to use).

So, I think for this task the 'writes_accumulator' flag alone is not enough: in
the scheduling code we need to know if the instruction can write to the
accumulator independently of whether we are expecting to use that value or not
and in Gen < 6, as far as I can see, there is a bunch of operations that can
write implicitly to the accumulator (mostly opcodes > 63).

I think the way to go about this would be to have:

bool instruction_backend::writes_accumulator_implicitly(int gen);

that we can call from the scheduling code to know if a particular instruction
can write implicitly  to the accumulator. In Gen >= 6, it would simply return
the value of 'writes_accumulator' but for Gen < 6 it would check also the
opcodes.

I think with that operation in place we could unify the scheduling code paths
for all Gens.

I'll write a patch for this but I will need help with the testing since I am
running on Gen 7.</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>