1. Feb 27, 2020
    • Mikhail Maltsev's avatar
      [libcxx] Fix _LIBCPP_HAS_THREAD_API_EXTERNAL build · 14aef536
      Mikhail Maltsev authored
      Summary:
      The definition of `__libcpp_timed_backoff_policy` and the declaration of
      `__libcpp_thread_poll_with_backoff` must not be guarded by
        #if !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
      because the definitions of `__libcpp_timed_backoff_policy::operator()`
      and `__libcpp_thread_poll_with_backoff` aren't guarded by this macro
      (and this is correct because these two functions are implemented in
      terms of other libc++ functions and don't interact with the host
      threading library).
      
      Reviewers: ldionne, __simt__, EricWF, mclow.lists
      
      Reviewed By: ldionne
      
      Subscribers: dexonsmith, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D75191
      14aef536
    • Hiroshi Yamauchi's avatar
      Devirtualize a call on alloca without waiting for post inline cleanup and next · 59fb9cde
      Hiroshi Yamauchi authored
      DevirtSCCRepeatedPass iteration.  Needs ReviewPublic
      
      This aims to fix a missed inlining case.
      
      If there's a virtual call in the callee on an alloca (stack allocated object) in
      the caller, and the callee is inlined into the caller, the post-inline cleanup
      would devirtualize the virtual call, but if the next iteration of
      DevirtSCCRepeatedPass doesn't happen (under the new pass manager), which is
      based on a heuristic to determine whether to reiterate, we may miss inlining the
      devirtualized call.
      
      This enables inlining in clang/test/CodeGenCXX/member-function-pointer-calls.cpp.
      59fb9cde
    • Lei Zhang's avatar
      [mlir][spirv] NFC: move folders and canonicalizers in a separate file · 1e9321e9
      Lei Zhang authored
      This gives us better file organization and faster compilation time
      by avoid having a gigantic SPIRVOps.cpp file.
      1e9321e9
    • Steven Wu's avatar
      [compiler-rt] Build all alias in builtin as private external on Darwin · 387c3f74
      Steven Wu authored
      Summary:
      For builtin compiler-rt, it is built with visibility hidden by default
      to avoid the client exporting symbols from libclang static library. The
      compiler option -fvisibility=hidden doesn't work on the aliases in c files
      because they are created with inline assembly. On Darwin platform,
      thoses aliases are exported by default if they are reference by the client.
      
      Fix the issue by adding ".private_extern" to all the aliases if the
      library is built with visibility hidden.
      
      rdar://problem/58960296
      
      Reviewers: dexonsmith, arphaman, delcypher, kledzik
      
      Reviewed By: delcypher
      
      Subscribers: dberris, jkorous, ributzka, #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D73577
      387c3f74
    • Sean Fertile's avatar
    • John Brawn's avatar
      Use virtual functions in ParsedAttrInfo instead of function pointers · 590dc8d0
      John Brawn authored
      This doesn't do anything on its own, but it's the first step towards
      allowing plugins to define attributes. It does simplify the
      ParsedAttrInfo generation in ClangAttrEmitter a little though.
      
      Differential Revision: https://reviews.llvm.org/D31337
      590dc8d0
    • Alex Brachet's avatar
      [libc] Fix build when -DBUILD_SHARED_LIBS=On · 805f5836
      Alex Brachet authored
      Reviewers: gchatelet, sivachandra
      
      Reviewed By: gchatelet, sivachandra
      
      Subscribers: libc-commits, mgorny, MaskRay, tschuett
      
      Differential Revision: https://reviews.llvm.org/D75136
      805f5836
    • Reid Kleckner's avatar
      Avoid SmallString.h include in MD5.h, NFC · 465dca79
      Reid Kleckner authored
      Saves 200 includes, which is mostly immaterial.
      465dca79
    • Fangrui Song's avatar
      [llvm-objcopy][test] Improve empty section tests · 6503aadc
      Fangrui Song authored
      empty-sections.test: add two tests adapted from @jhenderson's https://reviews.llvm.org/D74755#1882221
      strip-non-alloc.test: improve. D74755 will change the attribution of an empty section.
      
      They mostly test the behavior of Object.cpp:sectionWithinSegment : how we attribute sections to segments.
      `ParentSegment` can affect some subtle layout decisions.
      
      Reviewed By: jhenderson
      
      Differential Revision: https://reviews.llvm.org/D74879
      6503aadc
    • Fangrui Song's avatar
      [ELF] --orphan-handling=: don't warn/error for unused synthesized sections · 42319409
      Fangrui Song authored
      This makes --orphan-handling= less noisy.
      This change also improves our compatibility with GNU ld.
      
      GNU ld special cases .symtab, .strtab and .shstrtab . We need output section
      descriptions for .symtab, .strtab and .shstrtab to suppress:
      
        <internal>:(.symtab) is being placed in '.symtab'
        <internal>:(.shstrtab) is being placed in '.shstrtab'
        <internal>:(.strtab) is being placed in '.strtab'
      
      With --strip-all, .symtab and .strtab can be omitted (note, --strip-all is not compatible with --emit-relocs).
      
      Reviewed By: nickdesaulniers
      
      Differential Revision: https://reviews.llvm.org/D75149
      42319409
    • Kadir Cetinkaya's avatar
      [clangd] Clean-up XRefs.cpp from Lexer usages and unnecessary SourceLoc transformations · 2011d142
      Kadir Cetinkaya authored
      Summary:
      Get rid of calls to lexer and unnecessary source location
      transformations.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D75166
      2011d142
    • Sanjay Patel's avatar
      [DAGCombiner] avoid narrowing fake fneg vector op · b3d0c798
      Sanjay Patel authored
      This may inhibit vector narrowing in general, but there's
      already an inconsistency in the way that we deal with this
      pattern as shown by the test diff.
      
      We may want to add a dedicated function for narrowing fneg.
      It's often folded into some other op, so moving it away from
      other math ops may cause regressions that we would not see
      for normal binops.
      
      See D73978 for more details.
      b3d0c798
    • LLVM GN Syncbot's avatar
      [gn build] Port 3c36d8da · 299c3e13
      LLVM GN Syncbot authored
      299c3e13
    • Pavel Labath's avatar
      Introduce DWARFDataExtractor::getInitialLength · 3c36d8da
      Pavel Labath authored
      Summary:
      This patch introduces a function to house the code needed to do the
      DWARF64 detection dance. The function decodes the initial length field
      and returns it as a pair containing the actual length, and the DWARF
      encoding.
      
      This patch does _not_ attempt to handle the problem of detecting lengths
      which extend past the size of the section, or cases when reads of a
      single contribution accidentally escape beyond its specified length, but
      I think it's useful in its own right.
      
      Reviewers: dblaikie, jhenderson, ikudrin
      
      Subscribers: hiraditya, probinson, aprantl, JDevlieghere, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74560
      3c36d8da
    • Martijn Vels's avatar
      Add _LIBCPP_BUILTIN_CONSTANT_P support. · 07eb82fc
      Martijn Vels authored
      Summary:
      This change adds the macros _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT and _LIBCPP_BUILTIN_CONSTANT_P to detect compile time constants, and optimze the code accordingly.
      
      A planned usage example:
      The implementation of basic_string::assign() can short-cut a compile time known short string assignent into a fast and compact inlined assignment:
      
      ```
      basic_string::assign(const value_type* __s) {
        if (_LIBCPP_BUILTIN_CONSTANT_P(__s[0]) && length(__s) < __min_cap) {
          copy(pointer(), _s, length(__s) + 1);
          set_size(length(__s));
        } else {
          // delegate / tail call out of line implementation
        }
      }
      ```
      
      Subscribers: christof, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D73732
      07eb82fc
  2. Feb 26, 2020
    • Sanjay Patel's avatar
      [AArch64] add tests for fake fneg; NFC · 894ce940
      Sanjay Patel authored
      See comments in D73978 for background.
      894ce940
    • Unnar Freyr Erlendsson's avatar
      Add unit tests for RangeDataVector::FindEntryIndexesThatContain · 594130db
      Unnar Freyr Erlendsson authored
      Summary: This adds unit tests for FindEntryIndexesThatContain, this is done in preparation for changing the logic of the function.
      
      Reviewers: labath, teemperor
      
      Reviewed By: labath
      
      Subscribers: arphaman, JDevlieghere, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D75180
      594130db
    • Simon Pilgrim's avatar
    • Pavel Labath's avatar
      Recommit "[DWARFDebugLine] Avoid dumping prologue members we did not parse" · ced45978
      Pavel Labath authored
      The patch was reverted in 69da4003 because of test failures on windows.
      The problem was the unpredictable order of some of the error messages,
      which I've tried to strenghten in that patch.
      
      It turns out this is not possible to do in verbose mode because there
      the data is being writted as it is being parsed. No amount of flushing
      (as I've done in the non-verbose mode) will help that. Indeed, even
      without any buffering the warning messages can end in the middle of a
      line in non-verbose mode.
      
      In this patch, I have reverted the changes which tested the relative
      position of the warning message, except for the messages about
      unsupported initial length, which are the ones I really wanted to test,
      and which do come out reasonably.
      
      The original commit message was:
      
      This patch if motivated by D74560, specifically the subthread about what
      to print upon encountering reserved initial length values.
      
      If the debug_line prologue has an unsupported version, we skip parsing
      the rest of the data. If we encounter an reserved initial length field,
      we don't even parse the version. However, we still print out all members
      (with value 0) in the dump function.
      
      This patch introduces early exits in the Prologue::dump function so that
      we print only the fields that were parsed successfully. In case of an
      unsupported version, we skip printing all subsequent prologue fields --
      because we don't even know if this version has those fields. In case of a
      reserved unit length, we don't print anything -- if the very first field
      of the prologue is invalid, it's hard to say if we even have a prologue
      to begin with.
      
      Note that the user will still be able to see the invalid/reserved
      initial length value in the error message. I've modified (reordered)
      debug_line_invalid.test to show that the error message comes straight
      after the debug_line offset. I've also added some flush() calls to the
      dumping code to ensure this is the case in all situations (without that,
      the warnings could get out of sync if the output was not a terminal -- I
      guess this is why std::iostreams have the tie() function).
      
      Reviewers: jhenderson, ikudrin, dblaikie
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75043
      ced45978
    • Jonathan Coe's avatar
      [clang-format] Special handling of spaces for C# code · e8c5fea2
      Jonathan Coe authored
      Summary:
      Ensure that there are spaces around braces '{', '}'.
      
      Ensure that there is a space before and after '=>'.
      
      Ensure that 'async' and 'when' are considered as keywords when inserting spaces.
      
      Reviewers: krasimir, MyDeveloperDay
      
      Reviewed By: krasimir
      
      Tags: #clang-format
      
      Differential Revision: https://reviews.llvm.org/D75129
      e8c5fea2
    • Haojian Wu's avatar
      [clangd] use printQualifiedName to skip the inlinenamespace qualifiers. · 02323a3d
      Haojian Wu authored
      Summary:
      symbols in libcpp are inside the inline namespace, printQualifierAsString will
      print the inline namespace, which is unexpected.
      
      Reviewers: kadircet
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D75174
      02323a3d
    • Nicolai Hähnle's avatar
      Full fix for "AMDGPU/SIInsertSkips: Fix the determination of whether... · d6b05fcc
      Nicolai Hähnle authored
      Full fix for "AMDGPU/SIInsertSkips: Fix the determination of whether early-exit-after-kill is possible" (hopefully)
      
      Properly preserve the MachineDominatorTree in all cases.
      
      Change-Id: I54cf0c0a20934168a356920ba8ed5097a93c4131
      d6b05fcc
    • Simon Tatham's avatar
      [ARM,MVE] Add predicated intrinsics for many unary functions. · 9eb3cc10
      Simon Tatham authored
      Summary:
      This commit adds the predicated MVE intrinsics for the same set of
      unary operations that I added in their unpredicated forms in
      
      * D74333 (vrint)
      * D74334 (vrev)
      * D74335 (vclz, vcls)
      * D74336 (vmovl)
      * D74337 (vmovn)
      
      but since the predicated versions are a lot more similar to each
      other, I've kept them all together in a single big patch. Everything
      here is done in the standard way we've been doing other predicated
      operations: an IR intrinsic called `@llvm.arm.mve.foo.predicated` and
      some isel rules that match that alongside whatever they accept for the
      unpredicated version of the same instruction.
      
      In order to write the isel rules conveniently, I've refactored the
      existing isel rules for the affected instructions into multiclasses
      parametrised by a vector-type class, in the usual way. All those
      refactorings are intended to leave the existing isel rules unchanged:
      the only difference should be that new ones for the predicated
      intrinsics are introduced.
      
      The only tiny infrastructure change I needed in this commit was to
      change the implementation of `IntrinsicMX` in `arm_mve_defs.td` so
      that the records it defines are anonymous rather than named (and use
      `NameOverride` to set the output intrinsic name), which allows me to
      call it twice in two multiclasses with the same `NAME` without a
      tablegen-time error.
      
      Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard
      
      Reviewed By: MarkMurrayARM
      
      Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D75165
      9eb3cc10
    • Xiangling Liao's avatar
      [AIX] Remove whitelist checking for ExternalSymbolSDNodes · e7375e99
      Xiangling Liao authored
      Allow all ExternalSymbolSDNode on AIX, and rely on the linker error to find
      symbols which we don't have definitions from any library/compiler-rt.
      
      Differential Revision: https://reviews.llvm.org/D75075
      e7375e99
    • Hans Wennborg's avatar
    • Nicolai Hähnle's avatar
      Quick fix for bot failure on "AMDGPU/SIInsertSkips: Fix the determination of... · 0aec4b41
      Nicolai Hähnle authored
      Quick fix for bot failure on "AMDGPU/SIInsertSkips: Fix the determination of whether early-exit-after-kill is possible"
      
      Apparently the dominator tree update is incorrect, will investigate.
      
      Change-Id: Ie76f8d11b22a552af1f098c893773f3d85e02d4f
      0aec4b41
    • Yitzhak Mandelbaum's avatar
      [libTooling] Add function to determine associated text of a declaration. · 38b4516d
      Yitzhak Mandelbaum authored
      Summary:
      Second attempt -- the first was reverted in commit 0e480b39, because of test breakages. This revision fixes the cause of the test breakages.
      
      Original description follows:
      This patch adds `getAssociatedRange` which, for a given decl, computes preceding
      and trailing text that would conceptually be associated with the decl by the
      reader. This includes comments, whitespace, and separators like ';'.
      
      Reviewers: gribozavr
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D72153
      38b4516d
    • Jay Foad's avatar
      AMDGPU: Fix some more incorrect check lines · 09a6b267
      Jay Foad authored
      09a6b267
    • Nicolai Hähnle's avatar
      AMDGPU/SIInsertSkips: Fix the determination of whether early-exit-after-kill is possible · 0f1df489
      Nicolai Hähnle authored
      Summary:
      The old code made some incorrect assumptions about the order in which
      basic blocks are laid out in a function. This could lead to incorrect
      early-exits, especially when kills occurred inside of loops.
      
      The new approach is to check whether the point where the conditional
      kill occurs dominates all reachable code. If that is the case, there
      cannot be any other threads in the wave that are waiting to rejoin
      at a later point in the CFG, i.e. if exec=0 at that point, then all
      threads really are dead and we can exit the wave.
      
      Make some other minor cleanups to the pass while we're at it.
      
      v2: preserve the dominator tree
      
      Reviewers: arsenm, cdevadas, foad, critson
      
      Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74908
      
      Change-Id: Ia0d2b113ac944ad642d1c622b6da1b20aa1aabcc
      0f1df489
    • Nicolas Vasilache's avatar
      [mlir][Linalg] NFC - Refactor LinalgStructuredOps towards "named" Linalg ops · fcfd4fb6
      Nicolas Vasilache authored
      This revision performs some basic refactoring towards more easily defining Linalg "named" ops. Such named ops form the backbone of operations that are ubiquitous in the ML application domain.
      fcfd4fb6
    • Sven van Haastregt's avatar
      [OpenCL] Add atomic type builtins · 319ea2dd
      Sven van Haastregt authored
      Add atomic types and builtins operating on those atomic types to
      `-fdeclare-opencl-builtins`.  The _explicit variants are left out of
      this commit, as these take enum arguments that are not yet supported
      by the `-fdeclare-opencl-builtins` machinery.
      319ea2dd
    • Nico Weber's avatar
      [gn build] re-"gn format" all gn files · cfbe889a
      Nico Weber authored
      cfbe889a
    • evgeny's avatar
      8f8756d4
    • Nico Weber's avatar
      [gn build] (manually) port 2f6cc21f · ce75c3d2
      Nico Weber authored
      ce75c3d2
    • Kirill Bobyrev's avatar
      [OpenMP] Fix the test by generating output file in temporary directory · 6e34a9a8
      Kirill Bobyrev authored
      Related Revison: D74925
      Commit: 396b7253
      6e34a9a8
    • Kadir Cetinkaya's avatar
      [clang][Tooling] Add a way to tokenize a FileRange · 8c2cf499
      Kadir Cetinkaya authored
      Reviewers: sammccall
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D74962
      8c2cf499
    • Haojian Wu's avatar
      [clangd] Bump index version number. · 5560a788
      Haojian Wu authored
      Summary:
      Though we don't have new changes to the index format, we have changes to
      symbol collector, e.g. collect marcos, spelled references. Bump the
      version to force background-index to rebuild.
      
      Reviewers: kadircet
      
      Reviewed By: kadircet
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D74127
      5560a788
    • Nico Weber's avatar
      [gn build] (manually) merge e058667a · 1b30b494
      Nico Weber authored
      1b30b494
    • Hans Wennborg's avatar
      Revert "[compiler-rt] Add a critical section when flushing gcov counters" · 546918cb
      Hans Wennborg authored
      See discussion on PR44792.
      
      This reverts commit 02ce9d8e.
      
      It also reverts the follow-up commits
      8f46269f "[profile] Don't dump counters when forking and don't reset when calling exec** functions"
      62c7d840 "[profile] gcov_mutex must be static"
      546918cb
    • Dmitry Vyukov's avatar
      tsan: fix pthread_detach with called_from_lib suppressions · 2dcbdba8
      Dmitry Vyukov authored
      Generally we ignore interceptors coming from called_from_lib-suppressed libraries.
      However, we must not ignore critical interceptors like e.g. pthread_create,
      otherwise runtime will lost track of threads.
      pthread_detach is one of these interceptors we should not ignore as it affects
      thread states and behavior of pthread_join which we don't ignore as well.
      Currently we can produce very obscure false positives. For more context see:
      https://groups.google.com/forum/#!topic/thread-sanitizer/ecH2P0QUqPs
      The added test captures this pattern.
      
      While we are here rename ThreadTid to ThreadConsumeTid to make it clear that
      it's not just a "getter", it resets user_id to 0. This lead to confusion recently.
      
      Reviewed in https://reviews.llvm.org/D74828
      2dcbdba8