vitalybuka created this revision.
vitalybuka added reviewers: eugenis, pcc, jfb.
Herald added subscribers: cfe-commits, dexonsmith.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64386

Files:
  clang/lib/CodeGen/CGDecl.cpp
  clang/test/CodeGen/init-memset.c


Index: clang/test/CodeGen/init-memset.c
===================================================================
--- clang/test/CodeGen/init-memset.c
+++ clang/test/CodeGen/init-memset.c
@@ -26,7 +26,7 @@
 void test_all_a() {
   // CHECK-LABEL: define void @test_all_a()
   char a[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
-  // CHECK: call void @llvm.memcpy.{{.*}}
+  // CHECK: call void @llvm.memset.{{.*}}
   use(a);
 }
 
@@ -41,6 +41,7 @@
 void test_most_a() {
   // CHECK-LABEL: define void @test_most_a()
   char a[] = "aaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
-  // CHECK: call void @llvm.memcpy.{{.*}}
+  // CHECK: call void @llvm.memset.{{.*}}
+  // CHECK: store i8 122
   use(a);
 }
Index: clang/lib/CodeGen/CGDecl.cpp
===================================================================
--- clang/lib/CodeGen/CGDecl.cpp
+++ clang/lib/CodeGen/CGDecl.cpp
@@ -973,11 +973,6 @@
   if (GlobalSize <= SizeLimit)
     return nullptr;
 
-  // TODO: Remove. It's here just to keep behavior.
-  if (MFB.Other && MFB.Value &&
-      MFB.Value != llvm::ConstantInt::get(CGM.Int8Ty, 0))
-    return nullptr;
-
   if (!MFB.Value) {
     // We don't know most frequent byte, we may still completely initialize it
     // with small number of stores.


Index: clang/test/CodeGen/init-memset.c
===================================================================
--- clang/test/CodeGen/init-memset.c
+++ clang/test/CodeGen/init-memset.c
@@ -26,7 +26,7 @@
 void test_all_a() {
   // CHECK-LABEL: define void @test_all_a()
   char a[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
-  // CHECK: call void @llvm.memcpy.{{.*}}
+  // CHECK: call void @llvm.memset.{{.*}}
   use(a);
 }
 
@@ -41,6 +41,7 @@
 void test_most_a() {
   // CHECK-LABEL: define void @test_most_a()
   char a[] = "aaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
-  // CHECK: call void @llvm.memcpy.{{.*}}
+  // CHECK: call void @llvm.memset.{{.*}}
+  // CHECK: store i8 122
   use(a);
 }
Index: clang/lib/CodeGen/CGDecl.cpp
===================================================================
--- clang/lib/CodeGen/CGDecl.cpp
+++ clang/lib/CodeGen/CGDecl.cpp
@@ -973,11 +973,6 @@
   if (GlobalSize <= SizeLimit)
     return nullptr;
 
-  // TODO: Remove. It's here just to keep behavior.
-  if (MFB.Other && MFB.Value &&
-      MFB.Value != llvm::ConstantInt::get(CGM.Int8Ty, 0))
-    return nullptr;
-
   if (!MFB.Value) {
     // We don't know most frequent byte, we may still completely initialize it
     // with small number of stores.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D64386: CodeGen: Use m... Vitaly Buka via Phabricator via cfe-commits

Reply via email to