[ARM] Refactor the prologue/epilogue emission to be more robust.
authorQuentin Colombet <qcolombet@apple.com>
Mon, 20 Jul 2015 21:42:14 +0000 (21:42 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Mon, 20 Jul 2015 21:42:14 +0000 (21:42 +0000)
commit71a71485f40480ee28f257dfd38a29e859679342
tree5c1dfc91ddc1817dfb0982daafaaad9884cd5aab
parent48a9bdc6aa0385f0773445b9561e12456983c8da
[ARM] Refactor the prologue/epilogue emission to be more robust.

This is the first step toward supporting shrink-wrapping for this target.

The changes could be summarized by these items:
- Expand the tail-call return as part of the expand pseudo pass.
- Get rid of the assumptions that the epilogue is the exit block:
  * Do not assume which registers are free in the epilogue. (This indirectly
    improve the lowering of the code for the segmented stacks, see the test
    cases.)
  * Take into account that the basic block can be empty.

Related to <rdar://problem/20821730>

llvm-svn: 242714
llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
llvm/lib/Target/ARM/ARMFrameLowering.cpp
llvm/lib/Target/ARM/ARMFrameLowering.h
llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
llvm/test/CodeGen/ARM/fold-stack-adjust.ll
llvm/test/CodeGen/ARM/thumb1_return_sequence.ll
llvm/test/CodeGen/Thumb/pop.ll
llvm/test/CodeGen/Thumb/vargs.ll