[llvm] [llvm] Consistently respect `naked` fn attribute in `TargetFrameLowering::hasFP()` (PR #106014)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 25 18:10:12 PDT 2024


arichardson wrote:

> I was going to do that initially. But there are a few targets for which I didn't make this change - namely AMDGPU, BPF, Lanai, and NVPTX. I don't know enough about these targets to make the change with confidence there. BPF, Lanai, and NVPTX in particular just return true unconditionally in their `hasFP()` implementations; AMDGPU seems a bit more 'typical' in its `SIFrameLowering::hasFP()` implementation, though.

I would say this property should hold for all architectures that support naked functions. The GCC documentations states:
> This attribute allows the compiler to construct the requisite function declaration, while allowing the body of the function to be assembly code. The specified function will not have prologue/epilogue sequences generated by the compiler.

My guess is the unconditional true return is just because naked functions were not considered when writing those functions?

https://github.com/llvm/llvm-project/pull/106014


More information about the llvm-commits mailing list