How can I know is it a normal call or tail call in TargetLowering::LowerCall() ? Since the CallLoweringInfo.IsTailCall is always false, said by llvm doxygen:
// IsTailCall should be modified by implementations of
// TargetLowering::LowerCall that perform tail call conversions.
bool IsTailCall = false;
I use .ll file whicn include tail call node to test the CallLoweringInfo.IsTailCall in LowerCall(), and it always be false , no matter it’s a normal call or tail call.
I implemented mayBeEmittedAsTailCall() in targetLowering, but Nothing changed . I used gdb to test it(seting a breakpoint in it), it turns out to be unused , nothing referenced it.
But it is called by llvm/lib/CodeGen/CodeGenPrepare.cpp, at least, it could be. Perhaps you could break where CodeGenPrepare calls the function and see if that path is taken. Then you can look at all the other conditions and find what else you need to add.