https://bugs.llvm.org/show_bug.cgi?id=46667
Bug ID: 46667
Summary: Missed optimization: AArch64 backend doesn’t elide
function prologue/epilogue emission for
noreturn+nounwind+!uwtable functions
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: AArch64
Assignee: unassignedb...@nondot.org
Reporter: v...@tsyrklevich.net
CC: arnaud.degrandmai...@arm.com,
llvm-bugs@lists.llvm.org, smithp...@googlemail.com,
ties.st...@arm.com
AArch64FrameLowering doesn’t implement enableCalleeSaveSkip() [1], so it gets
the default base class implementation that always returns false. Simply
implementing this method to return true would slightly slim down
noreturn+nounwind+!uwtable functions.
For example:
$ cat noret.c
int puts(const char *s);
__attribute__((noreturn)) __attribute__((nothrow))
void mytrap(void) {
puts("In mytrap\n");
__builtin_trap();
}
$ clang -arch arm64 -Oz -c -o noret.o noret.c -fomit-frame-pointer
-fno-unwind-tables -msign-return-address=non-leaf
$ objdump -d noret.o
…
0000000000000000 ltmp0:
0: 3f 23 03 d5 paciasp
4: fd 7b bf a9 stp x29, x30, [sp, #-16]!
8: 00 00 00 90 adrp x0, #0
c: 00 00 00 91 add x0, x0, #0
10: 00 00 00 94 bl #0 <ltmp0+0x10>
14: 20 00 20 d4 brk #0x1
If enableCalleeSaveSkip() were to return true on AArch64, the paciasp and stp
would be elided.
[1] https://reviews.llvm.org/D42898
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs