summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CodeGen
diff options
context:
space:
mode:
authorMichal Terepeta <michal.terepeta@gmail.com>2019-03-30 18:36:36 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-04-08 14:29:34 -0400
commit63b7d5fb9d695dafc243cbf6f9f70b06030c0dea (patch)
tree468304a4f8f6083c367a34ccf50142357e6db311 /compiler/codeGen/CodeGen
parent3a38ea4487173f0f8e3693a75d1c5c7d33f12f05 (diff)
downloadhaskell-63b7d5fb9d695dafc243cbf6f9f70b06030c0dea.tar.gz
Generate straightline code for inline array allocation
GHC has an optimization for allocating arrays when the size is statically known -- it'll generate the code allocating and initializing the array inline (instead of a call to a procedure from `rts/PrimOps.cmm`). However, the generated code uses a loop to do the initialization. Since we already check that the requested size is small (we check against `maxInlineAllocSize`), we can generate faster straightline code instead. This brings about 15% improvement for `newSmallArray#` in my testing and slightly simplifies the code in GHC. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Diffstat (limited to 'compiler/codeGen/CodeGen')
0 files changed, 0 insertions, 0 deletions