diff options
author | simonmar <unknown> | 2005-02-01 15:08:06 +0000 |
---|---|---|
committer | simonmar <unknown> | 2005-02-01 15:08:06 +0000 |
commit | 8bcb01b5fe1976556ec74f682128fb0a2eb75586 (patch) | |
tree | 052811818d7df3c837de6d80b4b2a97dc7ada06e /ghc/compiler/codeGen | |
parent | cace43e1d8a96e2eed803b8f45392d3772f14156 (diff) | |
download | haskell-8bcb01b5fe1976556ec74f682128fb0a2eb75586.tar.gz |
[project @ 2005-02-01 15:08:06 by simonmar]
small perf hack in emitVectoredReturnInstr: work around lack of CSE in
the NCG by assigning info_amode to a new temporary.
Diffstat (limited to 'ghc/compiler/codeGen')
-rw-r--r-- | ghc/compiler/codeGen/CgInfoTbls.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ghc/compiler/codeGen/CgInfoTbls.hs b/ghc/compiler/codeGen/CgInfoTbls.hs index 7692e7d71b..981b4b0c69 100644 --- a/ghc/compiler/codeGen/CgInfoTbls.hs +++ b/ghc/compiler/codeGen/CgInfoTbls.hs @@ -44,7 +44,8 @@ import CgCallConv ( isBigLiveness, mkLivenessCLit, buildContLiveness, CtrlReturnConvention(..) ) import CgUtils ( mkStringCLit, packHalfWordsCLit, mkWordCLit, cmmOffsetB, cmmOffsetExprW, cmmLabelOffW, cmmOffsetW, - emitDataLits, emitRODataLits, emitSwitch, cmmNegate ) + emitDataLits, emitRODataLits, emitSwitch, cmmNegate, + newTemp ) import CgMonad import CmmUtils ( mkIntCLit, zeroCLit ) @@ -348,7 +349,11 @@ emitVectoredReturnInstr :: CmmExpr -- *Zero-indexed* constructor tag -> Code emitVectoredReturnInstr zero_indexed_tag = do { info_amode <- getSequelAmode - ; let target = retVec info_amode zero_indexed_tag + -- HACK! assign info_amode to a temp, because retVec + -- uses it twice and the NCG doesn't have any CSE yet. + ; x <- newTemp wordRep + ; stmtC (CmmAssign x info_amode) + ; let target = retVec (CmmReg x) zero_indexed_tag ; stmtC (CmmJump target []) } |