diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-02-01 21:14:15 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-02-01 21:14:15 +0000 |
commit | bddbc598a76ae05af106f4e8c1faaa3946a0d7ea (patch) | |
tree | fce26d095a8e2cdbfccaa55412306407ac0f267e | |
parent | 520a89e9d38bb1c9cc2de3f875eae3ac69f9f08a (diff) |
Vendor import of clang release_60 branch r323948:vendor/clang/clang-release_60-r323948
Notes
Notes:
svn path=/vendor/clang/dist-release_60/; revision=328739
svn path=/vendor/clang/clang-release_60-r323948/; revision=328740; tag=vendor/clang/clang-release_60-r323948
-rw-r--r-- | docs/ReleaseNotes.rst | 44 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticDriverKinds.td | 8 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticGroups.td | 3 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 4 | ||||
-rw-r--r-- | lib/Basic/Targets/X86.cpp | 6 | ||||
-rw-r--r-- | lib/Driver/ToolChains/Clang.cpp | 31 | ||||
-rw-r--r-- | lib/Driver/ToolChains/Hexagon.cpp | 2 | ||||
-rw-r--r-- | test/Driver/global-isel.c | 24 | ||||
-rw-r--r-- | test/Driver/hexagon-hvx.c | 9 |
9 files changed, 126 insertions, 5 deletions
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index 6857903c96d9..c5e037d0cd9d 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -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 ---------------------------------- diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index 45cdf82d369f..28aead0cdb99 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -354,4 +354,12 @@ def warn_drv_fine_grained_bitfield_accesses_ignored : Warning< 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>; } diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index b54f07508867..2d471f1fa5a4 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -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">; diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 3ee834e68566..74e13f7026b9 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -1031,6 +1031,8 @@ def finline_functions : Flag<["-"], "finline-functions">, Group<f_clang_Group>, 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">, Group<f_Group>; 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.">; diff --git a/lib/Basic/Targets/X86.cpp b/lib/Basic/Targets/X86.cpp index 70433ff066fc..0febb98d4684 100644 --- a/lib/Basic/Targets/X86.cpp +++ b/lib/Basic/Targets/X86.cpp @@ -409,7 +409,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features, 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::StringMap<bool> &Features, } 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::StringMap<bool> &Features, } 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); diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index c445669a5ad4..484df520012c 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -4639,6 +4639,37 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, 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 && diff --git a/lib/Driver/ToolChains/Hexagon.cpp b/lib/Driver/ToolChains/Hexagon.cpp index 2debf0e2de54..31281737c7a1 100644 --- a/lib/Driver/ToolChains/Hexagon.cpp +++ b/lib/Driver/ToolChains/Hexagon.cpp @@ -46,7 +46,7 @@ static void handleHVXWarnings(const Driver &D, const ArgList &Args) { // 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; } diff --git a/test/Driver/global-isel.c b/test/Driver/global-isel.c new file mode 100644 index 000000000000..f4fc6a758ac2 --- /dev/null +++ b/test/Driver/global-isel.c @@ -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" diff --git a/test/Driver/hexagon-hvx.c b/test/Driver/hexagon-hvx.c index 171d586760ed..4fc24858855d 100644 --- a/test/Driver/hexagon-hvx.c +++ b/test/Driver/hexagon-hvx.c @@ -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 |