pengfei created this revision. pengfei added reviewers: RKSimon, ldionne, bkramer. Herald added a project: All. pengfei requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
GCC folks decided to make the mangling of __bf16 the same as std::bfloat16_t. We need to match with GCC: https://godbolt.org/z/jjne5qxPa Other targets may still use their own mangling way. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D136919 Files: clang/lib/Basic/Targets/X86.h clang/test/CodeGen/X86/bfloat-mangle.cpp Index: clang/test/CodeGen/X86/bfloat-mangle.cpp =================================================================== --- clang/test/CodeGen/X86/bfloat-mangle.cpp +++ clang/test/CodeGen/X86/bfloat-mangle.cpp @@ -3,6 +3,6 @@ // RUN: %clang_cc1 -triple i386-windows-msvc -target-feature +sse2 -emit-llvm -o - %s | FileCheck %s --check-prefixes=WINDOWS // RUN: %clang_cc1 -triple x86_64-windows-msvc -target-feature +sse2 -emit-llvm -o - %s | FileCheck %s --check-prefixes=WINDOWS -// LINUX: define {{.*}}void @_Z3foou6__bf16(bfloat noundef %b) +// LINUX: define {{.*}}void @_Z3fooDF16b(bfloat noundef %b) // WINDOWS: define {{.*}}void @"?foo@@YAXU__bf16@__clang@@@Z"(bfloat noundef %b) void foo(__bf16 b) {} Index: clang/lib/Basic/Targets/X86.h =================================================================== --- clang/lib/Basic/Targets/X86.h +++ clang/lib/Basic/Targets/X86.h @@ -410,7 +410,7 @@ return getPointerWidthV(AddrSpace); } - const char *getBFloat16Mangling() const override { return "u6__bf16"; }; + const char *getBFloat16Mangling() const override { return "DF16b"; }; }; // X86-32 generic target
Index: clang/test/CodeGen/X86/bfloat-mangle.cpp =================================================================== --- clang/test/CodeGen/X86/bfloat-mangle.cpp +++ clang/test/CodeGen/X86/bfloat-mangle.cpp @@ -3,6 +3,6 @@ // RUN: %clang_cc1 -triple i386-windows-msvc -target-feature +sse2 -emit-llvm -o - %s | FileCheck %s --check-prefixes=WINDOWS // RUN: %clang_cc1 -triple x86_64-windows-msvc -target-feature +sse2 -emit-llvm -o - %s | FileCheck %s --check-prefixes=WINDOWS -// LINUX: define {{.*}}void @_Z3foou6__bf16(bfloat noundef %b) +// LINUX: define {{.*}}void @_Z3fooDF16b(bfloat noundef %b) // WINDOWS: define {{.*}}void @"?foo@@YAXU__bf16@__clang@@@Z"(bfloat noundef %b) void foo(__bf16 b) {} Index: clang/lib/Basic/Targets/X86.h =================================================================== --- clang/lib/Basic/Targets/X86.h +++ clang/lib/Basic/Targets/X86.h @@ -410,7 +410,7 @@ return getPointerWidthV(AddrSpace); } - const char *getBFloat16Mangling() const override { return "u6__bf16"; }; + const char *getBFloat16Mangling() const override { return "DF16b"; }; }; // X86-32 generic target
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits