[llvm-bugs] [Bug 31349] New: Don't "double allocate" the Y pointer register when there is a stack spill

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Dec 10 23:20:52 PST 2016


            Bug ID: 31349
           Summary: Don't "double allocate" the Y pointer register when
                    there is a stack spill
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: AVR
          Assignee: unassignedbugs at nondot.org
          Reporter: dylanmckay34 at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Currently, we always allow the 'Y' register to be allocated in all of the
instructions it can be used with.

In functions which do not spill registers, this is absolutely fine and there
are no issues.

In functions which DO spill registers, the Y register is used to store the
frame pointer. It will be stored here even if the Y register has already been
allocated for existing live intervals within the function.

This means that we can clobber Y without restoring and then use the clobbered
value in the same function.

We previously had a hack (before this backend was upstreamed) that would teach
the register allocator that if it generates the first spill in a function, it
will rewind allocation to the start of the function and then mark 'Y' as a
reserved register. It would then reallocate the function and there would be no
"overlaps" of the Y register.

We will need to come up with a proper fix, as this is likely to break many
programs currently.

Raised from PR31346.

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/20161211/418c861c/attachment.html>

More information about the llvm-bugs mailing list