simple heuristic to reuse stack slots
commitb777cd6c4becf0d834f8fa549315fa11918a53be
authorQuentin Carbonneaux <quentin@c9x.me>
Tue, 12 Mar 2019 20:15:21 +0000 (12 21:15 +0100)
committerQuentin Carbonneaux <quentin@c9x.me>
Wed, 13 Mar 2019 21:02:29 +0000 (13 22:02 +0100)
tree10e19572ac0f336c5248565323d6a9c71dceeed1
parentfd65f4275be6dc6603be9610e88c55b8bfc1dc62
simple heuristic to reuse stack slots

On test/spill1.ssa, the stack frame of
the function f() goes from 56 bytes to
40 bytes.  That's a reduction of close
to 30%.

This patch also opens the door to
folding operations on spill slots.
For example

    movl $15, %r15d
    addl -X(%rbp), %r15d
    movl %r15d, -X(%rbp)

should become

    add $15, -X(%rbp)

when %r15d is not used afterwards.
spill.c