LLVM may annotate the function with fastcc if there has only one caller and there're no other caller out of the module and the function is not naked or contain variable arguments.
The fastcc functions could pass the arguments by the caller saved registers.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2046 | nit: no need to put braces around one liners. |
I like this change.
fastcc is LLVM-internal only, right? Checking that we don't have to care about splitting operands that don't fit into registers, or any other psABI details, right?
You said you had some performance numbers, it would be useful to have them in a comment on this patch.
I wonder whether it would be nicer to add CC_RISCV_FastCC as a function, much like CC_RISCV, instead, to match the current code style.
Yes, to my understanding, fastcc doesn't need to care about psABI details.
Ok, the code style has been synced and it also easier to extend when we support RV32E in the future, thanks.
I was worried about how this would work with varargs, but I see from the IR Reference that fastcc requires both prototypes to match, and disallows varargs.
In the future we should refactor this into a tablegen'd CallingConvention, but that can happen later.
nit: no need to put braces around one liners.