summary refs log tree commit diff
path: root/fold.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2019-03-12 21:15:21 +0100
committerQuentin Carbonneaux <quentin@c9x.me>2019-03-13 22:02:29 +0100
commitb777cd6c4becf0d834f8fa549315fa11918a53be (patch)
tree10e19572ac0f336c5248565323d6a9c71dceeed1 /fold.c
parentfd65f4275be6dc6603be9610e88c55b8bfc1dc62 (diff)
downloadroux-b777cd6c4becf0d834f8fa549315fa11918a53be.tar.gz
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.
Diffstat (limited to 'fold.c')
0 files changed, 0 insertions, 0 deletions