1. Jan 16, 2020
    • Jonas Devlieghere's avatar
      [lldb/Tools] Remove lldb-mi.exports · 9efd57e3
      Jonas Devlieghere authored
      lldb-mi was removed from the repo a while ago.
      9efd57e3
    • Matt Arsenault's avatar
      llc: Change behavior of -mattr with existing attribute · 67ec8744
      Matt Arsenault authored
      Append this to the existing target-features attribute on the function.
      
      Some flags ignore existing attributes, and some overwrite them. Move
      towards consistently respecting existing attributes if present. Since
      target features act as a state machine on their own, append to the
      function attribute. The backend default added feature list, function
      attributes, and -mattr will all be appended together, and the later
      features can individually toggle the earlier settings.
      67ec8744
    • Paolo Severini's avatar
      [LLDB] Add ObjectFileWasm plugin for WebAssembly debugging · 4bafcece
      Paolo Severini authored
      Summary:
      This is the first in a series of patches to enable LLDB debugging of
      WebAssembly targets.
      
      Current versions of Clang emit (partial) DWARF debug information in WebAssembly
      modules and we can leverage this debug information to give LLDB the ability to
      do source-level debugging of Wasm code that runs in a WebAssembly engine.
      
      A way to do this could be to use the remote debugging functionalities provided
      by LLDB via the GDB-remote protocol. Remote debugging can indeed be useful not
      only to connect a debugger to a process running on a remote machine, but also to
      connect the debugger to a managed VM or script engine that runs locally,
      provided that the engine implements a GDB-remote stub that offers the ability to
      access the engine runtime internal state.
      
      To make this work, the GDB-remote protocol would need to be extended with a few
      Wasm-specific custom query commands, used to access aspects of the Wasm engine
      state (like the Wasm memory, Wasm local and global variables, and so on).
      Furthermore, the DWARF format would need to be enriched with a few Wasm-specific
      extensions, here detailed: https://yurydelendik.github.io/webassembly-dwarf.
      
      This CL introduce classes **ObjectFileWasm**, a file plugin to represent a Wasm
      module loaded in a debuggee process. It knows how to parse Wasm modules and
      store the Code section and the DWARF-specific sections.
      
      Reviewers: jasonmolenda, clayborg, labath
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D71575
      4bafcece
    • Richard Smith's avatar
      Fix pack deduction to only deduce the arity of packs that are actually · e8f198dd
      Richard Smith authored
      expanded by the deduced pack.
      
      We recently started also deducing the arity of separately-expanded packs
      that are merely mentioned within the pack in question, which is
      incorrect.
      e8f198dd
    • Jonas Devlieghere's avatar
      [lldb/Utils] Patch all variables used by lit (3/3) · eac134dd
      Jonas Devlieghere authored
      Instead of passing all the arguments for dotest.py as a single CMake
      variable, lit now uses separate variables for the different test
      binaries. Before this change they'd all get patched as part of the
      LLDB_DOTEST_ARGS. We need to patch the new variables as well.
      eac134dd
    • Jonas Devlieghere's avatar
      [lldb/Utils] Patch all variables used by lldb-dotest (2/2) · cf958498
      Jonas Devlieghere authored
      Instead of passing all the arguments for dotest.py as a single CMake
      variable, lldb-dotest now uses separate variables for the different test
      binaries. Before this change they'd all get patched as part of the
      LLDB_DOTEST_ARGS. We need to patch the new variables as well.
      cf958498
    • Stanislav Mekhanoshin's avatar
      Process BUNDLE in tail duplication · 8b417dd3
      Stanislav Mekhanoshin authored
      When tail duplication estimates a size of tail it uses instruction
      count. Account for a number of instrictions in a bundle too.
      
      Differential Revision: https://reviews.llvm.org/D72783
      8b417dd3
    • Amy Huang's avatar
      Revert "Further implement CWG 2292" · 44560762
      Amy Huang authored
      This reverts commit ee0f1f1e because it
      causes an error on valid code.
      See https://reviews.llvm.org/rGee0f1f1edc3ec0d4e698d50cc3180217448802b7.
      44560762
    • Alexey Bataev's avatar
      [OPENMP]Use regular processing of vtable used when TU is a prefix. · b841b9e9
      Alexey Bataev authored
      If current kind of the translation unit is TU_Prefix and it is not
      complete, cannot decide what to do with virtual members/table at that
      time, need to delay it to later stages.
      b841b9e9
    • Vedant Kumar's avatar
      [CodeExtractor] Transfer debug info to extracted function · 360abb7e
      Vedant Kumar authored
      After extracting, fix up debug info in both the old and new functions by
      
      1) Pointing line locations and debug intrinsics to the new subprogram
         scope, and
      
      2) Deleting intrinsics which point to values outside of the new
         function.
      
      Depends on https://reviews.llvm.org/D72795.
      
      Testing: check-llvm, check-clang, a build of LNT in the `-Os -g` config
      with "-mllvm -hot-cold-split=1" set, and end-to-end debugging of a toy
      program which undergoes splitting to verify that lldb can find
      variables, single step, etc. in extracted code.
      
      rdar://45507940
      
      Differential Revision: https://reviews.llvm.org/D72801
      360abb7e
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Select exp with patterns · 711a17af
      Matt Arsenault authored
      This does produce slightly different code. Now a unique IMPLICIT_DEF
      is emitted for each of the implicit_def operands, rather than reusing
      the same one.
      711a17af
    • Matt Arsenault's avatar
      AMDGPU: Remove custom node for exports · eef92f25
      Matt Arsenault authored
      I'm mildly worried about potentially reordering exp/exp_done with
      IntrWriteMem on the intrinsic.
      
      Requires hacking out the illegal type on SI, so manually select that
      case during lowering.
      eef92f25
    • Matt Arsenault's avatar
      GlobalISel: Handle more cases of G_SEXT narrowing · 25e9938a
      Matt Arsenault authored
      This now develops the same problem G_ZEXT/G_ANYEXT have where the
      requested type is assumed to be the source type. This will be fixed
      separately by creating intermediate merges.
      25e9938a
    • Brian Gesiak's avatar
      [IR] Module's NamedMD table needn't be 'void *' · daab9227
      Brian Gesiak authored
      Summary:
      In July 21 2010 `llvm::NamedMDNode` was refactored such that it would no
      longer subclass `llvm::Value`:
      https://github.com/llvm/llvm-project/commit/2637cc1a38d7336ea30caf
      
      As part of this change, a map type from metadata names to their named
      metadata, `llvm::MDSymbolTable`, was deleted. In its place, the type
      of member `llvm::Module::NamedMDSymTab` was changed, from
      `llvm::MDSymbolTable` to `void *`. The underlying memory allocations
      for this pointer were changed to `new StringMap<NamedMDNode *>()`.
      
      However, as far as I can tell, there's no need for obscuring the
      underlying type being pointed to by the `void *`, and no need for
      static casts from `void *` to `StringMap`. In fact, I don't think
      there's a need for explicit calls to `new` and `delete` at all.
      
      This commit changes `NamedMDSymTab` from a pointer to a reference, which
      automatically couples its lifetime with the lifetime of its owning
      `llvm::Module` instance, thus removing the explicit calls to `new` and
      `delete` in the `llvm::Module` constructor and destructor. It also
      changes the type from `void *` to a newly defined `NamedMDSymTabType`,
      and removes the static casts.
      
      Test Plan:
      An ASAN-enabled build and run of `check-all` succeeds with this change
      (aside from some tests that always fail for me in ASAN for some reason,
      such as `check-clang` `SemaTemplate/stack-exhaustion.cpp`).
      
      Reviewers: aprantl, dblaikie, chandlerc, pcc, echristo
      
      Reviewed By: dblaikie
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72812
      daab9227
    • Jonas Devlieghere's avatar
      [lldb/Utils] Patch all variables used by lldb-dotest · 81fc1be6
      Jonas Devlieghere authored
      Instead of passing all the arguments for dotest.py as a single CMake
      variable, lldb-dotest now uses separate variables for the different test
      binaries. Before this change they'd all get patched as part of the
      LLDB_DOTEST_ARGS. We need to patch the new variables as well.
      81fc1be6
    • Petr Hosek's avatar
      [libcxx] Use mtx_plain | mtx_recursive following C11 API · 3481e5d7
      Petr Hosek authored
      The C11 API specifies that to initialize a recursive mutex,
      mtx_plain | mtx_recursive should be used with mtx_init.
      
      Differential Revision: https://reviews.llvm.org/D72809
      3481e5d7
    • Reid Kleckner's avatar
      [COFF] Warn that LLD does not support /PDBSTRIPPED: · 8045a8a7
      Reid Kleckner authored
      Doesn't really fix PR44491, but it avoids treating it as an input.
      8045a8a7
    • Amy Huang's avatar
      Revert "Allow system header to provide their own implementation of some builtin" · 3d210ed3
      Amy Huang authored
      This reverts commit 921f871a because it
      causes libc++ code to trigger __warn_memset_zero_len.
      
      See https://reviews.llvm.org/D71082.
      3d210ed3
    • Jonas Devlieghere's avatar
      [lldb/Debugger] Rename IO handler methods to be more meaningful (NFC) · 7ce2de2c
      Jonas Devlieghere authored
      Make it clear form the method names whether they are synchronous or
      asynchronous.
      7ce2de2c
    • Alexey Bataev's avatar
      Revert "[OPENMP]Do not use RTTI by default for NVPTX devices." · 6b29aa21
      Alexey Bataev authored
      This reverts commit 23058f9d. It breaks
      builds of cuda code somehow in some cases.
      6b29aa21
    • Eric Fiselier's avatar
      [libc++] Fix parsing <string> in C++03. · 313d8972
      Eric Fiselier authored
      Specifically, add a space between >> when closing templates.
      313d8972
    • Eric Fiselier's avatar
      [libc++] Optimize basic_string::operator=(const basic_string&) for SSO assignments · 58c7fa5a
      Eric Fiselier authored
      This change optimizes the operator=() assignment for short strings by direcly
      copying the raw data from the source into the current instance. This creates an
      optimized / inlined mempcy up to over 2X faster for short string assignments.
      With inlining enabled for operator=, performance is up to 6X faster.
      
      Benchmarks 'as is':
      name                                    old time/op   new time/op    delta
      BM_StringAssignStr_Empty_Opaque         6.05ns ± 2%   3.59ns ± 0%  -40.67%
      BM_StringAssignStr_Empty_Transparent    5.15ns ± 0%   3.08ns ± 0%  -40.12%
      BM_StringAssignStr_Small_Opaque         7.71ns ± 0%   3.59ns ± 0%  -53.45%
      BM_StringAssignStr_Small_Transparent    7.66ns ± 0%   3.09ns ± 0%  -59.66%
      BM_StringAssignStr_Large_Opaque         24.1ns ± 0%   24.9ns ± 0%   +3.22%
      BM_StringAssignStr_Large_Transparent    22.2ns ± 0%   22.8ns ± 0%   +2.77%
      BM_StringAssignStr_Huge_Opaque           315ns ± 6%    320ns ± 5%     ~
      BM_StringAssignStr_Huge_Transparent      318ns ± 5%    321ns ± 4%     ~
      
      Benchmarks with partial inlining operator=():
      name                                    old time/op   new time/op    delta
      BM_StringAssignStr_Empty_Opaque         5.94ns ± 2%   1.95ns ± 0%  -67.21%
      BM_StringAssignStr_Empty_Transparent    5.14ns ± 0%   1.04ns ± 1%  -79.73%
      BM_StringAssignStr_Small_Opaque         7.69ns ± 0%   1.96ns ± 0%  -74.48%
      BM_StringAssignStr_Small_Transparent    7.65ns ± 0%   1.04ns ± 0%  -86.40%
      BM_StringAssignStr_Large_Opaque         24.1ns ± 0%   24.5ns ± 0%   +1.61%
      BM_StringAssignStr_Large_Transparent    22.2ns ± 0%   21.1ns ± 0%   -4.70%
      BM_StringAssignStr_Huge_Opaque           317ns ± 5%    323ns ± 4%     ~
      BM_StringAssignStr_Huge_Transparent      318ns ± 5%    320ns ± 5%     ~
      
      Patch by Martijn Vels (mvels@google.com)
      Reviewed as https://reviews.llvm.org/D72704
      58c7fa5a
    • Vedant Kumar's avatar
      [test] Move call-site-entry-linking.test into test/tools/dsymutil/X86 · 5aeb6798
      Vedant Kumar authored
      This should fix a failure on the clang-cmake-armv7-quick bot.
      5aeb6798
    • Vedant Kumar's avatar
      DWARF: Simplify the way the return PC is attached to call site tags, NFC · 43464509
      Vedant Kumar authored
      This cleanup was suggested by Djordje in D72489.
      43464509
    • Fedor Sergeev's avatar
      [BasicBlock] add helper getPostdominatingDeoptimizeCall · 8a4d12ae
      Fedor Sergeev authored
      It appears to be rather useful when analyzing Loops with multiple
      deoptimizing exits, perhaps merged ones.
      For now it is used in LoopPredication, will be adding more uses
      in other loop passes.
      
      Reviewers: asbirlea, fhahn, skatkov, spatel, reames
      Reviewed By: reames
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72754
      8a4d12ae
    • Eric Fiselier's avatar
      [libc++] Explicitly enumerate std::string external instantiations - Attempt 2 · 288a1436
      Eric Fiselier authored
        The GCC build failures have been addressed, and the LLDB failures were
        fixed by LLDB.
      
         I have also verified that the apple-clang 9.0 segfault no longer
         occurs.
      
      Original Message:
      
       The external instantiation of std::string is a problem for libc++.
          Additions and removals of inline functions in string can cause ABI
          breakages, including introducing new symbols.
      
          This patch aims to:
            (1) Make clear which functions are explicitly instatiated.
            (2) Prevent new functions from being accidentally instantiated.
            (3) Allow a migration path for adding or removing functions from the
            explicit instantiation over time.
      
          Although this new formulation is uglier, it is preferable from a
          maintainability and readability standpoint because it explicitly
          enumerates the functions we've chosen to expose in our ABI. Changing
          this list is non-trivial and requires thought and planning.
      
          (3) is achieved by making it possible to control the extern template declaration
          separately from it's definition. Meaning we could add a new definition to
          the dylib, wait for it to roll out, then add the extern template
          declaration to the header. Similarly, we could remove existing extern
          template declarations while still keeping the definition to prevent ABI
          breakages.
      288a1436
    • Eric Fiselier's avatar
      [libc++] Explicitly mark basic_string<...>::npos with default · 2d8f23f5
      Eric Fiselier authored
      visibility.
      
      This ensures that the version compiled into the library isn't
      accidentally hidden.
      2d8f23f5
    • Eric Fiselier's avatar
      [libc++] Make SFINAE'd member functions in string mutually exclusive. · 24d2a015
      Eric Fiselier authored
      This patch is needed in order to work around a GCC bug that fails to
      explicitly instantiate a non-template function of a class template when
      there is another overload that's a function template.
      (See https://godbolt.org/z/4bUQ_b)
      
      This patch SFINAE's away the function templates when the argument is
      a basic_string.
      24d2a015
    • Vedant Kumar's avatar
      lldb: Run TestCrossDSOTailCalls.py and TestCrossObjectTailCalls.py on Darwin only · 8d2f252b
      Vedant Kumar authored
      See https://bugs.llvm.org/show_bug.cgi?id=44561, these tests are failing
      on an aarch64/Linux bot:
      
      http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/655
      
      For some reason the backtrace the tests are expecting to find is
      incomplete.
      8d2f252b
    • Jinsong Ji's avatar
      [MachineScheduler][NFC] Don't swap when we can't cluster · c65ac2ba
      Jinsong Ji authored
      https://reviews.llvm.org/D72706 tried to reduce reordering due to mem op
      clustering. This patch avoid doing the swap when we can't cluster.
      
      Reviewed By: rampitec
      
      Differential Revision: https://reviews.llvm.org/D72800
      c65ac2ba
    • Mircea Trofin's avatar
      [NFC] Refactor InlineResult for readability · 5466597f
      Mircea Trofin authored
      Summary:
      InlineResult is used both in APIs assessing whether a call site is
      inlinable (e.g. llvm::isInlineViable) as well as in the function
      inlining utility (llvm::InlineFunction). It means slightly different
      things (can/should inlining happen, vs did it happen), and the
      implicit casting may introduce ambiguity (casting from 'false' in
      InlineFunction will default a message about hight costs,
      which is incorrect here).
      
      The change renames the type to a more generic name, and disables
      implicit constructors.
      
      Reviewers: eraman, davidxl
      
      Reviewed By: davidxl
      
      Subscribers: kerbowa, arsenm, jvesely, nhaehnle, eraman, hiraditya, haicheng, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72744
      5466597f
    • Jacques Pienaar's avatar
      [mlir] Add shaped container component type interface · fa26a37d
      Jacques Pienaar authored
      Summary:
      * Add shaped container type interface which allows infering the shape, element
        type and attribute of shaped container type separately. Show usage by way of
        tensor type inference trait which combines the shape & element type in
        infering a tensor type;
        - All components need not be specified;
        - Attribute is added to allow for layout attribute that was previously
          discussed;
      * Expand the test driver to make it easier to test new creation instances
        (adding new operands or ops with attributes or regions would trigger build
        functions/type inference methods);
        - The verification part will be moved out of the test and to verify method
          instead of ops implementing the type inference interface in a follow up;
      * Add MLIRContext as arg to possible to create type for ops without arguments,
        region or location;
      * Also move out the section in OpDefinitions doc to separate ShapeInference doc
        where the shape function requirements can be captured;
        - Part of this would move to the shape dialect and/or shape dialect ops be
          included as subsection of this doc;
      * Update ODS's variable usage to match camelBack format for builder,
        state and arg variables;
        - I could have split this out, but I had to make some changes around
          these and the inconsistency bugged me :)
      
      Differential Revision: https://reviews.llvm.org/D72432
      fa26a37d
    • Zhongduo Lin's avatar
      [NFC][IndVarSimplify] remove duplicate code in widenWithVariantLoadUseCodegen. · 34ba96a3
      Zhongduo Lin authored
      Summary: Duplicate code in widenWithVariantLoadUseCodegen is removed and also use assert to check unknown extension type as it should be filtered out by the pre condition check before calling this function.
      
      Reviewers: az, sanjoy, sebpop, efriedma, javed.absar, sanjoy.google
      
      Reviewed By: efriedma
      
      Subscribers: hiraditya, llvm-commits, amehsan
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72652
      34ba96a3
    • Richard Smith's avatar
      PR17164: Change clang's default behavior from -flax-vector-conversions=all to... · b72a8c65
      Richard Smith authored
      PR17164: Change clang's default behavior from -flax-vector-conversions=all to -flax-vector-conversions=integer.
      
      Summary:
      See proposal on cfe-dev:
      http://lists.llvm.org/pipermail/cfe-dev/2019-April/062030.html
      
      Reviewers: SjoerdMeijer, eli.friedman
      
      Subscribers: kristof.beyls, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D67678
      b72a8c65
    • Richard Smith's avatar
      Work around PR43337: don't try to use the vec_sel overloads for vector long... · 388eaa12
      Richard Smith authored
      Work around PR43337: don't try to use the vec_sel overloads for vector long long, since clang's <altivec.h> doesn't provide it yet!
      388eaa12
    • Vedant Kumar's avatar
      DebugInfo: Factor out logic to update locations in MD_loop metadata, NFC · a2cc80bc
      Vedant Kumar authored
      Factor out the logic needed to update debug locations contained within
      MD_loop metadata.
      
      This refactor is preparation for a future change that also needs to
      rewrite MD_loop metadata.
      
      rdar://45507940
      a2cc80bc
    • Vedant Kumar's avatar
      [DWARF] Emit DW_AT_call_return_pc as an address · f0120556
      Vedant Kumar authored
      This reverts D53469, which changed llvm's DWARF emission to emit
      DW_AT_call_return_pc as a function-local offset. Such an encoding is not
      compatible with post-link block re-ordering tools and isn't standards-
      compliant.
      
      In addition to reverting back to the original DW_AT_call_return_pc
      encoding, teach lldb how to fix up DW_AT_call_return_pc when the address
      comes from an object file pointed-to by a debug map. While doing this I
      noticed that lldb's support for tail calls that cross a DSO/object file
      boundary wasn't covered, so I added tests for that. This latter case
      exercises the newly added return PC fixup.
      
      The dsymutil changes in this patch were originally included in D49887:
      the associated test should be sufficient to test DW_AT_call_return_pc
      encoding purely on the llvm side.
      
      Differential Revision: https://reviews.llvm.org/D72489
      f0120556
    • Lang Hames's avatar
      [docs][ORC] Update the laziness section of the ORCv2 design doc. · d6295255
      Lang Hames authored
      This updates the discussion of lazy reexports, fixes a TBD for a usage example,
      and adds a reference to the fully worked lazy reexports example that was added
      in e9e26c01.
      d6295255
    • Nico Weber's avatar
      [gn build] re-run "gn format" with trunk gn · 527281a8
      Nico Weber authored
      527281a8
    • Nico Weber's avatar
      eadc2827