This revision was automatically updated to reflect the committed changes.
Closed by commit rL325478: [CodeGen] Initialize large arrays by copying from a
global (authored by kosarev, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D43181?vs=134590&id=134865#toc
Repository:
r
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
LGTM, thanks!
https://reviews.llvm.org/D43181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/l
kosarev updated this revision to Diff 134590.
kosarev added a comment.
Updated to consider the total size of the explicit initializers instead of
their number. The threshold value is adjusted respectively.
https://reviews.llvm.org/D43181
Files:
lib/CodeGen/CGExprAgg.cpp
test/CodeGen/init.c
rjmccall added inline comments.
Comment at: lib/CodeGen/CGExprAgg.cpp:421
+ // with explicit initializers should be large enough.
+ if (NumInitElements > 8 && elementType->isBuiltinType()) {
+CodeGen::CodeGenModule &CGM = CGF.CGM;
kosarev wrote:
> rjmccall
kosarev updated this revision to Diff 134042.
kosarev added a comment.
Improved as suggested to cover all trivially-copyable types.
https://reviews.llvm.org/D43181
Files:
lib/CodeGen/CGExprAgg.cpp
test/CodeGen/init.c
Index: test/CodeGen/init.c
==
kosarev added inline comments.
Comment at: lib/CodeGen/CGExprAgg.cpp:421
+ // with explicit initializers should be large enough.
+ if (NumInitElements > 8 && elementType->isBuiltinType()) {
+CodeGen::CodeGenModule &CGM = CGF.CGM;
rjmccall wrote:
> Is there
rjmccall added inline comments.
Comment at: lib/CodeGen/CGExprAgg.cpp:421
+ // with explicit initializers should be large enough.
+ if (NumInitElements > 8 && elementType->isBuiltinType()) {
+CodeGen::CodeGenModule &CGM = CGF.CGM;
Is there a good reason to
kosarev created this revision.
kosarev added a reviewer: rjmccall.
kosarev added a project: clang.
Herald added a subscriber: llvm-commits.
Currently, clang compiles explicit initializers for array elements into series
of store instructions. For large arrays of built-in types this results in
blo