[PATCH] D84602: [MSP430] Expose msp430_builtin calling convention to C code

Anatoly Trosinenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 04:33:14 PDT 2020


atrosinenko added a comment.

In D84602#2176584 <https://reviews.llvm.org/D84602#2176584>, @rjmccall wrote:

> Is there only one special calling convention, or is there any chance that different builtin functions would use different conventions?

It depends on how to define "builtin calling convention". Now it is in fact a "CC for builtin functions with two 64-bit arguments listed in Section 6.3 of EABI document". MSP430 EABI defines one such CC applied to a small subset of compiler helper functions, while others use the traditional CC like all other functions.

In D84602#2176592 <https://reviews.llvm.org/D84602#2176592>, @aaron.ballman wrote:

> To be clear, I also don't have a problem with it, but if users aren't supposed to be writing this attribute themselves and if we can apply the calling convention from markings in a .def file instead, I think it could be a cleaner approach to go that route instead. There's a lot of "ifs" in that sentence though. :-)

Do you mean detecting these functions by their names, like GCC does? If so, that trick would replace all the

- D84602: [MSP430] Expose msp430_builtin calling convention to C code <https://reviews.llvm.org/D84602>
- D84605: [IR][MSP430] Expose the "msp430_builtin" calling convention to .ll <https://reviews.llvm.org/D84605>
- D84636: [RFC] Make the default LibCall implementations from compiler-rt builtins library more customizable <https://reviews.llvm.org/D84636>

... provided this is considered as a generally suggested solution across the codebase, not a hack :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84602/new/

https://reviews.llvm.org/D84602



More information about the cfe-commits mailing list