[commit: ghc] wip/kavon-nosplit-llvm: adding a note about why we check for HscLlvm (02eb265)
git at git.haskell.org
git at git.haskell.org
Tue Jun 27 09:14:56 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/kavon-nosplit-llvm
Link : http://ghc.haskell.org/trac/ghc/changeset/02eb265a1998cfed1630936c60af884e899d63f4/ghc
>---------------------------------------------------------------
commit 02eb265a1998cfed1630936c60af884e899d63f4
Author: Kavon Farvardin <kavon at farvard.in>
Date: Fri May 12 17:36:07 2017 +0100
adding a note about why we check for HscLlvm
>---------------------------------------------------------------
02eb265a1998cfed1630936c60af884e899d63f4
compiler/cmm/MkGraph.hs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/compiler/cmm/MkGraph.hs b/compiler/cmm/MkGraph.hs
index 0c71210..eca5fbf 100644
--- a/compiler/cmm/MkGraph.hs
+++ b/compiler/cmm/MkGraph.hs
@@ -329,6 +329,12 @@ copyIn dflags conv area formals extra_stk
-- Factoring out the common parts of the copyout functions yielded something
-- more complicated:
+-- Note [llvm non-tail calls]
+-- We cannot explicily store a block address to the stack when using
+-- LLVM. Instead, we just leave space in the frame for the return
+-- address, which LLVM's assembly code generator will fill in later
+-- when it sees the CPSCALL pseudo-instruction.
+
data Transfer = Call | JumpRet | Jump | Ret deriving Eq
copyOutOflow :: DynFlags -> Convention -> Transfer -> Area -> [CmmExpr]
@@ -361,6 +367,7 @@ copyOutOflow dflags conv transfer area actuals updfr_off extra_stack_stuff
-- the return address if making a call
case transfer of
Call ->
+ -- see Note [llvm non-tail calls]
if hscTarget dflags == HscLlvm
then ([], widthInBytes (wordWidth dflags))
else
More information about the ghc-commits
mailing list