[commit: ghc] wip/kavon-nosplit-llvm: adding spot to expand non-tail calls correctly (cd0746f)

git at git.haskell.org git at git.haskell.org
Tue Jun 27 09:14:50 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/kavon-nosplit-llvm
Link       : http://ghc.haskell.org/trac/ghc/changeset/cd0746f93e1f299fcaa51fb3aebd7ea575b5ac62/ghc

>---------------------------------------------------------------

commit cd0746f93e1f299fcaa51fb3aebd7ea575b5ac62
Author: Kavon Farvardin <kavon at farvard.in>
Date:   Wed May 10 19:23:03 2017 +0100

    adding spot to expand non-tail calls correctly


>---------------------------------------------------------------

cd0746f93e1f299fcaa51fb3aebd7ea575b5ac62
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index 0381324..43690e9 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -126,9 +126,12 @@ stmtToInstrs stmt = case stmt of
     CmmUnsafeForeignCall target res args
         -> genCall target res args
 
-    -- Tail call
+    -- Cmm call
     CmmCall { cml_target = arg,
-              cml_args_regs = live } -> genJump arg live
+              cml_args_regs = live,
+              cml_cont = maybeCont } -> case maybeCont of
+                Nothing -> genJump arg live -- Tail call
+                Just cont -> panic "todo: handle non-tail CmmCall"
 
     _ -> panic "Llvm.CodeGen.stmtToInstrs"
 



More information about the ghc-commits mailing list