[clang] [llvm] [GlobalOpt] Add TTI interface useFastCCForInternalCall for FASTCC (PR #164768)

Alex Bezzubikov via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 29 11:36:03 PDT 2025


zuban32 wrote:

> I sort of understand the logic of "we need a calling convention, fastcc isn't useful on x86-64, let's repurpose it". But there's a significant benefit to giving a calling convention with unusual semantics (like, it only works on targets that have APX enabled) its own name; it's less confusing, and it cleanly allows future extensions for all targets. And introducing a new calling convention really isn't that much more work.
> 
> It isn't likely the set of integer registers on x86 will change again, but floating-point/vector registers have been getting constant updates.

@efriedma-quic  I'm confused here a little bit, if `fastcc` is an internal LLVM convention which can only appear in the code when GlobalOpt considers it safe, why are we discussing it here as a sort of an established ABI that's been here for years?

Aren't it being confused here with MS `fastcall` which is `x86_fastcall`, entirely different beast?

>From the LangRef:

> “fastcc” - The fast calling convention
This calling convention attempts to make calls as fast as possible (e.g. by passing things in registers). This calling convention allows the target to use whatever tricks it wants to produce fast code for the target, without having to conform to an externally specified ABI (Application Binary Interface)



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


More information about the cfe-commits mailing list