1. Nov 24, 2016
    • Rui Ueyama's avatar
      Make log(), error() and fatal() thread-safe. · 0ede7f28
      Rui Ueyama authored
      llvm-svn: 287794
      0ede7f28
    • Reid Kleckner's avatar
      Add dllexport default ctor closure PCH regression test for PR31121 · 98c80572
      Reid Kleckner authored
      Follow up to r287774
      
      llvm-svn: 287793
      98c80572
    • Michael Kuperstein's avatar
      [X86] Allow folding of stack reloads when loading a subreg of the spilled reg · 47eb85a0
      Michael Kuperstein authored
      We did not support subregs in InlineSpiller:foldMemoryOperand() because targets
      may not deal with them correctly.
      
      This adds a target hook to let the spiller know that a target can handle
      subregs, and actually enables it for x86 for the case of stack slot reloads.
      This fixes PR30832.
      
      Differential Revision: https://reviews.llvm.org/D26521
      
      llvm-svn: 287792
      47eb85a0
    • Reid Kleckner's avatar
      [asan/win] Skip incremental linker padding during unregistration · 3c3fe5d8
      Reid Kleckner authored
      Should fix issues that came up while testing Win64 ASan.
      
      llvm-svn: 287791
      3c3fe5d8
    • Rui Ueyama's avatar
      Limit default maximum number of errors to 20. · ac95f6bf
      Rui Ueyama authored
      This is in the context of https://llvm.org/bugs/show_bug.cgi?id=31109.
      When LLD prints out errors for relocations, it tends to print out
      extremely large number of errors (like millions) because it would
      print out one error per relocation.
      
      This patch makes LLD bail out if it prints out more than 20 errors.
      You can configure the limitation using -error-limit argument.
      -error-limit=0 means no limit.
      
      I chose the flag name because Clang has the same feature as -ferror-limit.
      "f" doesn't make sense to us, so I omitted it.
      
      Differential Revision: https://reviews.llvm.org/D26981
      
      llvm-svn: 287789
      ac95f6bf
    • Rui Ueyama's avatar
      Re-commit r287727: Use SHA1::hash and MD5::hash functions. · 28590b61
      Rui Ueyama authored
      r287727 was not a change that broke buildbots; the other change
      (r287726) that I made to LLVM broke them.
      
      llvm-svn: 287788
      28590b61
    • Rui Ueyama's avatar
      Define toString() as a generic function to get a string for error message. · 3fc0f7e5
      Rui Ueyama authored
      We have different functions to stringize objects to construct
      error messages. For InputFile, we have getFilename, and for
      InputSection, we have getName. You had to memorize them.
      
      I think this is the case where the function overloading comes in handy.
      
      This patch defines toString() functions that are overloaded for all these
      types, so that you just call it in error().
      
      Differential Revision: https://reviews.llvm.org/D27030
      
      llvm-svn: 287787
      3fc0f7e5
    • Hemant Kulkarni's avatar
      llvm-readobj: Use hash tables to print dynamic symbols. · a6ee9fd6
      Hemant Kulkarni authored
      -symbols prints both .symtab and .dynsym symbols for GNU style in ELF.
      -dyn-symbols prints symbols looking up through hash tables. This helps validate hash tables.
      
      llvm-svn: 287786
      a6ee9fd6
    • Reid Kleckner's avatar
      [asan/win] Check assumptions about the incremental linker more · ff8f2b8f
      Reid Kleckner authored
      Remove a needless cast as well.
      
      llvm-svn: 287785
      ff8f2b8f
    • Chandler Carruth's avatar
      [PM] Change the static object whose address is used to uniquely identify · dab4eae2
      Chandler Carruth authored
      analyses to have a common type which is enforced rather than using
      a char object and a `void *` type when used as an identifier.
      
      This has a number of advantages. First, it at least helps some of the
      confusion raised in Justin Lebar's code review of why `void *` was being
      used everywhere by having a stronger type that connects to documentation
      about this.
      
      However, perhaps more importantly, it addresses a serious issue where
      the alignment of these pointer-like identifiers was unknown. This made
      it hard to use them in pointer-like data structures. We were already
      dodging this in dangerous ways to create the "all analyses" entry. In
      a subsequent patch I attempted to use these with TinyPtrVector and
      things fell apart in a very bad way.
      
      And it isn't just a compile time or type system issue. Worse than that,
      the actual alignment of these pointer-like opaque identifiers wasn't
      guaranteed to be a useful alignment as they were just characters.
      
      This change introduces a type to use as the "key" object whose address
      forms the opaque identifier. This both forces the objects to have proper
      alignment, and provides type checking that we get it right everywhere.
      It also makes the types somewhat less mysterious than `void *`.
      
      We could go one step further and introduce a truly opaque pointer-like
      type to return from the `ID()` static function rather than returning
      `AnalysisKey *`, but that didn't seem to be a clear win so this is just
      the initial change to get to a reliably typed and aligned object serving
      is a key for all the analyses.
      
      Thanks to Richard Smith and Justin Lebar for helping pick plausible
      names and avoid making this refactoring many times. =] And thanks to
      Sean for the super fast review!
      
      While here, I've tried to move away from the "PassID" nomenclature
      entirely as it wasn't really helping and is overloaded with old pass
      manager constructs. Now we have IDs for analyses, and key objects whose
      address can be used as IDs. Where possible and clear I've shortened this
      to just "ID". In a few places I kept "AnalysisID" to make it clear what
      was being identified.
      
      Differential Revision: https://reviews.llvm.org/D27031
      
      llvm-svn: 287783
      dab4eae2
    • Ed Maste's avatar
      lld: Default image base address to 0x200000 on x86-64 · 8fd0196c
      Ed Maste authored
      Align to the large page size (known as a superpage or huge page).
      FreeBSD automatically promotes large, superpage-aligned allocations.
      
      Differential Revision:	https://reviews.llvm.org/D27042
      
      llvm-svn: 287782
      8fd0196c
    • Alina Sbirlea's avatar
      [LoadStoreVectorizer] Enable vectorization of stores in the presence of an aliasing load · a3d2f703
      Alina Sbirlea authored
      Summary:
      The "getVectorizablePrefix" method would give up if it found an aliasing load for a store chain.
      In practice, the aliasing load can be treated as a memory barrier and all stores that precede it
      are a valid vectorizable prefix.
      Issue found by volkan in D26962. Testcase is a pruned version of the one in the original patch.
      
      Reviewers: jlebar, arsenm, tstellarAMD
      
      Subscribers: mzolotukhin, wdng, nhaehnle, anna, volkan, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D27008
      
      llvm-svn: 287781
      a3d2f703
    • Reid Kleckner's avatar
      [asan/win] Fix incremental linking vs. global registration · f174a0bb
      Reid Kleckner authored
      The MSVC incremental linker pads every global out to 256 bytes in case
      it changes size after an incremental link. So, skip over null entries in
      the DSO-wide asan globals array. This only works if the global padding
      size is divisible by the size of the asan global object, so add some
      defensive CHECKs.
      
      llvm-svn: 287780
      f174a0bb
    • Ed Maste's avatar
      Replace test instruction byte strings with {{.*}} · 8d0381d6
      Ed Maste authored
      An upcoming change to the image base address for x86-64 (D27042) will
      will change some addresses and hence the instruction encodings. We care
      about the disassembled instructions, not their encodings.
      
      Differential Revision:	https://reviews.llvm.org/D27056
      
      llvm-svn: 287778
      8d0381d6
    • Alex Lorenz's avatar
      [Sema][Atomics] Treat expected pointer in compare exchange atomics as _Nonnull · 67522158
      Alex Lorenz authored
      This commit teaches clang that is has to emit a warning when NULL is passed
      as the 'expected' pointer parameter into an atomic compare exchange call.
      
      rdar://18926650
      
      Differential Revision: https://reviews.llvm.org/D26978
      
      llvm-svn: 287776
      67522158
    • Ehsan Amiri's avatar
      [PPC] Reverting r287772 · ac10595b
      Ehsan Amiri authored
      Due to buildbot failure, I revert. Will recommit after investigation.
      
      llvm-svn: 287775
      ac10595b
    • Reid Kleckner's avatar
      Remove C++ default arg side table for MS ABI ctor closures · c01ee750
      Reid Kleckner authored
      Summary:
      We don't need a side table in ASTContext to hold CXXDefaultArgExprs. The
      important part of building the CXXDefaultArgExprs was to ODR use the
      default argument expressions, not to make AST nodes. Refactor the code
      to only check the default argument, and remove the side table in
      ASTContext which wasn't being serialized.
      
      Fixes PR31121
      
      Reviewers: thakis, rsmith, majnemer
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D27007
      
      llvm-svn: 287774
      c01ee750
    • Nirav Dave's avatar
      [DAG] Improve loads-from-store forwarding to handle TokenFactor · cf345563
      Nirav Dave authored
      Forward store values to matching loads down through token
      factors. Factored from D14834.
      
      Reviewers: jyknight, hfinkel
      
      Subscribers: hfinkel, nemanjai, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D26080
      
      llvm-svn: 287773
      cf345563
    • Ehsan Amiri's avatar
      [PPC] support for arithmetic builtins in the FE · 5ea1054d
      Ehsan Amiri authored
      This adds various overloads of the following builtins to altivec.h:
      
          vec_neg
          vec_nabs
          vec_adde
          vec_addec
          vec_sube
          vec_subec
          vec_subc
      
      Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
      what ISA describes for instructions like vsubecuq that work on quadwords: the
      first operand is added to the one's complement of the second operand. (As
      opposed to two's complement which I expected).
      
      llvm-svn: 287772
      5ea1054d
    • Alex Lorenz's avatar
      [CodeCompletion] Fix incorrect Objective-C block parameter formatting · 01bcfc14
      Alex Lorenz authored
      This commit fixes an incorrectly formatted Objective-C block parameter
      placeholder in a code completion result. The incorrect parameter had a
      redundant leading parenthesis.
      
      rdar://25224416
      
      llvm-svn: 287771
      01bcfc14
    • Adrian McCarthy's avatar
      Refactor LLDB's Windows process plugin (NFC) · 4ad5def9
      Adrian McCarthy authored
      The Windows process plugin was broken up into multiple pieces a while back in
      order to share code between debugging live processes and minidumps
      (postmortem) debugging. The minidump portion was replaced by a cross-platform
      solution. This left the plugin split into a formerly "common" base classes and
      the derived classes for live debugging. This extra layer made the code harder
      to understand and work with.
      
      This patch simplifies these class hierarchies by rolling the live debugging
      concrete classes up to the base classes. Last week I posted my intent to make
      this change to lldb-dev, and I didn't hear any objections.
      
      This involved moving code and changing references to classes like
      ProcessWindowsLive to ProcessWindows. It still builds for both 32- and 64-bit,
      and the tests still pass on 32-bit. (Tests on 64-bit weren't passing before
      this refactor for unrelated reasons.)
      
      llvm-svn: 287770
      4ad5def9
    • Yichao Yu's avatar
      Fix doc of `llvm.bitreverse.iN` · 5abf14ba
      Yichao Yu authored
      Summary:
      The return type is `iN` rather than always `i16`
      
      Seems to be a typo in https://reviews.llvm.org/rL252878 .
      
      Reviewers: jmolloy
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D27047
      
      llvm-svn: 287769
      5abf14ba
    • Shoaib Meenai's avatar
      [libc++] Remove unneeded visibility pragmas · 43049555
      Shoaib Meenai authored
      The function definitions being guarded by the pragma were all static, so
      they wouldn't be exported anyway. In any case, we should prefer the
      visibility macros. No functional change.
      
      Differential Revision: https://reviews.llvm.org/D26940
      
      llvm-svn: 287768
      43049555
    • Marcin Koscielnicki's avatar
      Revert "[ASan] Enable on SystemZ." · 441dd21d
      Marcin Koscielnicki authored
      This reverts commit r287764.
      
      Two tests broke on the clang-s390x-linux buildbot:
      http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/1293.
      
      llvm-svn: 287767
      441dd21d
    • John Brawn's avatar
      [DAGCombiner] Fix infinite loop in vector mul/shl combining · 150addb4
      John Brawn authored
      We have the following DAGCombiner transformations:
       (mul (shl X, c1), c2) -> (mul X, c2 << c1)
       (mul (shl X, C), Y) -> (shl (mul X, Y), C)
       (shl (mul x, c1), c2) -> (mul x, c1 << c2)
      Usually the constant shift is optimised by SelectionDAG::getNode when it is
      constructed, by SelectionDAG::FoldConstantArithmetic, but when we're dealing
      with vectors and one of those vector constants contains an undef element
      FoldConstantArithmetic does not fold and we enter an infinite loop.
      
      Fix this by making FoldConstantArithmetic use getNode to decide how to fold each
      vector element, the same as FoldConstantVectorArithmetic does, and rather than
      adding the constant shift to the work list instead only apply the transformation
      if it's already been folded into a constant, as if it's not we're going to loop
      endlessly. Additionally add missing NoOpaques to one of those transformations,
      which I noticed when writing the tests for this.
      
      Differential Revision: https://reviews.llvm.org/D26605
      
      llvm-svn: 287766
      150addb4
  2. Nov 23, 2016