[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Sorry for trouble, I will revert this for now. It's only the test that's causing the problem, the fix is fine, as far as I can tell. Still, better revert the whole thing for now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-10 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. The test is failing on non-arm macs: http://45.33.8.238/mac/38601/step_7.txt Please take a look and revert for now if it takes a while to fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113120/new/ https://reviews.llvm.o

[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-10 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG48bb5f4cbe8d: [clang] Add early exit when checking for const init of arrays. (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113120/new/

[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-08 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. thanks, lgtm! Comment at: clang/lib/AST/ExprConstant.cpp:10617 +// copying the data, which is wasteful. +for (const unsigned N : {1u, FinalSize}) { + unsigne

[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-05 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:10617 +// copying the data, which is wasteful. +for (const unsigned N : {1u, FinalSize}) { + unsigned OldElts = Value->getArrayInitializedElts(); kadircet wrote: > maybe unroll

[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-05 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 385102. adamcz marked an inline comment as done. adamcz added a comment. review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113120/new/ https://reviews.llvm.org/D113120 Files: clang/lib/AST/ExprCon

[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-04 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. thanks this looks amazing! i am also not an expert in these parts of the code but AFAICT the proposed behavior is in line with the contract. i am a little worried about the cost of extra copy (especially when there are only a handful of elements), but it should be prob

[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-03 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Hey Kadir. This is my naive approach at solving that large memory usage issue you reported. It works, although I wish this was more generic. I'm not an expert on this piece of code, so I tried to keep things similar to how they worked previously. Let me know what you thi

[PATCH] D113120: [clang] Add early exit when checking for const init of arrays.

2021-11-03 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: kadircet. adamcz requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Before this commit, on code like: struct S { ... }; S arr[1000]; while checking if arr is constexpr, clang wou