From: simonpj Date: Tue, 23 Sep 2003 15:09:09 +0000 (+0000) Subject: [project @ 2003-09-23 15:09:09 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~429 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=add773aa5d3af794c935345b193de1865945aa4e;p=ghc-hetmet.git [project @ 2003-09-23 15:09:09 by simonpj] -------------------------- Make MachString literals a bit bigger -------------------------- Up to now, unboxed string literals of up to 3 characters had size 1, which means they are inlined in place of a variable. That seems over-eager (duplication), so I've upped their size a bit. --- diff --git a/ghc/compiler/basicTypes/Literal.lhs b/ghc/compiler/basicTypes/Literal.lhs index d71bedf..edc77b7 100644 --- a/ghc/compiler/basicTypes/Literal.lhs +++ b/ghc/compiler/basicTypes/Literal.lhs @@ -288,10 +288,12 @@ litIsDupable other = True litSize :: Literal -> Int -- Used by CoreUnfold.sizeExpr -litSize (MachStr str) = 1 + (lengthFS str `div` 4) +litSize (MachStr str) = 1 + ((lengthFS str + 3) `div` 4) -- Every literal has size at least 1, otherwise -- f "x" -- might be too small + -- [Sept03: make literal strings a bit bigger to avoid fruitless + -- duplication of little strings] litSize _other = 1 \end{code}