Date: Fri, 17 Aug 2018 16:26:00 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337979 - projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets Message-ID: <201808171626.w7HGQ0Sp020544@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Fri Aug 17 16:25:59 2018 New Revision: 337979 URL: https://svnweb.freebsd.org/changeset/base/337979 Log: For now, revert upstream clang r323281 (by Wei Mi): Adjust MaxAtomicInlineWidth for i386/i486 targets. This is to fix the bug reported in https://bugs.llvm.org/show_bug.cgi?id=34347#c6. Currently, all MaxAtomicInlineWidth of x86-32 targets are set to 64. However, i386 doesn't support any cmpxchg related instructions. i486 only supports cmpxchg. So in this patch MaxAtomicInlineWidth is reset as follows: For i386, the MaxAtomicInlineWidth should be 0 because no cmpxchg is supported. For i486, the MaxAtomicInlineWidth should be 32 because it supports cmpxchg. For others 32 bits x86 cpu, the MaxAtomicInlineWidth should be 64 because of cmpxchg8b. Differential Revision: https://reviews.llvm.org/D42154 This should fix buildworld on i386, because of our system libraries missing __atomic_load_8, and possibly other 64 bit atomic functions, for that architecture. We should really fix that at some point, but since we have been actually using cmpxchg8b for years now, it does not seem to matter much... Modified: projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Modified: projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Fri Aug 17 16:19:47 2018 (r337978) +++ projects/clang700-import/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Fri Aug 17 16:25:59 2018 (r337979) @@ -350,11 +350,9 @@ class LLVM_LIBRARY_VISIBILITY X86_32TargetInfo : publi (1 << TargetInfo::LongDouble)); // x86-32 has atomics up to 8 bytes - CPUKind Kind = getCPUKind(Opts.CPU); - if (Kind >= CK_i586 || Kind == CK_Generic) - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; - else if (Kind >= CK_i486) - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; + // FIXME: Check that we actually have cmpxchg8b before setting + // MaxAtomicInlineWidth. (cmpxchg8b is an i586 instruction.) + MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; } BuiltinVaListKind getBuiltinVaListKind() const override {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808171626.w7HGQ0Sp020544>