diff options
author | Gabor Greif <ggreif@gmail.com> | 2018-11-21 18:30:49 +0100 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2018-11-22 10:53:27 +0100 |
commit | 8707911a8ba42619e77315f7c0443546991a6668 (patch) | |
tree | 1c548c7b904cc50d3f442150667a4a3024f8aed2 | |
parent | 4343d5af30d4b4fffb8be05616736e5920b6999a (diff) | |
download | haskell-8707911a8ba42619e77315f7c0443546991a6668.tar.gz |
Minor performance optimisation
only concat once
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs index 3fcf83ab2f..b003cbc123 100644 --- a/compiler/llvmGen/LlvmCodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen.hs @@ -1,4 +1,4 @@ -{-# 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 (gss, tss) = unzip lmdatas + let (concat -> gs, tss) = unzip lmdatas let regGlobal (LMGlobal (LMGlobalVar l ty _ _ _ _) _) = funInsert l ty - regGlobal _ = return () - mapM_ regGlobal (concat gss) - gss' <- mapM aliasify $ concat gss + regGlobal _ = pure () + mapM_ regGlobal gs + gss' <- mapM aliasify $ gs renderLlvm $ pprLlvmData (concat gss', concat tss) |