Open llvmbot opened 7 years ago
From ARMSubtarget.cpp:
// FIXME: Completely disable sibcall for Thumb1 since ThumbRegisterInfo:: // emitEpilogue is not ready for them. Thumb tail calls also use t2B, as // the Thumb1 16-bit unconditional branch doesn't have sufficient relocation // support in the assembler and linker to be used. This would need to be // fixed to fully support tail calls in Thumb1. // // Doing this is tricky, since the LDM/POP instruction on Thumb doesn't take // LR. This means if we need to reload LR, it takes an extra instructions, // which outweighs the value of the tail call; but here we don't know yet // whether LR is going to be used. Probably the right approach is to // generate the tail call here and turn it back into CALL/RET in // emitEpilogue if LR is used.
"add r7, sp, #0" is to establish frame. It's OK.
@llvm/issue-subscribers-backend-arm
Author: None (llvmbot)
Extended Description
test.c:
test.llvm.s:
Other compilers generate:
LLVM generated code has 2 problems: