From owner-svn-src-vendor@freebsd.org Thu Feb 1 21:14:17 2018 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B97A2EC9F08; Thu, 1 Feb 2018 21:14:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A2B386CA4; Thu, 1 Feb 2018 21:14:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64F4512685; Thu, 1 Feb 2018 21:14:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11LEGdw078589; Thu, 1 Feb 2018 21:14:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11LEFIM078580; Thu, 1 Feb 2018 21:14:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802012114.w11LEFIM078580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Feb 2018 21:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r328739 - in vendor/clang/dist-release_60: docs include/clang/Basic include/clang/Driver lib/Basic/Targets lib/Driver/ToolChains test/Driver X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist-release_60: docs include/clang/Basic include/clang/Driver lib/Basic/Targets lib/Driver/ToolChains test/Driver X-SVN-Commit-Revision: 328739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 21:14:17 -0000 Author: dim Date: Thu Feb 1 21:14:15 2018 New Revision: 328739 URL: https://svnweb.freebsd.org/changeset/base/328739 Log: Vendor import of clang release_60 branch r323948: https://llvm.org/svn/llvm-project/cfe/branches/release_60@323948 Added: vendor/clang/dist-release_60/test/Driver/global-isel.c (contents, props changed) Modified: vendor/clang/dist-release_60/docs/ReleaseNotes.rst vendor/clang/dist-release_60/include/clang/Basic/DiagnosticDriverKinds.td vendor/clang/dist-release_60/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist-release_60/include/clang/Driver/Options.td vendor/clang/dist-release_60/lib/Basic/Targets/X86.cpp vendor/clang/dist-release_60/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist-release_60/lib/Driver/ToolChains/Hexagon.cpp vendor/clang/dist-release_60/test/Driver/hexagon-hvx.c Modified: vendor/clang/dist-release_60/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist-release_60/docs/ReleaseNotes.rst Thu Feb 1 21:13:18 2018 (r328738) +++ vendor/clang/dist-release_60/docs/ReleaseNotes.rst Thu Feb 1 21:14:15 2018 (r328739) @@ -213,7 +213,49 @@ Objective-C Language Changes in Clang OpenCL C Language Changes in Clang ---------------------------------- -... + +- Added subgroup builtins to enqueue kernel support. + +- Added CL2.0 atomics as Clang builtins that now accept + an additional memory scope parameter propagated to atomic IR instructions + (this is to align with the corresponding change in LLVM IR) (see `spec s6.13.11.4 + `_). + +- Miscellaneous fixes in the CL header. + +- Allow per target selection of address space during CodeGen of certain OpenCL types. + Default target implementation is provided mimicking old behavior. + +- Macro ``__IMAGE_SUPPORT__`` is now automatically added (as per `spec s6.10 + `_). + +- Added ``cl_intel_subgroups`` and ``cl_intel_subgroups_short`` extensions. + +- All function calls are marked by `the convergent attribute + `_ + to prevent optimizations that break SPMD program semantics. This will be removed + by LLVM passes if it can be proved that the function does not use convergent + operations. + +- Create a kernel wrapper for enqueued blocks, which simplifies enqueue support by + providing common functionality. + +- Added private address space explicitly in AST and refactored address space support + with several simplifications and bug fixes (`PR33419 `_ + and `PR33420 `_). + +- OpenCL now allows functions with empty parameters to be treated as if they had a + void parameter list (inspired from C++ support). OpenCL C spec update to follow. + +- General miscellaneous refactoring and cleanup of blocks support for OpenCL to + remove unused parts inherited from Objective C implementation. + +- Miscellaneous improvements in vector diagnostics. + +- Added half float load and store builtins without enabling half as a legal type + (``__builtin_store_half for double``, ``__builtin_store_halff`` for double, + ``__builtin_load_half for double``, ``__builtin_load_halff`` for float). + OpenMP Support in Clang ---------------------------------- Modified: vendor/clang/dist-release_60/include/clang/Basic/DiagnosticDriverKinds.td ============================================================================== --- vendor/clang/dist-release_60/include/clang/Basic/DiagnosticDriverKinds.td Thu Feb 1 21:13:18 2018 (r328738) +++ vendor/clang/dist-release_60/include/clang/Basic/DiagnosticDriverKinds.td Thu Feb 1 21:14:15 2018 (r328739) @@ -354,4 +354,12 @@ def warn_drv_fine_grained_bitfield_accesses_ignored : def note_drv_verify_prefix_spelling : Note< "-verify prefixes must start with a letter and contain only alphanumeric" " characters, hyphens, and underscores">; + +def warn_drv_experimental_isel_incomplete : Warning< + "-fexperimental-isel support for the '%0' architecture is incomplete">, + InGroup; + +def warn_drv_experimental_isel_incomplete_opt : Warning< + "-fexperimental-isel support is incomplete for this architecture at the current optimization level">, + InGroup; } Modified: vendor/clang/dist-release_60/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist-release_60/include/clang/Basic/DiagnosticGroups.td Thu Feb 1 21:13:18 2018 (r328738) +++ vendor/clang/dist-release_60/include/clang/Basic/DiagnosticGroups.td Thu Feb 1 21:14:15 2018 (r328739) @@ -985,3 +985,6 @@ def UnknownArgument : DiagGroup<"unknown-argument">; // A warning group for warnings about code that clang accepts when // compiling OpenCL C/C++ but which is not compatible with the SPIR spec. def SpirCompat : DiagGroup<"spir-compat">; + +// Warning for the experimental-isel options. +def ExperimentalISel : DiagGroup<"experimental-isel">; Modified: vendor/clang/dist-release_60/include/clang/Driver/Options.td ============================================================================== --- vendor/clang/dist-release_60/include/clang/Driver/Options.td Thu Feb 1 21:13:18 2018 (r328738) +++ vendor/clang/dist-release_60/include/clang/Driver/Options.td Thu Feb 1 21:14:15 2018 (r328739) @@ -1031,6 +1031,8 @@ def finline_functions : Flag<["-"], "finline-functions def finline_hint_functions: Flag<["-"], "finline-hint-functions">, Group, Flags<[CC1Option]>, HelpText<"Inline functions which are (explicitly or implicitly) marked inline">; def finline : Flag<["-"], "finline">, Group; +def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group, + HelpText<"Enables the experimental global instruction selector">; def fexperimental_new_pass_manager : Flag<["-"], "fexperimental-new-pass-manager">, Group, Flags<[CC1Option]>, HelpText<"Enables an experimental new pass manager in LLVM.">; @@ -1237,6 +1239,8 @@ def fno_exceptions : Flag<["-"], "fno-exceptions">, Gr def fno_gnu_keywords : Flag<["-"], "fno-gnu-keywords">, Group, Flags<[CC1Option]>; def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group, Flags<[CC1Option]>; def fno_inline : Flag<["-"], "fno-inline">, Group, Flags<[CC1Option]>; +def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group, + HelpText<"Disables the experimental global instruction selector">; def fno_experimental_new_pass_manager : Flag<["-"], "fno-experimental-new-pass-manager">, Group, Flags<[CC1Option]>, HelpText<"Disables an experimental new pass manager in LLVM.">; Modified: vendor/clang/dist-release_60/lib/Basic/Targets/X86.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Basic/Targets/X86.cpp Thu Feb 1 21:13:18 2018 (r328738) +++ vendor/clang/dist-release_60/lib/Basic/Targets/X86.cpp Thu Feb 1 21:14:15 2018 (r328739) @@ -409,7 +409,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap if (Enabled) { switch (Level) { case AVX512F: - Features["avx512f"] = true; + Features["avx512f"] = Features["fma"] = Features["f16c"] = true; LLVM_FALLTHROUGH; case AVX2: Features["avx2"] = true; @@ -623,6 +623,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::String } else if (Name == "fma") { if (Enabled) setSSELevel(Features, AVX, Enabled); + else + setSSELevel(Features, AVX512F, Enabled); } else if (Name == "fma4") { setXOPLevel(Features, FMA4, Enabled); } else if (Name == "xop") { @@ -632,6 +634,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::String } else if (Name == "f16c") { if (Enabled) setSSELevel(Features, AVX, Enabled); + else + setSSELevel(Features, AVX512F, Enabled); } else if (Name == "sha") { if (Enabled) setSSELevel(Features, SSE2, Enabled); Modified: vendor/clang/dist-release_60/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Driver/ToolChains/Clang.cpp Thu Feb 1 21:13:18 2018 (r328738) +++ vendor/clang/dist-release_60/lib/Driver/ToolChains/Clang.cpp Thu Feb 1 21:14:15 2018 (r328739) @@ -4639,6 +4639,37 @@ void Clang::ConstructJob(Compilation &C, const JobActi CmdArgs.push_back("-fwhole-program-vtables"); } + if (Arg *A = Args.getLastArg(options::OPT_fexperimental_isel, + options::OPT_fno_experimental_isel)) { + CmdArgs.push_back("-mllvm"); + if (A->getOption().matches(options::OPT_fexperimental_isel)) { + CmdArgs.push_back("-global-isel=1"); + + // GISel is on by default on AArch64 -O0, so don't bother adding + // the fallback remarks for it. Other combinations will add a warning of + // some kind. + bool IsArchSupported = Triple.getArch() == llvm::Triple::aarch64; + bool IsOptLevelSupported = false; + + Arg *A = Args.getLastArg(options::OPT_O_Group); + if (Triple.getArch() == llvm::Triple::aarch64) { + if (!A || A->getOption().matches(options::OPT_O0)) + IsOptLevelSupported = true; + } + if (!IsArchSupported || !IsOptLevelSupported) { + CmdArgs.push_back("-mllvm"); + CmdArgs.push_back("-global-isel-abort=2"); + + if (!IsArchSupported) + D.Diag(diag::warn_drv_experimental_isel_incomplete) << Triple.getArchName(); + else + D.Diag(diag::warn_drv_experimental_isel_incomplete_opt); + } + } else { + CmdArgs.push_back("-global-isel=0"); + } + } + // Finally add the compile command to the compilation. if (Args.hasArg(options::OPT__SLASH_fallback) && Output.getType() == types::TY_Object && Modified: vendor/clang/dist-release_60/lib/Driver/ToolChains/Hexagon.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Driver/ToolChains/Hexagon.cpp Thu Feb 1 21:13:18 2018 (r328738) +++ vendor/clang/dist-release_60/lib/Driver/ToolChains/Hexagon.cpp Thu Feb 1 21:14:15 2018 (r328739) @@ -46,7 +46,7 @@ static void handleHVXWarnings(const Driver &D, const A // Handle the unsupported values passed to mhvx-length. if (Arg *A = Args.getLastArg(options::OPT_mhexagon_hvx_length_EQ)) { StringRef Val = A->getValue(); - if (Val != "64B" && Val != "128B") + if (!Val.equals_lower("64b") && !Val.equals_lower("128b")) D.Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Val; } Added: vendor/clang/dist-release_60/test/Driver/global-isel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist-release_60/test/Driver/global-isel.c Thu Feb 1 21:14:15 2018 (r328739) @@ -0,0 +1,24 @@ +// REQUIRES: x86-registered-target,aarch64-registered-target + +// RUN: %clang -fexperimental-isel -S -### %s 2>&1 | FileCheck --check-prefix=ENABLED %s +// RUN: %clang -fno-experimental-isel -S -### %s 2>&1 | FileCheck --check-prefix=DISABLED %s + +// RUN: %clang -target aarch64 -fexperimental-isel -S %s -### 2>&1 | FileCheck --check-prefix=ARM64-DEFAULT %s +// RUN: %clang -target aarch64 -fexperimental-isel -S -O0 %s -### 2>&1 | FileCheck --check-prefix=ARM64-O0 %s +// RUN: %clang -target aarch64 -fexperimental-isel -S -O2 %s -### 2>&1 | FileCheck --check-prefix=ARM64-O2 %s +// RUN: %clang -target aarch64 -fexperimental-isel -Wno-experimental-isel -S -O2 %s -### 2>&1 | FileCheck --check-prefix=ARM64-O2-NOWARN %s + +// RUN: %clang -target x86_64 -fexperimental-isel -S %s -### 2>&1 | FileCheck --check-prefix=X86_64 %s + +// ENABLED: "-mllvm" "-global-isel=1" +// DISABLED: "-mllvm" "-global-isel=0" + +// ARM64-DEFAULT-NOT: warning: -fexperimental-sel +// ARM64-DEFAULT-NOT: "-global-isel-abort=2" +// ARM64-O0-NOT: warning: -fexperimental-sel +// ARM64-O2: warning: -fexperimental-isel support is incomplete for this architecture at the current optimization level +// ARM64-O2: "-mllvm" "-global-isel-abort=2" +// ARM64-O2-NOWARN-NOT: warning: -fexperimental-isel + +// X86_64: -fexperimental-isel support for the 'x86_64' architecture is incomplete +// X86_64: "-mllvm" "-global-isel-abort=2" Modified: vendor/clang/dist-release_60/test/Driver/hexagon-hvx.c ============================================================================== --- vendor/clang/dist-release_60/test/Driver/hexagon-hvx.c Thu Feb 1 21:13:18 2018 (r328738) +++ vendor/clang/dist-release_60/test/Driver/hexagon-hvx.c Thu Feb 1 21:14:15 2018 (r328739) @@ -21,6 +21,9 @@ // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \ // RUN: -mhvx-length=128B 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s + +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \ +// RUN: -mhvx-length=128b 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s // CHECKHVX2-NOT: "-target-feature" "+hvx-length64b" // CHECKHVX2: "-target-feature" "+hvx-length128b" @@ -79,8 +82,10 @@ // The default mode on v60,v62 is 64B. // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \ // RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s -// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx -mhvx-length=64B\ -// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \ +// RUN: -mhvx-length=64b 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \ +// RUN: -mhvx-length=64B 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s // CHECK-HVXLENGTH-64B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length64b" // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mhvx-length=128B\ // RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-128B %s