[Bug 90520] Register spilling clobbers registers used elsewhere in the shader

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue May 19 17:38:11 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=90520

--- Comment #1 from Jason Ekstrand <jason at jlekstrand.net> ---
(In reply to Neil Roberts from comment #0)
> When a register is spilled it will emit a SHADER_OPCODE_GEN4_SCRATCH_WRITE
> pseudo opcode whenever it writes to the spilled register. When the code for
> this opcode is generated it will sneak in a write to MRF registers 14 and 15
> in order to set up the message. On Gen7+ these MRF registers are mapped to
> GRF registers 126 and 127. The trouble is that the register allocator
> doesn't know that the pseudo opcode does these writes so it will happily
> allocate g126-g127 to something else and then it will get clobbered when the
> scratch write is done.

This seems fishy.  The allocator is supposed to detect that message registers
are being used and reserve space at the top of the GRF for them.  This should
trigger even if it's coming from the SHADER_OPCODE_GEN4_SCRATCH_WRITE opcode. 
The one exception to this is the payload for the final FB-write which we
allocate specially.

I did find one subtle bug in implied_mrf_writes() which I just sent a patch to
fix.  However, I doubt that was enough to actually cause the problem you're
describing.

Could you please attach the INTEL_DEBUG=fs dump?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20150520/4d265e6f/attachment.html>


More information about the intel-3d-bugs mailing list