================
@@ -55,6 +55,6 @@ void test_most_a(void) {
 void test_pointers(void) {
   // CHECK-LABEL: define{{.*}} void @test_pointers()
   void *a[] = {&use, &use, &use, &use, &use, &use};
-  // CHECK: call void @llvm.memcpy.{{.*}}
+  // CHECK: call void @llvm.memset.{{.*}}
----------------
ilvokhin wrote:

I think this is a downside of the current logic: there is no dependency on the 
size of the initialization. If there are no more than 6 stores required, then 
`memset()` + series of stores will be done, regardless of the objects size, 
even if the array is only 6 stores in total and `memset()` is a pure waste. It 
is even noted in the TODO from `shouldUseBZeroPlusStoresToInitialize()`.

https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGDecl.cpp#L1013-L1021

Array of pointers just re-uses the same logic as was there before.

https://github.com/llvm/llvm-project/pull/240876
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to