NCG: fast compilation of very large strings (#16190)
authorSylvain Henry <sylvain@haskus.fr>
Mon, 11 Feb 2019 16:40:00 +0000 (17:40 +0100)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Thu, 14 Feb 2019 07:29:54 +0000 (02:29 -0500)
commit1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3
tree4abf3da5c8a8d5fdd88903613d2ce42346e4943f
parent0f1eb88c93143359fa671bb72aceebc299c87a95
NCG: fast compilation of very large strings (#16190)

This patch adds an optimization into the NCG: for large strings
(threshold configurable via -fbinary-blob-threshold=NNN flag), instead
of printing `.asciz "..."` in the generated ASM source, we print
`.incbin "tmpXXX.dat"` and we dump the contents of the string into a
temporary "tmpXXX.dat" file.

See the note for more details.
compiler/main/DynFlags.hs
compiler/nativeGen/PPC/Ppr.hs
compiler/nativeGen/PprBase.hs
compiler/nativeGen/SPARC/Ppr.hs
compiler/nativeGen/X86/Ppr.hs
docs/users_guide/using-optimisation.rst