1. Mar 21, 2019
    • Jason Molenda's avatar
      Change the logging on ptrace(PT_KILL) in MachProcess::Kill to log · 9d760a0a
      Jason Molenda authored
      if LOG_PROCESS is enabled or if there was an error making that call.
      
      <rdar://problem/49036508> 
      
      llvm-svn: 356626
      9d760a0a
    • Jason Molenda's avatar
      Update DWARF files. · db5edebe
      Jason Molenda authored
      llvm-svn: 356625
      db5edebe
    • Nico Weber's avatar
      libc++/win: Make once_flag have the same size as a pointer. · 0fd00a58
      Nico Weber authored
      `unsigned long` is 32-bit on 32-bit systems and 64-bit on 64-bit systems
      on LP64 systems -- which most Unix systems are, but Windows isn't.
      Windows is LLP64, which means unsigned long is 32-bit even on 64-bit
      systems.
      
      pplwin.h contains
      
          static_assert(alignof(void *) == alignof(::std::once_flag), ...)
      
      which fails due to this problem.
      
      Instead of unsigned long, use uintptr_t, which consistently is 32-bit
      on 32-bit systems and 64-bit on 64-bit systems.
      
      No functional change except on 64-bit Windows.
      
      Differential Revision: https://reviews.llvm.org/D59607
      
      llvm-svn: 356624
      0fd00a58
    • Jordan Rupprecht's avatar
      Revert "[clangd] Print arguments in template specializations" · ce3d6700
      Jordan Rupprecht authored
      This reverts commit 44a63f6a. It segfaults on an internal test case (will follow up off thread).
      
      llvm-svn: 356623
      ce3d6700
    • Thomas Lively's avatar
      [WebAssembly][NFC] Fix formatting error from rL356610 · 5098f858
      Thomas Lively authored
      llvm-svn: 356622
      5098f858
    • Tim Renouf's avatar
      [AMDGPU] Do not generate spurious PAL metadata · 2327c231
      Tim Renouf authored
      My previous fix rL356591 "[AMDGPU] Added MsgPack format PAL metadata"
      accidentally caused a spurious PAL metadata .note record to be emitted
      for any AMDGPU output. That caused failures in the lld test
      amdgpu-relocs.s. Fixed.
      
      Differential Revision: https://reviews.llvm.org/D59613
      
      Change-Id: Ie04a2aaae890dcd490f22c89edf9913a77ce070e
      llvm-svn: 356621
      2327c231
    • Nikita Popov's avatar
      [InstCombine] Add additional sub nsw inference tests; NFC · 03dbfc2e
      Nikita Popov authored
      nsw can be determined based on known bits here, but currently
      isn't.
      
      llvm-svn: 356620
      03dbfc2e
    • Stanislav Mekhanoshin's avatar
      Allow machine dce to remove uses in the same instruction · 0a11829a
      Stanislav Mekhanoshin authored
      Machine DCE cannot remove a dead definition if there are non-dbg uses.
      A use however can be in the same instruction:
      
        dead %0 = INST %0
      
      Such instructions sometimes created by Detect dead lanes pass.
      
      Allow this instruction to be deleted despite the use if the only use
      belongs to the same instruction.
      
      Differential Revision: https://reviews.llvm.org/D59565
      
      llvm-svn: 356619
      0a11829a
    • Craig Topper's avatar
      [X86] Call lowerShuffleAsBitMask for 512-bit vectors in lowerShuffleAsBlend. · 03675533
      Craig Topper authored
      This patch enables the use of lowerShuffleAsBitMask for 512-bit blends before
      falling back to move immedate, GPR to k-register, and masked op.
      
      I had to make some changes to support v8i64 when i64 is not a legal type. And to
      support floating point types.
      
      This trades a load for the move immediate and GPR move which is higher latency.
      But its probably better for register pressure not having to hop through other
      register classes. The load+and should play better with LICM and
      rematerialization I think.
      
      Differential Revision: https://reviews.llvm.org/D59479
      
      llvm-svn: 356618
      03675533
    • Michael Liao's avatar
      [AMDGPU] Fix dependency on `BinaryFormat` · bbcb95a6
      Michael Liao authored
      Summary: - The linking is broken when this library is built as shared one.
      
      Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59610
      
      llvm-svn: 356617
      bbcb95a6
    • Louis Dionne's avatar
      [libc++] Mark <filesystem> as unavailable on Apple platforms using pragmas · fa057302
      Louis Dionne authored
      Summary:
      Also add the corresponding XFAILs to tests that require filesystem.
      The approach taken to mark <filesystem> as unavailable in this patch
      is to mark all the header as unavailable using #pragma clang attribute.
      Marking each declaration using the attribute is more intrusive and
      does not provide a lot of value right now because pretty much everything
      in <filesystem> requires dylib support, often transitively.
      
      This is an alternative to https://reviews.llvm.org/D59093.
      A similar (but partial) patch was already applied in r356558.
      
      Reviewers: mclow.lists, EricWF, serge-sans-paille
      
      Subscribers: christof, jkorous, dexonsmith, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D59224
      
      llvm-svn: 356616
      fa057302
    • Paul Hoad's avatar
      [clang-format][NFC] fix release notes build issue · 7c6ce35c
      Paul Hoad authored
      build issue from r356613
      
      llvm-svn: 356615
      7c6ce35c
    • Jordan Rupprecht's avatar
      [clang][OpenMP] Fix build when using libgomp · bcb8316d
      Jordan Rupprecht authored
      Summary: rL356570 introduced a test which only passes with the default openmp library, libomp, and fails with other openmp libraries, such as libgomp. Explicitly choose libomp.
      
      Reviewers: lebedev.ri
      
      Subscribers: guansong, jdoerfert, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59609
      
      llvm-svn: 356614
      bcb8316d
    • Paul Hoad's avatar
      [clang-format] BeforeHash added to IndentPPDirectives · 701a0d7e
      Paul Hoad authored
      Summary:
      The option BeforeHash added to IndentPPDirectives.
      Fixes Bug 36019. https://bugs.llvm.org/show_bug.cgi?id=36019
      
      Reviewers: djasper, klimek, krasimir, sammccall, mprobst, Nicola, MyDeveloperDay
      
      Reviewed By: klimek, MyDeveloperDay
      
      Subscribers: kadircet, MyDeveloperDay, mnussbaum, geleji, ufna, cfe-commits
      
      Patch by to-mix.
      
      Differential Revision: https://reviews.llvm.org/D52150
      
      llvm-svn: 356613
      701a0d7e
    • Zachary Turner's avatar
      Introduce DWARFContext. · 6e665127
      Zachary Turner authored
      LLVM's DWARF parsing library has a class called DWARFContext which holds
      all of the various DWARF data sections and lots of other information.
      LLDB's on the other hand stores all of this directly in SymbolFileDWARF
      / SymbolFileDWARFDwo and passes this interface around through the
      parsing library. Obviously this is incompatible with a world where the
      low level interface does not depend on the high level interface, so we
      need to move towards a model similar to LLVM's - i.e. all of the context
      needed for low level parsing should be in a single class, and that class
      gets passed around.
      
      This patch is a small incremental step towards achieving this. The
      interface and internals deviate from LLVM's for technical reasons, but
      the high level idea is the same. The goal is, eventually, to remove all
      occurrences of SymbolFileDWARF from the low level parsing code.
      
      For now I've chosen a very simple section - the .debug_aranges section
      to move into DWARFContext while leaving everything else unchanged. In
      the short term this is a bit confusing because now the information you
      need might come from either of 2 different locations. But it's a huge
      refactor to do this all at once and runs a much higher risk of breaking
      things. So I think it would be wise to do this in very small pieces.
      
      TL;DR - No functional change
      
      Differential Revision: https://reviews.llvm.org/D59562
      
      llvm-svn: 356612
      6e665127
    • Matt Arsenault's avatar
      AMDGPU: Don't look for constant in insert/extract_vector_elt regbankselect · 2065206a
      Matt Arsenault authored
      The constantness shouldn't change the register bank choice. We also
      don't need to restrict this to only indexing VGPRs, since it's
      possible to index SGPRs (but SelectionDAG made using this
      difficult). Allow directly indexing SGPRs when appropriate.
      
      llvm-svn: 356611
      2065206a
    • Thomas Lively's avatar
      [WebAssembly] Target features section · f6f4f843
      Thomas Lively authored
      Summary:
      Implements a new target features section in assembly and object files
      that records what features are used, required, and disallowed in
      WebAssembly objects. The linker uses this information to ensure that
      all objects participating in a link are feature-compatible and records
      the set of used features in the output binary for use by optimizers
      and other tools later in the toolchain.
      
      The "atomics" feature is always required or disallowed to prevent
      linking code with stripped atomics into multithreaded binaries. Other
      features are marked used if they are enabled globally or on any
      function in a module.
      
      Future CLs will add linker flags for ignoring feature compatibility
      checks and for specifying the set of allowed features, implement using
      the presence of the "atomics" feature to control the type of memory
      and segments in the linked binary, and add front-end flags for
      relaxing the linkage policy for atomics.
      
      Reviewers: aheejin, sbc100, dschuff
      
      Subscribers: jgravelle-google, hiraditya, sunfish, mgrang, jfb, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59173
      
      llvm-svn: 356610
      f6f4f843
    • Craig Topper's avatar
      [X86] Add __crc32b/__crc32w/__crc32d/__crc32q intrinsics to match gcc and icc. · e0941cb3
      Craig Topper authored
      gcc has these intrinsics in ia32intrin.h as well. And icc implements them
      though they aren't documented in the Intel Intrinsics Guide.
      
      Differential Revision: https://reviews.llvm.org/D59533
      
      llvm-svn: 356609
      e0941cb3
    • Michael Liao's avatar
      [AMDGPU] Fix clamp bit DAG operand · eea5177d
      Michael Liao authored
      Summary:
      - Should use `targetconstant` instead of `constant` operand for clamp
        bit, which is expected as an immediate operand. Under certain
        conditions, such as a common `i1 false` constant is used in other
        place and selected before the instruction with clamp bit, register
        operand may be added instead of immediate one. Use `targetcosntant` to
        enforce that.
      
      Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59608
      
      llvm-svn: 356608
      eea5177d
    • Alexey Bataev's avatar
      [OPENMP]Improve detection of omp_allocator_handle_t type and predefined · 27ef9518
      Alexey Bataev authored
      allocators.
      
      It is better to deduce omp_allocator_handle_t type from the predefined
      allocators, because omp.h header might not define it explicitly. Plus,
      it allows to identify the predefined allocators correctly when trying to
      build the allcoator for the global variables.
      
      llvm-svn: 356607
      27ef9518
    • Pete Couperus's avatar
      [ARC] Add ARCOptAddrMode pass to generate postincrement loads/stores. · b062239d
      Pete Couperus authored
      Build on newly introduced ARC postincrement loads/stores from r356200.
      
      Patch By Denis Antrushin! <denis@synopsys.com>
      
      Differential Revision: https://reviews.llvm.org/D59409
      
      llvm-svn: 356606
      b062239d
    • Alex Lorenz's avatar
      Fix implicit ios -> watchOS availability version mapping for · 0b436484
      Alex Lorenz authored
      versions that have the major number only
      
      rdar://48018651
      
      llvm-svn: 356605
      0b436484
    • Evandro Menezes's avatar
      [AArch64] Fix formatting (NFC) · f7522cab
      Evandro Menezes authored
      Indent macro instances properly.
      
      llvm-svn: 356604
      f7522cab
    • Konstantin Zhuravlyov's avatar
    • Marshall Clow's avatar
      Mark <charconv> tests as unsupported for C++11 and C++14 if you're not testing... · 61914dc2
      Marshall Clow authored
      Mark <charconv> tests as unsupported for C++11 and C++14 if you're not testing libc++. Thanks to Louis for the suggestion.
      
      llvm-svn: 356602
      61914dc2
    • Eli Friedman's avatar
      [ARM] Eliminate redundant "mov rN, sp" instructions in Thumb1. · 638be660
      Eli Friedman authored
      This takes sequences like "mov r4, sp; str r0, [r4]", and optimizes them
      to something like "str r0, [sp]".
      
      For regular stack variables, this optimization was already implemented:
      we lower loads and stores using frame indexes, which are expanded later.
      However, when constructing a call frame for a call with more than four
      arguments, the existing optimization doesn't apply.  We need to use
      stores which are actually relative to the current value of sp, and don't
      have an associated frame index.
      
      This patch adds a special case to handle that construct.  At the DAG
      level, this is an ISD::STORE where the address is a CopyFromReg from SP
      (plus a small constant offset).
      
      This applies only to Thumb1: in Thumb2 or ARM mode, a regular store
      instruction can access SP directly, so the COPY gets eliminated by
      existing code.
      
      The change to ARMDAGToDAGISel::SelectThumbAddrModeSP is a related
      cleanup: we shouldn't pretend that it can select anything other than
      frame indexes.
      
      Differential Revision: https://reviews.llvm.org/D59568
      
      llvm-svn: 356601
      638be660
    • Erik Pilkington's avatar
      Add a __has_extension check for '#pragma clang attribute' as an external-declaration · 8ca6ab33
      Erik Pilkington authored
      This was added in r356075.
      
      llvm-svn: 356600
      8ca6ab33
    • Erik Pilkington's avatar
      [Sema] Deduplicate some availability checking logic · 13ee62f7
      Erik Pilkington authored
      Before this commit, we emit unavailable errors for calls to functions during
      overload resolution, and for references to all other declarations in
      DiagnoseUseOfDecl. The early checks during overload resolution aren't as good as
      the DiagnoseAvailabilityOfDecl based checks, as they error on the code from
      PR40991. This commit fixes this by removing the early checking.
      
      llvm.org/PR40991
      rdar://48564179
      
      Differential revision: https://reviews.llvm.org/D59394
      
      llvm-svn: 356599
      13ee62f7
    • Rafael Auler's avatar
      Recommit "Support attribute used in member funcs of class templates" · 9dde31ec
      Rafael Auler authored
      This diff previously exposed a bug in LLVM's IRLinker, breaking
      buildbots that tried to self-host LLVM with monolithic LTO.
      The bug is now in LLVM by D59552
      
      Original commit message:
      As PR17480 describes, clang does not support the used attribute
      for member functions of class templates. This means that if the member
      function is not used, its definition is never instantiated. This patch
      changes clang to emit the definition if it has the used attribute.
      
      Test Plan: Added a testcase
      
      Reviewed By: aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D56928
      
      llvm-svn: 356598
      9dde31ec
    • Rafael Auler's avatar
      [Linker] Fix crash handling appending linkage · 6dc53ccb
      Rafael Auler authored
      Summary:
      When linking two llvm.used arrays, if the resulting merged
      array ends up with duplicated elements (with the same name) but with
      different types, the IRLinker was crashing. This was supposed to be
      legal, as the IRLinker bitcasts elements to match types in these
      situations.
      
      This bug was exposed by D56928 in clang to support attribute used
      in member functions of class templates. Crash happened when self-hosting
      with LTO. Since LLVM depends on attribute used to generate code
      for the dump() method, ubiquitous in the code base, many input bc
      had a definition of this method referenced in their llvm.used array.
      Some of these classes got optimized, changing the type of the first
      parameter (this) in the dump method, leading to a scenario with a
      pool of valid definitions but some with a different type, triggering
      this bug.
      
      This is a memory bug: ValueMapper depends on (calls) the materializer
      provided by IRLinker, and this materializer was freely calling RAUW
      methods whenever a global definition was updated in the temporary merged
      output file. However, replaceAllUsesWith may or may not destroy
      constants that use this global. If the linked definition has a type
      mismatch regarding the new def and the old def, the materializer would
      bitcast the old type to the new type and the elements of the llvm.used
      array, which already uses bitcast to i8*, would end up with elements
      cascading two bitcasts. RAUW would then indirectly call the
      constantfolder to update the constant to the new ref, which would,
      instead of updating the constant, destroy it to be able to create
      a new constant that folds the two bitcasts into one. The problem is that
      ValueMapper works with pointers to the same constants that may be
      getting destroyed by RAUW. Obviously, RAUW can update references in the
      Module to do not use the old destroyed constant, but it can't update
      ValueMapper's internal pointers to these constants, which are now
      invalid.
      
      The approach here is to move the task of RAUWing old definitions
      outside of the materializer.
      
      Test Plan:
      Added LIT test case, tested clang self-hosting with D56928 and
      verified it works
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D59552
      
      llvm-svn: 356597
      6dc53ccb
    • Alina Sbirlea's avatar
      [NFC] Fix brace indentation. · f69f8073
      Alina Sbirlea authored
      llvm-svn: 356596
      f69f8073
    • Louis Dionne's avatar
    • Robert Lougher's avatar
      Resubmit r356511 "[TailCallElim] Add tailcall elimination pass to LTO pipelines" · f2158a8e
      Robert Lougher authored
      Failing LLD tests have been fixed in r356593.
      
      llvm-svn: 356594
      f2158a8e
    • Robert Lougher's avatar
      [TailCallElim] Update tests for LTO pipeline change · 364cb6b5
      Robert Lougher authored
      D58391 changed the LTO pipelines to add the tailcall elimination pass.
      This caused three LLD tests to fail.
      
      Differential Revision: https://reviews.llvm.org/D59604
      
      llvm-svn: 356593
      364cb6b5
    • Raphael Isemann's avatar
      Remove the unused return value in ASTImporter::Imported [NFC] · 5e3a7698
      Raphael Isemann authored
      Summary:
      `ASTImporter::Imported` currently returns a Decl, but that return value is not used by the ASTImporter (or anywhere else)
      nor is it documented.
      
      Reviewers: balazske, martong, a.sidorin, shafik
      
      Reviewed By: balazske, martong
      
      Subscribers: rnkovacs, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59595
      
      llvm-svn: 356592
      5e3a7698
    • Tim Renouf's avatar
      [AMDGPU] Added MsgPack format PAL metadata · e7bd52f8
      Tim Renouf authored
      Summary:
      PAL metadata now supports both the old linear reg=val pairs format and
      the new MsgPack format.
      
      The MsgPack format uses YAML as its textual representation. On output to
      YAML, a mnemonic name is provided for some hardware registers.
      
      Differential Revision: https://reviews.llvm.org/D57028
      
      Change-Id: I2bbaabaaca4b3574f7e03b80fbef7c7a69d06a94
      llvm-svn: 356591
      e7bd52f8
    • Philip Reames's avatar
      Simplify operands of masked stores and scatters based on demanded elements · e4588bbf
      Philip Reames authored
      If we know we're not storing a lane, we don't need to compute the lane. This could be improved by using the undef element result to further prune the mask, but I want to separate that into its own change since it's relatively likely to expose other problems.
      
      Differential Revision: https://reviews.llvm.org/D57247
      
      llvm-svn: 356590
      e4588bbf
    • Zinovy Nis's avatar
      [clang-tidy] Fix redundant check breaking the test on many platforms. · af881757
      Zinovy Nis authored
      Differential Revision: https://reviews.llvm.org/D57662
      
      llvm-svn: 356589
      af881757
    • Alina Sbirlea's avatar
      [LICM & MemorySSA] Don't sink/hoist stores in the presence of ordered loads. · 5baa72ea
      Alina Sbirlea authored
      Summary:
      Before this patch, if any Use existed in the loop, with a defining
      access in the loop, we conservatively decide to not move the store.
      What this approach was missing, is that ordered loads are not Uses, they're Defs
      in MemorySSA. So, even when the clobbering walker does not find that
      volatile load to interfere, we still cannot hoist a store past a
      volatile load.
      Resolves PR41140.
      
      Reviewers: george.burgess.iv
      
      Subscribers: sanjoy, jlebar, Prazek, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59564
      
      llvm-svn: 356588
      5baa72ea
    • Louis Dionne's avatar
      [libc++][CMake] Clean up some of the libc++ re-exporting logic · 2d0b4d6b
      Louis Dionne authored
      Summary:
      This change allows specifying the version of libc++abi's ABI to re-export
      when configuring CMake. It also clearly identifies which ABI version of
      libc++abi each export file contains.
      
      Finally, it removes hardcoded knowledge about the 10.9 SDK for MacOS,
      since that knowledge is not relevant anymore. Indeed, libc++ can't be
      built with the toolchain that came with the 10.9 SDK anyway because
      the version of Clang it includes is too old (for example if you want
      to build a working libc++.dylib, you need bugfixes to visibility
      attributes that are only in recent Clangs).
      
      Reviewers: dexonsmith, EricWF
      
      Subscribers: mgorny, christof, jkorous, arphaman, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D59489
      
      llvm-svn: 356587
      2d0b4d6b