[Mesa-dev] [Bug 55224] New: NV50 Gallium codegen RA incorrectly tracks interference for 64-bit / 128-bit registers

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Sep 22 09:32:11 PDT 2012


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

             Bug #: 55224
           Summary: NV50 Gallium codegen RA incorrectly tracks
                    interference for 64-bit / 128-bit registers
    Classification: Unclassified
           Product: Mesa
           Version: git
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Other
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: jay at jcornwall.me


Created attachment 67548
  --> https://bugs.freedesktop.org/attachment.cgi?id=67548
Test case to reproduce register interference

Problem:

The attached test case reproduces a problem in Gallium NV50 (+NVC0) codegen
with register interference tracking for a 64-bit register. The compiler
maintains a live register across the execution of a built-in function call
which has declared its intention to clobber it.

Explanation:

nv50_ir_ra.cpp:1238 in GCRA::checkInterference uses RegisterSet::occupy to
track registers used by interfering nodes. It is possible for the following
situation to arise:

  * r0 is set in the RegisterSet
  * RegisterSet::occupy is called to set r0d as well

RegisterSet::occupy will fail to mark r0d as set, by noting the overlap with r0
during the call to BitSet::testRange. This is correct behavior for other users
of RegisterSet::occupy.

However, failure is neither checked nor desirable for GCRA::checkInterference.
It doesn't matter that two other nodes use overlapping registers - just that
the RegisterSet tracks the union of the two as occupied.

Solution:

The attached patch proposes a fix for this. It adds a fourth parameter to
RegisterSet::occupy to skip the BitSet::testRange check as the callee desires.

This may not be an optimal solution and I have not confirmed whether similar
problems could arise for other users of RegisterSet::occupy. This patch only
affects the behavior of the single, known problematic call site.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list