[PATCH] D137495: [LoongArch] Add GHC Calling Convention

Lin Runze via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 02:16:57 PST 2022


lrzlin added a comment.

@wangleiat 
Basically, what GHC calling convention do is mapping the virtual registers of `STG Machine` (part of the Haskell Runtime System) into real registers, so here in `ghc-cc.ll` must be `pcrel`, in short, it isn't a function call, but a simple value load process, using `got` here will lead to load a symbol twice, which isn't a function symbol, so it will not present in GOT table. More information about this calling convention could find on GHC llvm porting <https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/backends/llvm/ghc-llvm-porting>  
Also, using -pic or not is determined by GHC itself, and judge by its knowing behavior, `isPositionIndependent` is needed to avoid generating `got` patterns while compiling it using llvm backend.


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

https://reviews.llvm.org/D137495



More information about the llvm-commits mailing list