diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/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. diff --git a/clang/test/CodeGen/init-memset.c b/clang/test/CodeGen/init-memset.c --- a/clang/test/CodeGen/init-memset.c +++ b/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); }