Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
8707911a
Commit
8707911a
authored
Nov 21, 2018
by
Gabor Greif
💬
Browse files
Minor performance optimisation
only concat once
parent
4343d5af
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/llvmGen/LlvmCodeGen.hs
View file @
8707911a
{-# LANGUAGE CPP, TypeFamilies #-}
{-# LANGUAGE CPP, TypeFamilies
, ViewPatterns
#-}
-- -----------------------------------------------------------------------------
-- | This is the top-level module in the LLVM code generator.
...
...
@@ -125,13 +125,13 @@ cmmDataLlvmGens :: [(Section,CmmStatics)] -> LlvmM ()
cmmDataLlvmGens
statics
=
do
lmdatas
<-
mapM
genLlvmData
statics
let
(
g
s
s
,
tss
)
=
unzip
lmdatas
let
(
concat
->
gs
,
tss
)
=
unzip
lmdatas
let
regGlobal
(
LMGlobal
(
LMGlobalVar
l
ty
_
_
_
_
)
_
)
=
funInsert
l
ty
regGlobal
_
=
ret
ur
n
()
mapM_
regGlobal
(
concat
gss
)
gss'
<-
mapM
aliasify
$
concat
gs
s
regGlobal
_
=
p
ur
e
()
mapM_
regGlobal
gs
gss'
<-
mapM
aliasify
$
gs
renderLlvm
$
pprLlvmData
(
concat
gss'
,
concat
tss
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment