1. Aug 16, 2019
    • Jonas Devlieghere's avatar
      [Support] Re-introduce the RWMutexImpl for macOS < 10.12 · 563e25f3
      Jonas Devlieghere authored
      In r369018, Benjamin replaced the custom RWMutex implementation with
      their C++14 counterpart. Unfortunately, std::shared_timed_mutex is only
      available on macOS 10.12 and later. This prevents LLVM from compiling
      even on newer versions of the OS when you have an older deployment
      target. This patch reintroduced the old RWMutexImpl but guards it by the
      macOS availability macro.
      
      Differential revision: https://reviews.llvm.org/rL369018
      
      llvm-svn: 369056
      563e25f3
    • Mitch Phillips's avatar
      Guard fuzzer build behind Clang-only flags. · 2fb4e754
      Mitch Phillips authored
      Should fix sanitizer buildbots and any one else who's building
      compiler-rt using gcc.
      
      llvm-svn: 369055
      2fb4e754
    • Jinsong Ji's avatar
      [Utils][NFC] Copy bisect usage documents from commit msg into script. · 9106f8c8
      Jinsong Ji authored
      Copy the message into script, so that new users won't need to dig into
      commit messages to figure out how to use.
      
      The message are copied directly from Michael's commit message in
      https://reviews.llvm.org/rL214610.
      
      llvm-svn: 369054
      9106f8c8
    • Evgeniy Stepanov's avatar
      Add missing MIR serialization text for AArch64II::MO_TAGGED. · 10ce5f88
      Evgeniy Stepanov authored
      Reviewers: pcc
      
      Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66312
      
      llvm-svn: 369053
      10ce5f88
    • Jim Ingham's avatar
      Stop-hooks weren't getting called on step-out. Fix that. · 7049b0ad
      Jim Ingham authored
      There was a little bit of logic in the StopInfoBreakpoint::PerformAction
      that would null out the StopInfo once we had a completed plan so that the
      next call to GetStopInfo would replace it with the StopInfoThreadPlan.
      
      But the stop-hooks check for whether a thread stopped for a reason didn't
      trigger this conversion.  So I added an API to do that directly, and then
      called it where before we just reset the StopInfo.
      
      <rdar://problem/54270767>
      
      Differential Revision: https://reviews.llvm.org/D66241
      
      llvm-svn: 369052
      7049b0ad
    • Mitch Phillips's avatar
      Remove CMake >= v3.13 target_link_options. · fdee340b
      Mitch Phillips authored
      Instead, use set_target_properties.
      
      llvm-svn: 369051
      fdee340b
    • Alina Sbirlea's avatar
      [MemorySSA] Remove restrictive asserts. · 79ff2042
      Alina Sbirlea authored
      The verification I added has overly restrictive asserts.
      Unreachable blocks can have any incoming value in practice, after an
      update due to a "replaceAllUses" call when the repalced entry is
      LiveOnEntry.
      
      llvm-svn: 369050
      79ff2042
    • Joel E. Denny's avatar
      [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug · 9be6d7ed
      Joel E. Denny authored
      I'd like to add these comments to warn others of problems I
      encountered when trying to use `RemoveLineIfEmpty`.  I originally
      tried to fix the problem, but I realized I could implement the
      functionality more easily and efficiently in my calling code where I
      can make the simplifying assumption that there are no prior edits to
      the line from which text is being removed.  While I've lost the
      motivation to write a fix, which doesn't look easy, I figure a warning
      to others is better than silence.
      
      I've added a unit test to demonstrate the problem.  I don't know how
      to mark it as an expected failure, so I just marked it disabled.
      
      Reviewed By: jkorous
      
      Differential Revision: https://reviews.llvm.org/D61466
      
      llvm-svn: 369049
      9be6d7ed
    • Mitch Phillips's avatar
      [GWP-ASan] Implement stack frame compression. · be8a2f75
      Mitch Phillips authored
      Summary:
      This patch introduces stack frame compression to GWP-ASan. Each stack frame is
      variable-length integer encoded as the difference between frame[i] and
      frame[i - 1]. Furthermore, we use zig-zag encoding on the difference to ensure
      that negative differences are also encoded into a relatively small number of
      bytes.
      
      Examples of what the compression looks like can be seen in
      `gwp_asan/tests/compression.cpp`.
      
      This compression can reduce the memory consumption cost of stack traces by
      ~50%.
      
      Reviewers: vlad.tsyrklevich
      
      Reviewed By: vlad.tsyrklevich
      
      Subscribers: mgorny, #sanitizers, llvm-commits, eugenis, morehouse
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D66189
      
      llvm-svn: 369048
      be8a2f75
    • Nico Weber's avatar
      gn build: Merge r369039 · 1af501c0
      Nico Weber authored
      llvm-svn: 369047
      1af501c0
    • Nico Weber's avatar
      gn build: Merge r369018 · d9ebe58b
      Nico Weber authored
      llvm-svn: 369046
      d9ebe58b
    • JF Bastien's avatar
      Fix nm on GCC 5.1 after the C++14 move · c984dde1
      JF Bastien authored
      Summary:
      As in D66306, fix the invocation of std::sort with std::function by not using
      std::function, since it's easier to read and is broken in libstdc++ from GCC 5.1
      (see https://gcc.gnu.org/PR65942).
      
      Reviewers: thakis
      
      Subscribers: jkorous, mgrang, dexonsmith, rupprecht, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66310
      
      llvm-svn: 369045
      c984dde1
    • Alexey Bataev's avatar
      Mark the test as unsupported on darwin, NFC. · deb49a62
      Alexey Bataev authored
      The bundler may fail on darwin, mark the test as not compatible.
      
      llvm-svn: 369044
      deb49a62
    • Reid Kleckner's avatar
      [Sema] Implement DR2386 for C++17 structured binding · ed399a69
      Reid Kleckner authored
      Allow implementations to provide complete definitions of
      std::tuple_size<T>, but to omit the 'value' member to signal that T is
      not tuple-like. The Microsoft standard library implements
      std::tuple_size<const T> this way.
      
      If the value member exists, clang still validates that it is an ICE, but
      if it does not, then the type is considered to not be tuple-like.
      
      Fixes PR33236
      
      Reviewers: rsmith
      
      Differential Revision: https://reviews.llvm.org/D66040
      
      llvm-svn: 369043
      ed399a69
    • Guanzhong Chen's avatar
      [WebAssembly] Correctly handle va_arg of zero-sized structures · 82bfd1d2
      Guanzhong Chen authored
      Summary:
      D66168 passes size 0 structs indirectly, while the wasm backend expects it to
      be passed directly. This causes subsequent variadic arguments to be read
      incorrectly.
      
      This diff changes it so that size 0 structs are passed directly.
      
      Reviewers: dschuff, tlively, sbc100
      
      Reviewed By: dschuff
      
      Subscribers: jgravelle-google, aheejin, sunfish, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66255
      
      llvm-svn: 369042
      82bfd1d2
    • Daniel Sanders's avatar
      Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM · 0c476111
      Daniel Sanders authored
      Summary:
      This clang-tidy check is looking for unsigned integer variables whose initializer
      starts with an implicit cast from llvm::Register and changes the type of the
      variable to llvm::Register (dropping the llvm:: where possible).
      
      Partial reverts in:
      X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
      X86FixupLEAs.cpp - Some functions return unsigned and arguably should be MCRegister
      X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
      HexagonBitSimplify.cpp - Function takes BitTracker::RegisterRef which appears to be unsigned&
      MachineVerifier.cpp - Ambiguous operator==() given MCRegister and const Register
      PPCFastISel.cpp - No Register::operator-=()
      PeepholeOptimizer.cpp - TargetInstrInfo::optimizeLoadInstr() takes an unsigned&
      MachineTraceMetrics.cpp - MachineTraceMetrics lacks a suitable constructor
      
      Manual fixups in:
      ARMFastISel.cpp - ARMEmitLoad() now takes a Register& instead of unsigned&
      HexagonSplitDouble.cpp - Ternary operator was ambiguous between unsigned/Register
      HexagonConstExtenders.cpp - Has a local class named Register, used llvm::Register instead of Register.
      PPCFastISel.cpp - PPCEmitLoad() now takes a Register& instead of unsigned&
      
      Depends on D65919
      
      Reviewers: arsenm, bogner, craig.topper, RKSimon
      
      Reviewed By: arsenm
      
      Subscribers: RKSimon, craig.topper, lenary, aemerson, wuzish, jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65962
      
      llvm-svn: 369041
      0c476111
    • Krzysztof Parzyszek's avatar
      [Hexagon] Fix instruction selection for vselect v4i8 · 8e987702
      Krzysztof Parzyszek authored
      llvm-svn: 369040
      8e987702
    • Diego Trevino Ferrer's avatar
    • Matt Arsenault's avatar
      MVT: Add v3i16/v3f16 vectors · 1f2b7272
      Matt Arsenault authored
      AMDGPU has some buffer intrinsics which theoretically could use
      this. Some of the generated tables include the 3 and 4 element vector
      versions of these rounded to 64-bits, which is ambiguous. Add these to
      help the table disambiguate these.
      
      Assertion change is for the path odd sized vectors now take for R600.
      v3i16 is widened to v4i16, which then needs to be promoted to v4i32.
      
      llvm-svn: 369038
      1f2b7272
    • Philip Reames's avatar
      d2028994
    • Florian Hahn's avatar
      [ValueTracking] Look through ptrmask intrinsics during getUnderlyingObject. · 3f2850bc
      Florian Hahn authored
      Reviewers: nlopes, efriedma, hfinkel, sanjoy, aqjune, jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: jdoerfert, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D61669
      
      llvm-svn: 369036
      3f2850bc
    • Aaron Ballman's avatar
      Rename this file from cx2.c to c2x.c; NFC. · ce1750d9
      Aaron Ballman authored
      llvm-svn: 369035
      ce1750d9
    • Adrian Prantl's avatar
      69ec60d8
    • Aaron Ballman's avatar
      Allow standards-based attributes to have leading and trailing underscores. · 2ed4573e
      Aaron Ballman authored
      This gives library implementers a way to use standards-based attributes that do not conflict with user-defined macros of the same name. Attributes in C2x require this behavior normatively (C2x 6.7.11p4), but there's no reason to not have the same behavior in C++, especially given that such attributes may be used by a C library consumed by a C++ compilation.
      
      llvm-svn: 369033
      2ed4573e
    • David Bolvansky's avatar
      [NFC] Added tests for 'select with ctlz to cttz' fold · 00782a4b
      David Bolvansky authored
      llvm-svn: 369032
      00782a4b
    • Craig Topper's avatar
      [X86] Add custom type legalization for bitcasting mmx to v2i32/v4i16/v8i8 to... · 2a372ba5
      Craig Topper authored
      [X86] Add custom type legalization for bitcasting mmx to v2i32/v4i16/v8i8 to use movq2dq instead of going through memory.
      
      llvm-svn: 369031
      2a372ba5
    • Siva Chandra's avatar
      Add LLVMLibC proposal to docs/index.rst. · 0890f0f3
      Siva Chandra authored
      Reviewers: rupprecht
      
      Subscribers: arphaman, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66307
      
      llvm-svn: 369030
      0890f0f3
    • Benjamin Kramer's avatar
      Link libpthread into LLVMCore.so · 2e62396c
      Benjamin Kramer authored
      After r369018 the compiler can inline pthread calls into users of
      RWMutex.
      
      llvm-svn: 369029
      2e62396c
    • Alexey Bataev's avatar
      Fix the test, NFC. · 1c3a5d78
      Alexey Bataev authored
      llvm-svn: 369028
      1c3a5d78
    • Pavel Labath's avatar
      Revert "MemoryBuffer: Add a missing error-check to getOpenFileImpl" · 11d9e46f
      Pavel Labath authored
      This reverts commit r368977 because it broke a couple of tests in lldb.
      
      llvm-svn: 369027
      11d9e46f
    • Jeremy Morse's avatar
      [DebugInfo] Avoid crash from dropped fragments in LiveDebugValues · c476124b
      Jeremy Morse authored
      This patch avoids a crash caused by DW_OP_LLVM_fragments being dropped
      from DIExpressions by LiveDebugValues spill-restore code. The appearance
      of a previously unseen fragment configuration confuses LDV, as documented
      in PR42773, and reproduced by the test function this patch adds (Crashes
      on a x86_64 debug build).
      
      To avoid this, on spill restore, we now use fragment information from the
      spilt-location-expression.
      
      In addition, when spilling, we now don't spill any DBG_VALUE with a complex
      expression, as it can't be safely restored and will definitely lead to an
      incorrect variable location. The discussion of this is in D65368.
      
      Differential Revision: https://reviews.llvm.org/D66284
      
      llvm-svn: 369026
      c476124b
    • Mark Lacey's avatar
      [CallGraph] Refine call graph for indirect calls with !callees metadata · 626ed22f
      Mark Lacey authored
      For indirect call sites having a small set of possible callees,
      !callees metadata can be used to indicate what those callees are.
      This patch updates the call graph and lazy call graph analyses so
      that they consider this metadata when encountering call sites. For
      the call graph, it adds a new external call graph node to the graph
      for each unique !callees metadata node. A call graph edge connects
      an indirect call site with the external node associated with the
      !callees metadata that is attached to it. And there is an edge from
      this external node to each of the callees indicated by the metadata.
      Similarly, for the lazy call graph, the patch adds Ref edges from a
      caller to the possible callees indicated by the metadata.
      
      The primary purpose of the patch is to facilitate iterating over the
      functions in a module such that all of the callees indicated by a
      given !callees metadata node will be visited prior to the functions
      containing call sites annotated by that node. This property is
      required by optimizations performing a bottom-up traversal of the
      SCC DAG. For example, the inliner can be made to inline through an
      indirect call. If the call site is annotated with !callees metadata,
      this patch ensures that the inliner will have visited all of the
      callees prior to the caller, allowing it to reliably compute the
      cost of inlining one or more of the potential callees.
      
      Original patch by @mssimpso. I've made some small changes to get it
      to apply, build, and pass tests on the top of tree, as well as
      some minor tweaks to formatting and functionality.
      
      Subscribers: mehdi_amini, hiraditya, llvm-commits, mssimpso
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D39339
      
      llvm-svn: 369025
      626ed22f
    • Taewook Oh's avatar
      [NewPM][PassInstrumentation] IR printing support for (Thin)LTO · 213d8a9f
      Taewook Oh authored
      Summary: IR printing has not been correctly supported with (Thin)LTO if the new pass manager is enabled. Previously we only get outputs from backend(codegen) passes, as they are still under legacy pass manager even when the new pass manager is enabled. This patch addresses the issue and enables IR printing for optimization passes with new pass manager + (Thin)LTO setting.
      
      Reviewers: fedor.sergeev, philip.pfaffe
      
      Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, dang, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66253
      
      llvm-svn: 369024
      213d8a9f
    • JF Bastien's avatar
      Fix lld on GCC 5.1 after the C++14 move · 7a210d65
      JF Bastien authored
      Summary:
      libstdc++ in GCC 5.1 has some bugs. The move to C++14 in D66195 triggered one
      such bug caused by the new constexpr support in C++14, and the implementation
      doing SFINAE wrong with the comparator to std::stable_sort.
      
      Here's a small repro: https://godbolt.org/z/2QC3-n
      
      The fix is to inline the lambdas directly into the llvm::stable_sort call
      instead of erasing them through a std::function. The code is more readable as
      well.
      
      Reviewers: thakis, ruiu, espindola
      
      Subscribers: emaste, arichardson, MaskRay, jkorous, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66306
      
      llvm-svn: 369023
      7a210d65
    • Craig Topper's avatar
      [X86] Improve cost model for subvector extraction of less than 128-bit vectors · 6eebd2bc
      Craig Topper authored
      Now that we're using widening legalization. We need to improve our extract_subvector cost model for these types. This patch begins by modeling these as a subvector extract followed by a permute. I've left FIXMEs in the code for future improvements.
      
      Differential Revision: https://reviews.llvm.org/D65892
      
      llvm-svn: 369022
      6eebd2bc
    • Julian Lettner's avatar
      [sanitizer_common] Always use posix_spawn on Darwin · bb99437f
      Julian Lettner authored
      On Darwin we have two external symbolizers: atos and llvm-symbolizer.
      atos was changed to use posix_spawn (instead of fork+execv) in a
      previous commit [1]. Let's use posix_spawn for llvm-symbolizer as well.
      
      Our hope is that eventually we can transition to posix_spawn on other
      platforms too.
      
      [1] 399408a9
      
      llvm-svn: 369021
      bb99437f
    • George Karpenkov's avatar
      Test commit #2. · e7fdf7cb
      George Karpenkov authored
      llvm-svn: 369020
      e7fdf7cb
    • Alexey Bataev's avatar
      [Driver][Bundler] Improve bundling of object files. · 4fb80d56
      Alexey Bataev authored
      Summary:
      Previously, object files were bundled using partial linking. It resulted
      in the following structure of the bundled objects:
      ```
      <host_code>
      clang-offload-bundle
      __CLANG_OFFLOAD_BUNDLE__<target>
      <target_code>
      ```
      But when we tried to unbundle object files, it worked correctly only for
      the target objects. The host object remains bundled. It produced a lot of
      junk sections in the host object files and in some cases may caused
      incorrect linking.
      
      Patch improves bundling of the object files. After this patch the
      bundled object looks like this:
      
      ```
      <host_code>
      clang-offload-bundle
      __CLANG_OFFLOAD_BUNDLE__<target>
      <target_code>
      __CLANG_OFFLOAD_BUNDLE__<host>
      <host_code>
      ```
      
      With this structure we are able to unbundle the host object files too so
      that after unbundling they are the same as were before.
      The host section is bundled twice. The bundled section is used to
      unbundle the original host section.
      
      Reviewers: yaxunl, tra, jlebar, hfinkel, jdoerfert
      
      Subscribers: caomhin, kkwli0, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D65819
      
      llvm-svn: 369019
      4fb80d56
    • Benjamin Kramer's avatar
      [Support] Base RWMutex on std::shared_timed_mutex (C++14) · 8d3a1523
      Benjamin Kramer authored
      This should have the same semantics. We use std::shared_mutex instead on
      MSVC and C++17, std::shared_timed_mutex is less efficient than our
      custom implementation on Windows, std::shared_mutex should be faster.
      
      llvm-svn: 369018
      8d3a1523
    • Simon Pilgrim's avatar
      [LLVM][Alignment] Fix MSVC potential division by 0 warning (PR42911) · 1c013ca1
      Simon Pilgrim authored
      Original Patch by @gchatelet (Guillaume Chatelet)
      
      Differential Revision: https://reviews.llvm.org/D65859
      
      llvm-svn: 369016
      1c013ca1