[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo
authorJessica Paquette <jpaquette@apple.com>
Tue, 4 Dec 2018 00:31:55 +0000 (00:31 +0000)
committerJessica Paquette <jpaquette@apple.com>
Tue, 4 Dec 2018 00:31:55 +0000 (00:31 +0000)
commitbce2086ad15417a2bfbcafd33464bc9452da1b77
tree040996e8cd377dd804de2823d6e9ac23cf2af131
parent2f5833ecd9aca404082113e9bde1e46351442a00
[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo

This moves the stack check logic into a lambda within getOutliningCandidateInfo.

This allows us to be less conservative with stack checks. Whether or not a
stack instruction is safe to outline is dependent on the frame variant and call
variant of the outlined function; only in cases where we modify the stack can
these be unsafe.

So, if we move that logic later, when we're looking at an individual candidate,
we can make better decisions here.

This gives some code size savings as a result.

llvm-svn: 348220
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/test/CodeGen/AArch64/machine-outliner-unsafe-stack-call.mir [new file with mode: 0644]