diff options
author | Geoffrey Mainland <gmainlan@microsoft.com> | 2012-10-18 15:43:27 +0100 |
---|---|---|
committer | Geoffrey Mainland <gmainlan@microsoft.com> | 2012-10-30 20:50:48 +0000 |
commit | dcf88e66caefb3e79e68d4c149a878bc6eca639e (patch) | |
tree | a4c24d48b2aa3c52f3c8ddc4bad0f36a08ee9002 /compiler/llvmGen/LlvmCodeGen.hs | |
parent | e2f6bbd3a27685bc667655fdb093734cb565b4cf (diff) | |
download | haskell-dcf88e66caefb3e79e68d4c149a878bc6eca639e.tar.gz |
Generate correct LLVM for the new register allocation scheme.
We now have accurate global register liveness information attached to all Cmm
procedures and jumps. With this patch, the LLVM back end uses this information
to pass only the live floating point (F and D) registers on tail calls. This
makes the LLVM back end compatible with the new register allocation strategy.
Ideally the GHC LLVM calling convention would put all registers that are always
live first in the parameter sequence. Unfortunately the specification is written
so that on x86-64 SpLim (always live) is passed after the R registers. Therefore
we must always pass *something* in the R registers, so we pass the LLVM value
undef.
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen.hs')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs index 9a5ac1f522..571348f577 100644 --- a/compiler/llvmGen/LlvmCodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen.hs @@ -41,11 +41,11 @@ llvmCodeGen dflags h us cmms (cdata,env) = {-# SCC "llvm_split" #-} foldr split ([], initLlvmEnv dflags) cmm split (CmmData s d' ) (d,e) = ((s,d'):d,e) - split p@(CmmProc _ l _ _) (d,e) = + split p@(CmmProc _ l live _) (d,e) = let lbl = strCLabel_llvm env $ case topInfoTable p of Nothing -> l Just (Statics info_lbl _) -> info_lbl - env' = funInsert lbl (llvmFunTy dflags) e + env' = funInsert lbl (llvmFunTy dflags live) e in (d,env') in do showPass dflags "LlVM CodeGen" |