[llvm] [XRay][X86] Handle conditional calls when lowering patchable tail calls. (PR #89364)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon May 27 18:21:28 PDT 2024
MaskRay wrote:
> By the way, I'm not sure whether this bug happens on other architectures with xray support. The most straightforward reference I found to emitting conditional tail calls was
>
> https://github.com/llvm/llvm-project/blob/c60aa430dc4085d276a630699323068bf36bd9d8/llvm/lib/CodeGen/BranchFolding.cpp#L1536
>
> and `canMakeTailCallConditional()` is only true on x86. I'm not sure if I am missing other places that might generate these though.
Yes. It seems that only x86 performs conditional tail call.
Most RISC architectures cannot perform conditional tail call (except very specific assembly files) because conditional branches usually have a shorter range than unconditional branches and might not reach the destination at link time. RISC architectures typically do not implement range extension thunks for conditional branches.
@deanberris may have an idea why xray handles tail calls specially.
https://github.com/llvm/llvm-project/pull/89364
More information about the llvm-commits
mailing list