When we choose to use zeroinitializer for a trailing portion of an array
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 19 Jul 2018 21:38:56 +0000 (21:38 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 19 Jul 2018 21:38:56 +0000 (21:38 +0000)
commit83497d9eadd04a0ee57e4858a8f3b7b3cb99a22b
treee42ee23d708d2dea9a8e2d1b08c314fa927930a4
parent0b75dc5fa2e0552e7c9f3250e3487cf73dacd32b
When we choose to use zeroinitializer for a trailing portion of an array
constant, don't convert the rest into a packed struct.

If an array constant has a large non-zero portion and a large zero
portion, we want to emit the first part as an array and the rest as a
zeroinitializer if possible. This fixes a memory usage regression from
r333141 when compiling PHP.

llvm-svn: 337498
clang/lib/CodeGen/CGExprConstant.cpp
clang/test/CodeGen/init.c