[PATCH] D42006: AArch64: Omit callframe setup/destroy when not necessary
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 17 15:34:17 PST 2018
MatzeB added a comment.
In https://reviews.llvm.org/D42006#979433, @efriedma wrote:
> Various backends handle this situation different ways... ARM emits an inline loop, x86 and x86 emit an inline loop rather than a call. PowerPC has a utility createMemcpyOutsideCallSeq which avoids nesting. And this would introduce, essentially, a third way to handle it. We should probably settle on one solution, if possible.
True, I could look into whether this simple solution would avoid the special case on PowerPC as well; but let's do that in a separate patch.
I'm not sure I want to change ARM/X86 from an inline loop to memcpy as it changes the performance characteristics (slightly slower for small sizes, faster for big sizes).
In any case I found this change desirable independently of it fixing the nesting issue.
> Some target-independent code has special handling for callframe operations... but I guess most of the handling isn't necessary? Does a call without call frame setup instructions correctly disable the red zone?
AArch64FrameLowering::canUseRedZone() checks for MachineFrameInfo::hasCalls() which is set based on MCInstructions having a Call flag set not based of the stackframe setup (you can grep for `setHasCalls(true)` if you are interested).
Repository:
rL LLVM
https://reviews.llvm.org/D42006
More information about the llvm-commits
mailing list