Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2018 21:14:15 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
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
Message-ID:  <201802012114.w11LEFIM078580@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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
+  <https://www.khronos.org/registry/OpenCL/specs/opencl-2.0-openclc.pdf#107>`_).
+
+- 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
+  <https://www.khronos.org/registry/OpenCL/specs/opencl-2.0-openclc.pdf#55>`_).
+
+- Added ``cl_intel_subgroups`` and ``cl_intel_subgroups_short`` extensions.
+
+- All function calls are marked by `the convergent attribute
+  <https://clang.llvm.org/docs/AttributeReference.html#convergent-clang-convergent>`_
+  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 <https://llvm.org/pr33419>`_
+  and `PR33420 <https://llvm.org/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<ExperimentalISel>;
+
+def warn_drv_experimental_isel_incomplete_opt : Warning<
+  "-fexperimental-isel support is incomplete for this architecture at the current optimization level">,
+  InGroup<ExperimentalISel>;
 }

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<f_clang_Group>, Flags<[CC1Option]>,
   HelpText<"Inline functions which are (explicitly or implicitly) marked inline">;
 def finline : Flag<["-"], "finline">, Group<clang_ignored_f_Group>;
+def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group<f_clang_Group>,
+  HelpText<"Enables the experimental global instruction selector">;
 def fexperimental_new_pass_manager : Flag<["-"], "fexperimental-new-pass-manager">,
   Group<f_clang_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<f_Group>, Flags<[CC1Option]>;
 def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group<f_clang_Group>, Flags<[CC1Option]>;
 def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>, Flags<[CC1Option]>;
+def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_Group>,
+  HelpText<"Disables the experimental global instruction selector">;
 def fno_experimental_new_pass_manager : Flag<["-"], "fno-experimental-new-pass-manager">,
   Group<f_clang_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<bool> 
   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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802012114.w11LEFIM078580>