diff --git a/lib/Object/IRObjectFile.cpp b/lib/Object/IRObjectFile.cpp index d01910811a6..0639c71d1b0 100644 --- a/lib/Object/IRObjectFile.cpp +++ b/lib/Object/IRObjectFile.cpp @@ -245,6 +245,11 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const { Res |= BasicSymbolRef::SF_FormatSpecific; } + if (auto *F = dyn_cast(GV)) { + if (F->getName().startswith("llvm.")) + Res |= BasicSymbolRef::SF_FormatSpecific; + } + return Res; } diff --git a/test/Object/mangle-ir.ll b/test/Object/mangle-ir.ll index 725d788a19a..5b3cd09cb7c 100644 --- a/test/Object/mangle-ir.ll +++ b/test/Object/mangle-ir.ll @@ -2,7 +2,13 @@ target datalayout = "m:o" +; CHECK-NOT: memcpy ; CHECK: T _f +; CHECK-NOT: memcpy + define void @f() { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* null, i8* null, i64 0, i32 1, i1 false) ret void } + +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)