1. Aug 07, 2018
    • Peter Collingbourne's avatar
      MC: Redirect .addrsig directives referring to private (.L) symbols to the section symbol. · 69dd7cd4
      Peter Collingbourne authored
      This matches our behaviour for regular (i.e. relocated) references to
      private symbols and therefore avoids needing to unnecessarily write
      address-significant .L symbols to the object file's symbol table,
      which can interfere with stack traces.
      
      Fixes check-cfi after r339050.
      
      llvm-svn: 339066
      69dd7cd4
    • Matt Arsenault's avatar
      AMDGPU: Treat more custom operations as canonicalizing · d49ab0b2
      Matt Arsenault authored
      Everything should quiet, and I think everything should
      flush.
      
      I assume the min3/med3/max3 follow the same rules
      as regular min/max for flushing, which should at
      least be conservatively correct.
      
      There are still more operations that need to
      be handled.
      
      llvm-svn: 339065
      d49ab0b2
    • Matt Arsenault's avatar
      AMDGPU: Conversions always produce canonical results · ce6d61fb
      Matt Arsenault authored
      Not sure why this was checking for denormals for f16.
      My interpretation of the IEEE standard is conversions
      should produce a canonical result, and the ISA manual
      says denormals are created when appropriate.
      
      llvm-svn: 339064
      ce6d61fb
    • Simon Marchi's avatar
      [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name · ddbabc6b
      Simon Marchi authored
      Summary:
      InMemoryFileSystem::status behaves differently than
      RealFileSystem::status.  The Name contained in the Status returned by
      RealFileSystem::status will be the path as requested by the caller,
      whereas InMemoryFileSystem::status returns the normalized path.
      
      For example, when requested the status for "../src/first.h",
      RealFileSystem returns a Status with "../src/first.h" as the Name.
      InMemoryFileSystem returns "/absolute/path/to/src/first.h".
      
      The reason for this change is that I want to make a unit test in the
      clangd testsuite (where we use an InMemoryFileSystem) to reproduce a
      bug I get with the clangd program (where a RealFileSystem is used).
      This difference in behavior "hides" the bug in the unit test version.
      
      An indirect impact of this change is that a -Wnonportable-include-path
      warning is now emitted in test PCH/case-insensitive-include.c.  This is
      because the real path of the included file (with the wrong case) was not
      available previously, whereas it is now.
      
      Reviewers: malaperle, ilya-biryukov, bkramer
      
      Reviewed By: ilya-biryukov
      
      Subscribers: eric_niebler, malaperle, omtcyfz, hokein, bkramer, ilya-biryukov, ioeric, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D48903
      
      llvm-svn: 339063
      ddbabc6b
    • Philip Reames's avatar
      94b29601
    • Matt Arsenault's avatar
      AMDGPU: Fix implementation of isCanonicalized · f8768bfc
      Matt Arsenault authored
      If denormals are enabled, denormals are canonical.
      Also fix a few other issues. minnum/maxnum are supposed
      to canonicalize. Temporarily improve workaround for the
      instruction behavior change in gfx9.
      
      Handle selects and fcopysign.
      
      The tests were also largely broken, since they were
      checking for a flush used on some targets after the
      store of the result.
      
      llvm-svn: 339061
      f8768bfc
    • Rui Ueyama's avatar
      Add TARGET(foo) linker script directive. · e262bb1a
      Rui Ueyama authored
      GNU ld's manual says that TARGET(foo) is basically an alias for
      `--format foo` where foo is a BFD target name such as elf64-x86-64.
      
      Unlike GNU linkers, lld doesn't allow arbitrary BFD target name for
      --format. We accept only "default", "elf" or "binary". This makes
      situation a bit tricky because we can't simply make TARGET an alias for
      --target.
      
      A quick code search revealed that the usage number of TARGET is very
      small, and the only meaningful usage is to switch to the binary mode.
      Thus, in this patch, we handle only TARGET(elf.*) and TARGET(binary).
      
      Differential Revision: https://reviews.llvm.org/D48153
      
      llvm-svn: 339060
      e262bb1a
    • Reid Kleckner's avatar
      Fix a -Wsign-compare · 5327805d
      Reid Kleckner authored
      llvm-svn: 339059
      5327805d
    • Martin Storsjo's avatar
      [COFF] Treat .xdata/.pdata$<sym> as implicitly associative to <sym> for MinGW · 21858a9b
      Martin Storsjo authored
      MinGW configurations don't use associative comdats, as GNU ld doesn't
      support that. Instead they produce normal comdats named .text$sym,
      .xdata$sym and .pdata$sym.
      
      GNU ld doesn't discard any comdats starting with .xdata or .pdata,
      even if --gc-sections is used (while it does discard other unreferenced
      comdats), regardless of what symbol name is used after the $ separator.
      
      For LLD, treat any such comdat as implicitly associative to the base
      symbol. This requires maintaining a map from symbol name to section
      number, but that is only maintained when the MinGW flag has been
      enabled.
      
      Differential Revision: https://reviews.llvm.org/D49700
      
      llvm-svn: 339058
      21858a9b
    • Philip Reames's avatar
      [LICM] Strengthen invariant.start hoisting tests [NFC] · 9d7bb2f7
      Philip Reames authored
      llvm-svn: 339057
      9d7bb2f7
    • Reid Kleckner's avatar
      [X86] Fix assertion in subreg extraction · 15e91c32
      Reid Kleckner authored
      This assert fires when attempting to extract a subregister from the
      global PIC base register. This virtual register SD node is not in the
      VRBaseMap, so we shouldn't call getVR to look it up there. If this is a
      RegisterSDNode, we should be able to use the virtual register directly.
      
      Fixes PR38385
      
      llvm-svn: 339056
      15e91c32
    • Philip Reames's avatar
      [LICM] Add tests highlighting missing hoists for intrinsics [NFC] · 81c7dc93
      Philip Reames authored
      llvm-svn: 339054
      81c7dc93
    • Vedant Kumar's avatar
      [IRMemoryMap] Avoid redundant zero-init in the Allocation constructor (NFC) · 94523598
      Vedant Kumar authored
      In the lldb-bench/arithmetic benchmark, 1.7% of the total running time
      is spent zero-initializing a std::vector that has already been zeroed.
      
      llvm-svn: 339051
      94523598
    • Peter Collingbourne's avatar
      ELF: Enable address-significance tables during LTO. · 82a7f144
      Peter Collingbourne authored
      This allows safe ICF to work when linking with LTO.
      
      Differential Revision: https://reviews.llvm.org/D50221
      
      llvm-svn: 339050
      82a7f144
    • Martin Storsjo's avatar
      [COFF] Remove a superfluous warning about aligncomm for non-common symbols · 214d6997
      Martin Storsjo authored
      It's not an error if a common symbol (uninitialized data, with alignment
      specified via the aligncomm directive) is replaced with a regular
      one with initialized data (with alignment specified via the section
      chunk).
      
      Differential Revision: https://reviews.llvm.org/D50268
      
      llvm-svn: 339049
      214d6997
    • Martin Storsjo's avatar
      [MinGW] Predefine UNICODE if -municode is specified during compilation · 434ef833
      Martin Storsjo authored
      Differential Revision: https://reviews.llvm.org/D50199
      
      llvm-svn: 339048
      434ef833
    • Sam Clegg's avatar
      [WebAssembly] --export should fetch lazy symbols · cb06300a
      Sam Clegg authored
      --export now implies --undefined
      
      This is really a requirement from emscripten but I think it
      makes sense in general too.
      
      Differential Revision: https://reviews.llvm.org/D50287
      
      llvm-svn: 339047
      cb06300a
    • Evandro Menezes's avatar
      [SLC] Fix shrinking of pow() · 6e137cb9
      Evandro Menezes authored
      Properly shrink `pow()` to `powf()` as a binary function and, when no other
      simplification applies, do not discard it.
      
      Differential revision: https://reviews.llvm.org/D50113
      
      llvm-svn: 339046
      6e137cb9
    • Alexandre Ganea's avatar
      [llvm-pdbutil] Support PDBs without a DBI stream · 741cc353
      Alexandre Ganea authored
      Differential Revision: https://reviews.llvm.org/D50258
      
      llvm-svn: 339045
      741cc353
    • Leonard Chan's avatar
      Fix for broken build on clang-hexagon-elf for ambiguous call to · 7c4f4914
      Leonard Chan authored
      std::abs.
      
      llvm-svn: 339044
      7c4f4914
    • Easwaran Raman's avatar
      [X86] Recognize a splat of negate in isFNEG · 10fd92dd
      Easwaran Raman authored
      Summary:
      Expand isFNEG so that we generate the appropriate F(N)M(ADD|SUB)
      instructions in more cases. For example, the following sequence
      a = _mm256_broadcast_ss(f)
      d = _mm256_fnmadd_ps(a, b, c)
      
      generates an fsub and fma without this patch and an fnma with this
      change.
      
      Reviewers: craig.topper
      
      Subscribers: llvm-commits, davidxl, wmi
      
      Differential Revision: https://reviews.llvm.org/D48467
      
      llvm-svn: 339043
      10fd92dd
    • Fangrui Song's avatar
      [ELF] Don't copy STT_TLS in copy relocation · 96e6ed64
      Fangrui Song authored
      During copy relocation of a variable defined in a DSO, if a TLS variable in that DSO happens to have the same st_value, it would also be copied. This was unnecessary because the addresses of TLS variables are relative to TLS segment. They don't interfere with non-TLS variables.
      
      This copying behavior can be harmful in the following scenario:
      
      For function-scope thread-local variables with non-trivial constructors,
      they have guard variables. In the case of x86_64 general-dynamic model:
      
      template <int N>
      void foo() {
        thread_local std::string a;
      }
      
      GOT[n]   R_X86_64_DTPMOD64 guard variable for a
      GOT[n+1] R_X86_64_DTPOFF64 guard variable for a
      GOT[n+2] R_X86_64_DTPMOD64 a
      GOT[n+3] R_X86_64_DTPOFF64 a
      
      a and its guard variable are both represented as TLS variables, which
      should be within the same module. If one is copy relocated to the main
      module while the other is not, their module ID will mismatch and can
      cause access without prior construction.
      
      Reviewers: ruiu, espindola
      
      Subscribers: emaste, arichardson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50289
      
      llvm-svn: 339042
      96e6ed64
    • Craig Topper's avatar
      [X86] When using "and $0" and "orl $-1" to store 0 and -1 for minsize, make... · 0076477a
      Craig Topper authored
      [X86] When using "and $0" and "orl $-1" to store 0 and -1 for minsize, make sure the store isn't volatile
      
      If the store is volatile this might be a memory mapped IO access. In that case we shouldn't generate a load that didn't exist in the source
      
      Differential Revision: https://reviews.llvm.org/D50270
      
      llvm-svn: 339041
      0076477a
    • Craig Topper's avatar
      [X86] Add test cases to show bad use of "and $0" and "orl $-1" for minsize... · f8a8c746
      Craig Topper authored
      [X86] Add test cases to show bad use of "and $0" and "orl $-1" for minsize when the store is volatile
      
      If the store is volatile we shouldn't be adding a little that didn't exist in the source.
      
      llvm-svn: 339040
      f8a8c746
    • Erich Keane's avatar
      [NFC] Remove TODO comment that no longer applies (ParsedAttr) · ddffcdd0
      Erich Keane authored
      llvm-svn: 339039
      ddffcdd0
    • Leonard Chan's avatar
      Removed the OverflowConversionsToFract tests for now. Will add them back · f0064594
      Leonard Chan authored
      in once I figure out why this doesn't work on windows.
      
      llvm-svn: 339038
      f0064594
    • Leonard Chan's avatar
      Fix for failing test from sanitizer-x86_64-linux-fast where there was a · b30502ef
      Leonard Chan authored
      left shift on a negative value.
      
      llvm-svn: 339037
      b30502ef
    • David Greene's avatar
      Force test/Driver/fuchsia.c(pp) to use lld · e98b9d4c
      David Greene authored
      The Fuchsia driver relies on lld so invoke clang with
      -fuse-ld=lld. This gets the test passing when the clang default linker
      is something other than lld.
      
      Differential Revision: https://reviews.llvm.org/D49899
      
      llvm-svn: 339036
      e98b9d4c
    • Wei Mi's avatar
      [RegisterCoalescer] Delay live interval update work until the rematerialization · 3c1c0885
      Wei Mi authored
      for all the uses from the same def is done.
      
      We run into a compile time problem with flex generated code combined with
      `-fno-jump-tables`. The cause is that machineLICM hoists a lot of invariants
      outside of a big loop, and drastically increases the compile time in global
      register splitting and copy coalescing.  https://reviews.llvm.org/D49353
      relieves the problem in global splitting. This patch is to handle the problem
      in copy coalescing.
      
      About the situation where the problem in copy coalescing happens. After
      machineLICM, we have several defs outside of a big loop with hundreds or
      thousands of uses inside the loop. Rematerialization in copy coalescing
      happens for each use and everytime rematerialization is done, shrinkToUses
      will be called to update the huge live interval. Because we have 'n' uses
      for a def, and each live interval update will have at least 'n' complexity,
      the total update work is n^2.
      
      To fix the problem, we try to do the live interval update work in a collective
      way. If a def has many copylike uses larger than a threshold, each time
      rematerialization is done for one of those uses, we won't do the live interval
      update in time but delay that work until rematerialization for all those uses
      are completed, so we only have to do the live interval update work once.
      
      Delaying the live interval update could potentially change the copy coalescing
      result, so we hope to limit that change to those defs with many
      (like above a hundred) copylike uses, and the cutoff can be adjusted by the
      option -mllvm -late-remat-update-threshold=xxx.
      
      Differential Revision: https://reviews.llvm.org/D49519
      
      llvm-svn: 339035
      3c1c0885
    • Greg Clayton's avatar
      Fix more offsetof issues. · 1508dd8b
      Greg Clayton authored
      llvm-svn: 339034
      1508dd8b
    • Greg Clayton's avatar
      d6836209
    • Greg Clayton's avatar
      Add support for ARM and ARM64 breakpad generated minidump files (version 2). · 19c8f394
      Greg Clayton authored
      In this patch I add support for ARM and ARM64 break pad files. There are two flavors of ARM: Apple where FP is R7, and non Apple where FP is R11. Added minimal tests that load up ARM64 and the two flavors or ARM core files with a single thread and known register values in each register. Each register is checked for the exact value.
      
      This is a fixed version of: https://reviews.llvm.org/D49750
      
      The changes from D49750 are:
      
      Don't init the m_arch in the Initialize call as a system info isn't required. This keeps the thread list, module list and other tests from failing
      Added -Wextended-offsetof to Xcode project so we catch use extended usages of offsetof before submission
      Fixed any extended offset of warnings
      
      Differential Revision: https://reviews.llvm.org/D50336
      
      llvm-svn: 339032
      19c8f394
    • Benjamin Kramer's avatar
      [Fixed Point Arithmetic] Remove unused include. · 3f873eca
      Benjamin Kramer authored
      lib/Basic cannot depend on lib/AST.
      
      llvm-svn: 339031
      3f873eca
    • Bruno Ricci's avatar
      [AST] Remove unnecessary indirections in DeclarationNameTable · b619883c
      Bruno Ricci authored
      DeclarationNameTable currently hold 3 "void *" to
      FoldingSet<CXXSpecialName>, FoldingSet<CXXLiteralOperatorIdName>
      and FoldingSet<CXXDeductionGuideNameExtra>.
      
      CXXSpecialName, CXXLiteralOperatorIdName and
      CXXDeductionGuideNameExtra are private classes holding extra
      information about a "special" declaration name and are in
      AST/DeclarationName.cpp. The original intent seems to have
      been to keep these classes private and only expose
      DeclarationNameExtra and DeclarationName (the code dates from
      2008 and has not been significantly changed since).
      
      However this make the code less straightforward than necessary
      because of the need to have "void *" in DeclarationNameTable
      (with 1 of 3 comments wrong) and to manually allocate/deallocate
      the FoldingSets.
      
      Moreover removing the extra indirections reduce the run-time of
      an fsyntax-only on all of Boost by 2.3% which is not totally
      unexpected given how frequently this data structure is used
      (especially for C++).
      
      A concern raised by erichkeane during the review was that
      including Type.h would increase the compile time unreasonably.
      However test builds (both clean and incremental) showed that
      this patch did not result in any compile time increase.
      
      Reviewed By: erichkeane
      
      Differential Revision: https://reviews.llvm.org/D50261
      
      llvm-svn: 339030
      b619883c
    • Daniil Fukalov's avatar
      Fix typo in the MSVC Visualizer for SmallVector class · 0d3b0f4f
      Daniil Fukalov authored
      llvm-svn: 339029
      0d3b0f4f
    • Leonard Chan's avatar
      [Fixed Point Arithmetic] Fixed Point Constant · a677942d
      Leonard Chan authored
      This patch proposes an abstract type that represents fixed point numbers, similar to APInt or APSInt that was discussed in https://reviews.llvm.org/D48456#inline-425585. This type holds a value, scale, and saturation and is meant to perform intermediate calculations on constant fixed point values.
      
      Currently this class is used as a way for handling the conversions between fixed point numbers with different sizes and radixes. For example, if I'm casting from a signed _Accum to a saturated unsigned short _Accum, I will need to check the value of the signed _Accum to see if it fits into the short _Accum which involves getting and comparing against the max/min values of the short _Accum. The FixedPointNumber class currently handles the radix shifting and extension when converting to a signed _Accum.
      
      Differential Revision: https://reviews.llvm.org/D48661
      
      llvm-svn: 339028
      a677942d
    • Owen Reynolds's avatar
      Fix raw_fd_ostream::write_impl hang due to an infinite loop with large output · a489d111
      Owen Reynolds authored
      On windows when raw_fd_ostream::write_impl calls write, a 32 bit input is required for character count. As a variable with size_t is used for this argument, on x64 integral demotion occurs. In the case of large files an infinite loop follows. 
      See: https://bugs.llvm.org/show_bug.cgi?id=37926
      This fix allows the output of files larger than the previous int32 limit.
      
      Differential Revision: https://reviews.llvm.org/D48948
      
      llvm-svn: 339027
      a489d111
    • Leonard Chan's avatar
      [Fixed Point Arithmetic] Fix for FixedPointValueToString · c03642e9
      Leonard Chan authored
      - Print negative numbers correctly
      - Handle APInts of different sizes
      - Add formal unit tests for FixedPointValueToString
      - Add tests for checking correct printing when padding is set
      - Restrict to printing in radix 10 since that's all we need for now
      
      Differential Revision: https://reviews.llvm.org/D49945
      
      llvm-svn: 339026
      c03642e9
  2. Aug 06, 2018