[LLVMbugs] [Bug 18883] New: Possible bug in MachineScheduler tryPressure

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 18 08:41:43 PST 2014


            Bug ID: 18883
           Summary: Possible bug in MachineScheduler tryPressure
           Product: new-bugs
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Keywords: code-quality
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: stephen.montgomery333 at gmail.com
                CC: atrick at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I've been working on an out-of-tree target for which register pressure
reduction is critical. Sometime between the 3.3 and 3.4 releases something
changed in MachineScheduler which caused my target to generate poor instruction
schedules. It's also still present on the trunk so far as I can see.

I believe that the problem may lie in static function tryPressure() in
MachineScheduler.cpp with the code whose comment starts:

// If one candidate decreases and the other increases, go with it.

If I understood correctly, if one candidate has UnitInc<0 and the other has
UnitInc>=0 then pick the candidate with UnitInc<0 because it reduces register
pressure. If that's the case, then should the call be to tryGreater(), in order
to pick the candidate for which UnitInc<0 has value 1, rather than tryLess()
which will pick the candidate for which is has value 0?

I can't easily supply a test case because I see this problem on my target,
which only has a few registers, but it might take quite a bit of work to make
it happen on other targets.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140218/21f39d2a/attachment.html>

More information about the llvm-bugs mailing list