aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/AsmParser/LLLexer.cpp
diff options
context:
space:
mode:
authorSacha Coppey <sacha.coppey@oracle.com>2023-11-17 16:01:00 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2023-11-17 16:30:09 +0000
commitaeedc0763772b398a725ab34d8a9cc1d698c60cb (patch)
tree0ca52a6ad3143fa8858b5ae15f05ae29aa408a77 /llvm/lib/AsmParser/LLLexer.cpp
parent19e745890b8658825de63ce4d839537c7707e425 (diff)
downloadllvm-aeedc0763772b398a725ab34d8a9cc1d698c60cb.zip
llvm-aeedc0763772b398a725ab34d8a9cc1d698c60cb.tar.gz
llvm-aeedc0763772b398a725ab34d8a9cc1d698c60cb.tar.bz2
[IR] Add GraalVM calling conventions
Adds GraalVM calling conventions. The only difference with the default calling conventions is that GraalVM reserves two registers for the heap base and the thread. Since the registers are then accessed by name, getRegisterByName has to be updated accordingly. This patch implements the calling conventions only for X86, AArch64 and RISC-V. For X86, the reserved registers are X14 and X15. For AArch64, they are X27 and X28. For RISC-V, they are X23 and X27. This patch has been used by the LLVM backend of GraalVM's Native Image project in production for around 4 months with no major issues. Differential Revision: https://reviews.llvm.org/D151107
Diffstat (limited to 'llvm/lib/AsmParser/LLLexer.cpp')
-rw-r--r--llvm/lib/AsmParser/LLLexer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index da9e9f4..fb11104 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -633,6 +633,7 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(amdgpu_gfx);
KEYWORD(tailcc);
KEYWORD(m68k_rtdcc);
+ KEYWORD(graalcc);
KEYWORD(cc);
KEYWORD(c);