i965/fs: Track dependencies in instruction scheduling per reg offset.
authorMatt Turner <mattst88@gmail.com>
Wed, 9 Oct 2013 05:54:46 +0000 (22:54 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 8 Jul 2014 18:12:02 +0000 (11:12 -0700)
commit099cbc1477ff78cdfbecd5f797b98d624110f779
tree032c4e0c4d7264f04f11e8f08986e03c88878fbf
parent7a641dd58ddfba2b7e9483278c05ba752864213d
i965/fs: Track dependencies in instruction scheduling per reg offset.

Previously instruction scheduling tracked dependencies on a per-register
basis. This meant that there was an artificial dependency between
interpolation instructions writing into the same virtual register.

Instruction scheduling would insert a number of instructions between the
two instructions in this example, when they are actually independent.

   linterp vgrf8+0.0:F, hw_reg2:F, hw_reg3:F, hw_reg6:F
   linterp vgrf8+1.0:F, hw_reg2:F, hw_reg3:F, hw_reg6+16:F

This lead to cases where the first texture coordinate is interpolated at
the beginning of the shader, but the second is done immediately before
the texture operation that uses it as a source.

After this change, the artificial dependency is removed and the
interpolation instructions are scheduled together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp