1. Mar 27, 2019
    • Jonas Devlieghere's avatar
      [Python] Remove dynamic indirection · 05495c5d
      Jonas Devlieghere authored
      Now that the Python plugin relies on the SWIG symbols, we no longer need
      to dynamically resolve these functions.
      
      llvm-svn: 357034
      05495c5d
    • Guozhi Wei's avatar
      [PPC] Refactor PPCBranchSelector.cpp · 330dcd9d
      Guozhi Wei authored
      This patch splits the huge function PPCBranchSelector.cpp:runOnMachineFunction into several smaller functions.
      
      No functional change.
      
      Differential Revision: https://reviews.llvm.org/D59623
      
      llvm-svn: 357033
      330dcd9d
    • Quentin Colombet's avatar
      [LiveRange] Reset the VNIs when splitting subranges · c74271c5
      Quentin Colombet authored
      When splitting a subrange we end up with two different subranges covering
      two different, non overlapping, lanes.
      As part of this splitting the VNIs of the original live-range need
      to be dispatched to the subranges according to which lanes they are
      actually defining.
      
      Prior to this patch we were assuming that all values were defining
      all lanes. This was wrong as demonstrated by llvm.org/PR40835.
      
      Differential Revision: https://reviews.llvm.org/D59731
      
      llvm-svn: 357032
      c74271c5
    • Jessica Paquette's avatar
      Make -mno-outline pass -enable-machine-outliner=never to ld in LTO · 55d49547
      Jessica Paquette authored
      Since AArch64 has default outlining behaviour, we need to make sure that
      -mno-outline is actually passed along to the linker in this case. Otherwise,
      it will run by default on minsize functions even when -mno-outline is specified.
      
      Also fix the darwin-ld test for this, which wasn't actually doing anything.
      
      llvm-svn: 357031
      55d49547
    • Alex Langford's avatar
      [ExpressionParser] Add swift-lldb case for finding clang resource dir · 982726ea
      Alex Langford authored
      Summary:
      I'm adding this to reduce the difference between swift-lldb and
      llvm.org's lldb.
      
      Reviewers: aprantl, davide, compnerd, JDevlieghere, jingham
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D59708
      
      llvm-svn: 357030
      982726ea
    • Sanjay Patel's avatar
      [SDAG] add simplifications for FP at node creation time · bb5cba3c
      Sanjay Patel authored
      We have the folds for fadd/fsub/fmul already in DAGCombiner,
      so it may be possible to remove that code if we can guarantee that
      these ops are zapped before they can exist.
      
      llvm-svn: 357029
      bb5cba3c
    • Stefan Pintilie's avatar
      [PowerPC] Remove UseVSXReg · e1d79a87
      Stefan Pintilie authored
      The UseVSXReg flag can be safely removed and the code cleaned up.
      
      Patch By: Yi-Hong Liu
      
      Differential Revision: https://reviews.llvm.org/D58685
      
      llvm-svn: 357028
      e1d79a87
    • Ronald Wampler's avatar
      [clang-format] Add style option AllowShortLambdasOnASingleLine · a83e2dbb
      Ronald Wampler authored
      Summary:
      This option `AllowShortLambdasOnASingleLine` similar to the other `AllowShort*` options, but applied to C++ lambdas.
      
      Reviewers: djasper, klimek
      
      Reviewed By: klimek
      
      Subscribers: MyDeveloperDay, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57687
      
      llvm-svn: 357027
      a83e2dbb
    • Ali Tamur's avatar
      Revert "[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5."" · 02e96648
      Ali Tamur authored
      This reverts commit rL357020.
      
      The commit broke the test llvm/test/tools/llvm-objdump/embedded-source.test
      on some builds including clang-ppc64be-linux-multistage,
      clang-s390x-linux, clang-with-lto-ubuntu, clang-x64-windows-msvc,
      llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast (and others).
      
      llvm-svn: 357026
      02e96648
    • Ali Tamur's avatar
      Revert "[lld] Reapply "Prevent duplicate files in debug line header in dwarf 5."" · cea95480
      Ali Tamur authored
      This reverts commit rL357020
      
      Reason: rL357018, which this commit depend on breaks the test:
      llvm/test/tools/llvm-objdump/embedded-source.test on some architectures.
      
      llvm-svn: 357025
      cea95480
    • Thomas Anderson's avatar
      [libc++] Fix return value of snprintf_l() on Windows when buffer is too small · d4d824a8
      Thomas Anderson authored
      When the output buffer is too small to contain the output, `vsnprintf()`
      fills the buffer and returns the number of characters that __would have__
      been written if the buffer was sufficiently large.
      
      `_vnsprintf_s()` on the other hand fills the buffer and returns -1 when this
      happens.  We want the former behavior, but we also want to be able to
      pass in a locale to prevent having to call `setlocale()`.
      
      `__stdio_common_vsprintf()` is the only function general enough to get
      the behavior we want.
      
      Differential Revision: https://reviews.llvm.org/D59727
      
      llvm-svn: 357024
      d4d824a8
    • Brian Gesiak's avatar
      Revert "[coroutines] Add std::experimental::task<T> type" · b66754a2
      Brian Gesiak authored
      This revision is causing build and test failures, such as
      http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv8-linux/builds/648/steps/test.libcxx/logs/stdio,
      so I'll revert it.
      
      llvm-svn: 357023
      b66754a2
    • Sam Clegg's avatar
      [WebAssembly] Initial implementation of PIC code generation · 492f7529
      Sam Clegg authored
      This change implements lowering of references global symbols in PIC
      mode.
      
      This change implements lowering of global references in PIC mode using a
      new @GOT reference type. @GOT references can be used with function or
      data symbol names combined with the get_global instruction. In this case
      the linker will insert the wasm global that stores the address of the
      symbol (either in memory for data symbols or in the wasm table for
      function symbols).
      
      For now I'm continuing to use the R_WASM_GLOBAL_INDEX_LEB relocation
      type for this type of reference which means that this relocation type
      can refer to either a global or a function or data symbol. We could
      choose to introduce specific relocation types for GOT entries in the
      future.  See the current dynamic linking proposal:
      
      https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
      
      Differential Revision: https://reviews.llvm.org/D54647
      
      llvm-svn: 357022
      492f7529
    • Nico Weber's avatar
      gn build: Format all build files · 6f4c45e9
      Nico Weber authored
      Re-ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.
      
      llvm-svn: 357021
      6f4c45e9
    • Ali Tamur's avatar
      [lld] Reapply "Prevent duplicate files in debug line header in dwarf 5." · 5c2f176c
      Ali Tamur authored
      Reapply rL356943; the previous attempt was reverted because the patch rL356941
      that this depended on had broken a test.
      
      Original commit message:
      
      [lld] Prevent duplicate files in debug line header in dwarf 5.
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59671
      
      llvm-svn: 357020
      5c2f176c
    • Nico Weber's avatar
      445744d8
    • Ali Tamur's avatar
      [llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5." · 2f5cd03a
      Ali Tamur authored
      Reapply rL356941 after regenerating the object file in the failing test
      llvm/test/tools/llvm-objdump/embedded-source.test from source.
      
      Original commit message:
      
      [llvm] Prevent duplicate files in debug line header in dwarf 5.
      
      Motivation: In previous dwarf versions, file name indexes started from 1, and
      the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
      the primary source file to be explicitly given an entry with an index number 0.
      
      The current implementation honors the specification by just duplicating the
      main source file, once with index number 0, and later maybe with another
      index number. While this is compliant with the letter of the standard, the
      duplication causes problems for consumers of this information such as lldb.
      (Some files are duplicated, where only some of them have a line table although
      all refer to the same file)
      
      With this change, dwarf 5 debug line section files always start from 0, and
      the zeroth entry is not duplicated whenever possible. This requires different
      handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
      an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5)
      However, I think the minor complication is worth it, because it enables all
      consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
      file name list homogenously.
      
      Tags: #llvm, #debug-info
      
      Differential Revision: https://reviews.llvm.org/D59515
      
      llvm-svn: 357018
      2f5cd03a
    • George Rimar's avatar
      [llvm-objcopy] - Strip sections before symbols. · 279898b3
      George Rimar authored
      This is a fix for https://bugs.llvm.org/show_bug.cgi?id=40007.
      
      Idea is to swap the order of stripping. So that we strip sections before
      symbols what allows us to strip relocation sections without emitting
      the error about relative symbols.
      
      Differential revision: https://reviews.llvm.org/D59763
      
      llvm-svn: 357017
      279898b3
    • Jorge Gorbe Moya's avatar
      Add lldb-vscode as a dependency of lldb tests. · d7aba767
      Jorge Gorbe Moya authored
      Summary:
      In the current state, 'ninja check-lldb' runs the lldb-vscode tests, but it
      won't rebuild lldb-vscode if any of its sources has changed. This is very
      confusing when you fix something and the tests keep failing, or vice versa.
      
      Reviewers: clayborg
      
      Subscribers: mgorny, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D59828
      
      llvm-svn: 357016
      d7aba767
    • Heejin Ahn's avatar
      [WebAssembly] Don't analyze branches after CFGStackify · 54551c1d
      Heejin Ahn authored
      Summary:
      `WebAssembly::analyzeBranch` now does not analyze anything if the
      function is CFG stackified. We were previously doing similar things by
      checking if a branch's operand is whether an integer or an MBB, but this
      failed to bail out when a BB did not have any terminators.
      
      Consider this case:
      ```
      bb0:
        try $label0
        call @foo    // unwinds to %ehpad
      bb1:
        ...
        br $label0   // jumps to %cont. can be deleted
      ehpad:
        catch
        ...
      cont:
        end_try
      ```
      Here `br $label0` will be deleted in CFGStackify's
      `removeUnnecessaryInstrs` function, because we jump to the %cont block
      even without the branch. But in this case, MachineVerifier fails to
      verify this, because `ehpad` is not a successor of `bb1` even if `bb1`
      does not have any terminators. MachineVerifier incorrectly thinks `bb1`
      falls through to the next block.
      
      This pass now consistently rejects all analysis after CFGStackify
      whether a BB has terminators or not, also making the MachineVerifier
      work. (MachineVerifier does not try to verify relationships between BBs
      if `analyzeBranch` fails, the behavior we want after CFGStackify.)
      
      This also adds a new option `-wasm-disable-ehpad-sort` for testing. This
      option helps create the sorted order we want to test, and without the
      fix in this patch, the tests in cfg-stackify-eh.ll fail at
      MachineVerifier with `-wasm-disable-ehpad-sort`.
      
      Reviewers: dschuff
      
      Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59740
      
      llvm-svn: 357015
      54551c1d
    • Nikita Popov's avatar
      [ConstantRange] Fix outdated comment; NFC · 5740a3ed
      Nikita Popov authored
      Full/empty is required now, so there is no default.
      
      llvm-svn: 357014
      5740a3ed
    • Nikita Popov's avatar
      [InstCombine] Add tests for ssubo X, C -> saddo X, -C; NFC · 7f15dd09
      Nikita Popov authored
      Add baseline tests for canonicalization of
      ssubo X, C -> saddo X, -C.
      
      Patch by Dan Robertson.
      
      Differential Revision: https://reviews.llvm.org/D59653
      
      llvm-svn: 357013
      7f15dd09
    • Sanjay Patel's avatar
      [InstCombine] form uaddsat from add+umin (PR14613) · 81e8d76f
      Sanjay Patel authored
      This is the last step towards solving the examples shown in:
      https://bugs.llvm.org/show_bug.cgi?id=14613
      
      With this change, x86 should end up with psubus instructions
      when those are available.
      
      All known codegen issues with expanding the saturating intrinsics
      were resolved with:
      D59006 / rL356855
      
      We also have some early evidence in D58872 that using the intrinsics
      will lead to better perf. If some target regresses from this, custom
      lowering of the intrinsics (as in the above for x86) may be needed.
      
      llvm-svn: 357012
      81e8d76f
    • Heejin Ahn's avatar
      [WebAssembly] Add CFGStacikfied field to WebAssemblyFunctionInfo · 1aaa481f
      Heejin Ahn authored
      Summary:
      This adds `CFGStackified` field and its serialization to
      WebAssemblyFunctionInfo.
      
      Reviewers: dschuff
      
      Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59747
      
      llvm-svn: 357011
      1aaa481f
    • Brian Gesiak's avatar
      [coroutines] Add std::experimental::task<T> type · 57839425
      Brian Gesiak authored
      Summary:
      Adds the coroutine `std::experimental::task<T>` type described in proposal P1056R0.
      See https://wg21.link/P1056R0.
      
      This implementation allows customization of the allocator used to allocate the
      coroutine frame by passing std::allocator_arg as the first argument, followed by
      the allocator to use.
      
      This supports co_awaiting the same task multiple times. The second and
      subsequent times it returns a reference to the already-computed value.
      
      This diff also adds some implementations of other utilities that have potential for
      standardization as helpers within the test/... area:
      - `sync_wait(awaitable)` - See P1171R0
      - `manual_reset_event`
      
      Move the definition of the __aligned_allocation_size helper function
      from <experimental/memory_resource> to <experimental/__memory>
      so it can be more widely used without pulling in memory_resource.
      
      Outstanding work:
      - Use C++14 keywords directly rather than macro versions
        eg. use `noexcept` instead of `_NOEXCEPT`).
      - Add support for overaligned coroutine frames.
        This may need wording in the Coroutines TS to support passing the extra `std::align_val_t`.
      - Eliminate use of `if constexpr` if we want it to compile under C++14.
      
      Patch by @lewissbaker (Lewis Baker).
      
      llvm-svn: 357010
      57839425
    • Heejin Ahn's avatar
      [WebAssembly] Support WebAssemblyFunctionInfo serialization · 52221d56
      Heejin Ahn authored
      Summary:
      The framework for supporting target-specific MachineFunctionInfo was
      added in r356215. This adds serialization support for
      WebAssemblyFunctionInfo on top of that. This patch only adds the
      framework and does not actually serialize anything at this point; we
      have to add YAML mapping later for the fields in WebAssemblyFunctionInfo
      we want to serialize if necessary.
      
      Reviewers: dschuff, arsenm
      
      Subscribers: sunfish, wdng, sbc100, jgravelle-google, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59737
      
      llvm-svn: 357009
      52221d56
    • Heejin Ahn's avatar
      [WebAssembly] Fix a bug when mixing TRY/LOOP markers · 222718fd
      Heejin Ahn authored
      Summary:
      When TRY and LOOP markers are in the same BB and END_TRY and END_LOOP
      markers are in the same BB, END_TRY should be _before_ END_LOOP, because
      LOOP is always before TRY if they are in the same BB. (TRY is placed in
      the latest possible position, whereas LOOP is in the earliest possible
      position.)
      
      Reviewers: dschuff
      
      Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59751
      
      llvm-svn: 357008
      222718fd
    • Heejin Ahn's avatar
      [WebAssembly] Fix bugs in BLOCK/TRY placement · 44a5a4b1
      Heejin Ahn authored
      Summary:
      Before we placed all TRY/END_TRY markers before placing BLOCK/END_BLOCK
      markers. This couldn't handle this case:
      ```
      bb0:
        br bb2
      bb1:          // nearest common dominator of bb3 and bb4
        br_if ... bb3
        br bb4
      bb2:
        ...
      bb3:
        call @foo   // unwinds to ehpad
      bb4:
        call @bar   // unwinds to ehpad
      ehpad:
        catch
        ...
      ```
      
      When we placed TRY markers, we placed it in bb1 because it is the
      nearest common dominator of bb3 and bb4. But because bb0 jumps to bb2,
      when we placed block markers, we ended up with interleaved scopes like
      ```
      block
      try
      end_block
      catch
      end_try
      ```
      which was not correct.
      
      This patch fixes the bug by placing BLOCK and TRY markers in one pass
      while iterating BBs in a function. This also adds some more routines to
      `placeTryMarkers`, because we now have to assume that there can be
      previously placed BLOCK and END_BLOCK.
      
      Reviewers: dschuff
      
      Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59739
      
      llvm-svn: 357007
      44a5a4b1
    • Davide Italiano's avatar
      [ScriptInterpreterPython] Try to make the sanitizer bot green again. · 5c4fad0c
      Davide Italiano authored
      Removing a use-after-free error.
      
      llvm-svn: 357006
      5c4fad0c
    • Sanjay Patel's avatar
      [InstCombine] add tests for uaddsat using min; NFC · 0dd67ed4
      Sanjay Patel authored
      llvm-svn: 357005
      0dd67ed4
  2. Mar 26, 2019