[CodeGen] Initialize large arrays by copying from a global
authorIvan A. Kosarev <ikosarev@accesssoftek.com>
Mon, 19 Feb 2018 09:49:11 +0000 (09:49 +0000)
committerIvan A. Kosarev <ikosarev@accesssoftek.com>
Mon, 19 Feb 2018 09:49:11 +0000 (09:49 +0000)
commite0ef348cb9c50d56be935e856c81e48cc1e744bd
tree508c062665bda87d32d14bc6f1d1565eb652b484
parent8a3698ada05f858ff98cbdf00df9562bdddc50c4
[CodeGen] Initialize large arrays by copying from a global

Currently, clang compiles explicit initializers for array
elements into series of store instructions. For large arrays of
built-in types this results in bloated output code and
significant amount of time spent on the instruction selection
phase. This patch fixes the issue by initializing such arrays
with global constants that store the binary image of the
initializer.

Differential Revision: https://reviews.llvm.org/D43181

llvm-svn: 325478
clang/lib/CodeGen/CGExprAgg.cpp
clang/test/CodeGen/init.c