llvm-project/bolt/test/Inputs/plt-tailcall.c
Paschalis Mpeis a13bc9714a
[BOLT][AArch64] Implement PLTCall optimization (#93584)
`convertCallToIndirectCall` applies the PLTCall optimization and returns
an (updated if needed) iterator to the converted call instruction. Since
AArch64 requires to inject additional instructions to implement this
pass, the relevant BasicBlock and an iterator was passed to the
`convertCallToIndirectCall`.

`NumCallsOptimized` is updated only on successful application of the
pass.

Tests:
- Inputs/plt-tailcall.c: an example of a tail call optimized PLT call.
- AArch64/plt-call.test: it is the actual A64 test, that runs the
PLTCall optimization on the above input file and verifies the
application of the pass to the calls: 'printf' and 'puts'.
2024-06-11 19:21:11 +01:00

9 lines
131 B
C

#include "stub.h"
int foo(char *c) {
printf("");
__attribute__((musttail)) return puts(c);
}
int main() { return foo("a"); }