diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-05-23 00:09:29 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-05-23 00:09:29 +0000 |
commit | 9062bbf41932e013d00347f6a98848792a6b13c6 (patch) | |
tree | 5b49f60b8ec0bde6529912012250980a5eeb7d4e /clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | |
parent | 52d0abd7819382ac33ba0226d830638cfcc5a44f (diff) | |
download | bcm5719-llvm-9062bbf41932e013d00347f6a98848792a6b13c6.tar.gz bcm5719-llvm-9062bbf41932e013d00347f6a98848792a6b13c6.zip |
Use zeroinitializer for (trailing zero portion of) large array initializers
more reliably.
Clang has two different ways it emits array constants (from InitListExprs and
from APValues), and both had some ability to emit zeroinitializer, but neither
was able to catch all cases where we could use zeroinitializer reliably. In
particular, emitting from an APValue would fail to notice if all the explicit
array elements happened to be zero. In addition, for large arrays where only an
initial portion has an explicit initializer, we would emit the complete
initializer (which could be huge) rather than emitting only the non-zero
portion. With this change, when the element would have a suffix of more than 8
zero elements, we emit the array constant as a packed struct of its initial
portion followed by a zeroinitializer constant for the trailing zero portion.
In passing, I found a bug where SemaInit would sometimes walk the entire array
when checking an initializer that only covers the first few elements; that's
fixed here to unblock testing of the rest.
Differential Revision: https://reviews.llvm.org/D47166
llvm-svn: 333044
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp')
0 files changed, 0 insertions, 0 deletions