1. Aug 27, 2018
    • David Carlier's avatar
      [Xray] Darwin - Enable in the driver side · 6e116a5b
      David Carlier authored
      Reviewers: dberris
      
      Reviered By: dberris
      
      Differential Revision: https://reviews.llvm.org/D51269
      
      llvm-svn: 340712
      6e116a5b
    • Zachary Turner's avatar
      [MS Demangler] Add virtual destructor. · 03b6f5a5
      Zachary Turner authored
      Silence -Wnon-virtual-dtor.
      
      llvm-svn: 340711
      03b6f5a5
    • Zachary Turner's avatar
      [MS Demangler] Re-write the Microsoft demangler. · 03312863
      Zachary Turner authored
      This is a pretty large refactor / re-write of the Microsoft
      demangler.  The previous one was a little hackish because it
      evolved as I was learning about all the various edge cases,
      exceptions, etc.  It didn't have a proper AST and so there was
      lots of custom handling of things that should have been much
      more clean.
      
      Taking what was learned from that experience, it's now
      re-written with a completely redesigned and much more sensible
      AST.  It's probably still not perfect, but at least it's
      comprehensible now to someone else who wants to come along
      and make some modifications or read the code.
      
      Incidentally, this fixed a couple of bugs, so I've enabled
      the tests which now pass.
      
      llvm-svn: 340710
      03312863
    • Fangrui Song's avatar
      [Driver] Change MipsLinux default linker from "lld" to "ld.lld" · 15c959a8
      Fangrui Song authored
      Reviewers: kzhuravl, atanasyan
      
      Reviewed By: atanasyan
      
      Subscribers: sdardis, arichardson, jrtc27, atanasyan, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51234
      
      llvm-svn: 340709
      15c959a8
    • Craig Topper's avatar
      [X86] Correct the cost of (v4i32 (fptoui (v4f64))) under AVX512F. · a72012c2
      Craig Topper authored
      Summary: This was inheriting the cost from the AVX table, but should be legal under AVX512.
      
      Reviewers: RKSimon
      
      Reviewed By: RKSimon
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51267
      
      llvm-svn: 340708
      a72012c2
    • Craig Topper's avatar
      [X86] Add FeatureCMOV explicitly to all CPUs that support it. Remove... · 128915f4
      Craig Topper authored
      [X86] Add FeatureCMOV explicitly to all CPUs that support it. Remove FeatureCMOV implication from Feature64Bit and FeatureSSE1
      
      Summary:
      Previously most CPUs inherited cmov support through Feature64Bit(or FeatureCMPXCHG16HB implying Feature64Bit) or FeatureSSE1.
      
      This has the surprising side effect that -mattr=-cmov causes an assert to fire in 64-bit mode because it clears the Feature64Bit. Or in 32-bit mode, -mattr=-cmov disables any sse/avx features which seems surprising.
      
      This patch removes the implication and instead updates hasCMOV in X86Subtarget to check SSE1 or is64Bit in addition to the regular cmov flag. This should keep most things working the way they did before. I don't believe there is a way to specific "-cmov" directly from clang so this should only effect our lower level tools.
      
      This does stop -mattr=cx16(cmpxchg16b) from implying cmov is enabled via the 64bit flag as you can see from one of the changed tests. But that was a 32-bit test so I don't know why it enabled cx16 anyway.
      
      For the other test I had to add -sse to override the new sse check in hasCMOV.
      
      Reviewers: RKSimon, DavidKreitzer, spatel
      
      Reviewed By: RKSimon
      
      Subscribers: llvm-commits, jfb
      
      Differential Revision: https://reviews.llvm.org/D51228
      
      llvm-svn: 340707
      128915f4
    • Craig Topper's avatar
      [X86] Add FeatureCMOV to athlon and athlon-tbird cpus. · b68a78b9
      Craig Topper authored
      Summary: This matches gcc and one cpuid dump I found online. Given that these are considered 7th generation x86 CPU it seems likely they support cmov since cmov was added by Intel in their 6th generation.
      
      Reviewers: RKSimon, spatel
      
      Reviewed By: RKSimon
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51264
      
      llvm-svn: 340706
      b68a78b9
    • Sanjay Patel's avatar
      [SelectionDAG][x86] turn insertelement into undef with variable index into splat · 113cac3b
      Sanjay Patel authored
      I noticed this along with the patterns in D51125, but when the index is variable, 
      we don't convert insertelement into a build_vector.
      
      For x86, that means these get expanded at legalization time into the loading/spilling 
      code that we see in the tests. I think it's always better to avoid going to memory on 
      these, and we get the optimal 'broadcast' if it's available.
      
      I suspect other targets may want to look at enabling the hook. AArch64 and AMDGPU have 
      regression tests that would be affected (although I did not check what would happen in 
      those cases). In the most basic cases shown here, AArch64 would probably do much 
      better with a splat.
      
      Differential Revision: https://reviews.llvm.org/D51186
      
      llvm-svn: 340705
      113cac3b
    • Lang Hames's avatar
      [ORC] Remove a workaround for systems lacking 8-byte atomics. · 5fdb8175
      Lang Hames authored
      SymbolStringPool ref counts are now size_t, rather than uint64_t, so I do not
      think this is necessary any more.
      
      llvm-svn: 340704
      5fdb8175
    • Lang Hames's avatar
      [ORC] Do not include non-global symbols in getObjectSymbolFlags. · 60511582
      Lang Hames authored
      Private symbols are not visible outside the object file, and so not defined by
      the object file from ORC's perspective.
      
      No test case yet. Ideally this would be a unit test parsing a checked-in binary,
      but I am not aware of any way to reference the LLVM source root from a unit
      test.
      
      llvm-svn: 340703
      60511582
  2. Aug 26, 2018
  3. Aug 25, 2018
    • Sanjay Patel's avatar
      [x86] try harder to use broadcast to load a scalar into vector reg · 8a84c747
      Sanjay Patel authored
      This is a preliminary step for a preliminary step for D50992. 
      I noticed that x86 often misses chances to load a scalar directly 
      into a vector register.
      
      So this patch is just allowing more of those cases to match a 
      broadcast op in lowerBuildVectorAsBroadcast(). The old code comment 
      said it doesn't make sense to use a broadcast when we're loading a 
      single element and everything else is undef, but I think that's the 
      best case in the improved tests in insert-loaded-scalar.ll. We avoid 
      scalar-to-vector-register move and/or less efficient shuffling.
      
      Note that there are some existing types that were already producing 
      a broadcast, but that happens semi-accidentally. Ie, it's not 
      happening as part of lowerBuildVectorAsBroadcast(). The build vector 
      gets expanded into load + shuffle, and then shuffle lowering produces 
      the broadcast.
      
      Description of the other test diffs:
      1. avx-basic.ll - replacing load+shufle is a win.
      2. sse3-avx-addsub-2.ll - vmovddup vs. vbroadcastss is neutral
      3. sse41.ll - don't care - we convert that intrinsic to generic IR now, so this test is deprecated
      4. vector-shuffle-128-v8.ll / vector-shuffle-256-v16.ll - pshufb alternatives with an extra instruction are not obviously bad
      
      Differential Revision: https://reviews.llvm.org/D51125
      
      llvm-svn: 340685
      8a84c747
    • Tim Renouf's avatar
      [AMDGPU] Add support for multi-dword s.buffer.load intrinsic · 904343f8
      Tim Renouf authored
      Summary:
      Patch by Marek Olsak and David Stuttard, both of AMD.
      
      This adds a new amdgcn intrinsic supporting s.buffer.load, in particular
      multiple dword variants. These are convenient to use from some front-end
      implementations.
      
      Also modified the existing llvm.SI.load.const intrinsic to common up the
      underlying implementation.
      
      This modification also requires that we can lower to non-uniform loads correctly
      by splitting larger dword variants into sizes supported by the non-uniform
      versions of the load.
      
      V2: Addressed minor review comments.
      V3: i1 glc is now i32 cachepolicy for consistency with buffer and
          tbuffer intrinsics, plus fixed formatting issue.
      V4: Added glc test.
      
      Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51098
      
      Change-Id: I83a6e00681158bb243591a94a51c7baa445f169b
      llvm-svn: 340684
      904343f8
    • Sanjay Patel's avatar
      [InstCombine] add tests for shuffle+binop transform; NFC · 57a0b4ed
      Sanjay Patel authored
      llvm-svn: 340683
      57a0b4ed
    • Simon Pilgrim's avatar
      [X86] Make requested test changes from D50636 · eb6a3cbb
      Simon Pilgrim authored
      The tests were relying on X / X -> 1 and X % X -> 0 combines not happening in the DAG.
      
      llvm-svn: 340682
      eb6a3cbb
    • Jonas Hahnfeld's avatar
      [CUDA/OpenMP] Define only some host macros during device compilation · 931939bf
      Jonas Hahnfeld authored
      When compiling CUDA or OpenMP device code Clang parses header files
      that expect certain predefined macros from the host architecture. To
      make this work the compiler passes the host triple via the -aux-triple
      argument and (until now) pulls in all macros for that "auxiliary triple"
      unconditionally.
      
      However this results in defines like __SSE_MATH__ that will trigger
      inline assembly making use of the "advertised" target features. See
      the discussion of D47849 and PR38464 for a detailed explanation of
      the encountered problems.
      
      Instead of blacklisting "known bad" examples this patch starts adding
      defines that are needed for certain headers like bits/wordsize.h and
      bits/mathinline.h.
      The disadvantage of this approach is that it decouples the definitions
      from their target toolchain. However in my opinion it's more important
      to keep definitions for one header close together. For one this will
      include a clear documentation why these particular defines are needed.
      Furthermore it simplifies maintenance because adding defines for a new
      header or support for a new aux-triple only needs to touch one piece
      of code.
      
      Differential Revision: https://reviews.llvm.org/D50845
      
      llvm-svn: 340681
      931939bf
    • Bjorn Pettersson's avatar
      [CodeGen] Set FrameSetup/FrameDestroy on BUNDLE instructions · 7ded6a90
      Bjorn Pettersson authored
      Summary:
      If any of the bundled instructions are marked as FrameSetup
      or FrameDestroy, then that property is set on the BUNDLE
      instruction as well.
      
      As long as the scheduler/packetizer aren't mixing
      prologue/epilogue instructions (i.e. all the bundled
      instructions have the same property) then this simply gives
      the bundle the correct property (so when using a bundle
      iterator in late passes a bundle will be correctly identified
      as FrameSetup/FrameDestroy).
      
      When for example bundling a mix of FrameSetup instructions
      with non-FrameSetup instructions it could be discussed if
      the bundle should have the property or not. The choice here
      has been to set these properties on the BUNDLE instruction if
      any of the bundled instructions have the property set.
      
      Reviewers: #debug-info, kparzysz
      
      Reviewed By: kparzysz
      
      Subscribers: vsk, thegameg, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50637
      
      llvm-svn: 340680
      7ded6a90
    • Bjorn Pettersson's avatar
      [LiveDebugVariables] Avoid faulty addDefsFromCopies in computeIntervals · 84830047
      Bjorn Pettersson authored
      Summary:
      When computeIntervals is looking through COPY instruction to
      extend the location mapping for a debug variable it did not
      handle subregisters correctly.
      
      For example
          DBG_VALUE debug-use %0.sub_8bit_hi, ...
          %1:gr16 = COPY %0
      was transformed into
          DBG_VALUE debug-use %0.sub_8bit_hi, ...
          %1:gr16 = COPY %0
          DBG_VALUE debug-use %1, ...
      So the subregister index was missing in the added DBG_VALUE.
      
      As long as the subreg refered to the least significant bits
      of the superreg, then I guess we could get the correct
      result in a debugger even when referring to the superreg.
      But as in the example above when the subreg refers to other
      parts of the superreg, then debuginfo would be incorrect.
      
      I'm not sure exactly how to fix this properly, so this patch
      just avoids looking through the COPY when there is a subreg
      involved (for more info, see the FIXME added in the code).
      
      Reviewers: rnk, aprantl
      
      Reviewed By: aprantl
      
      Subscribers: JDevlieghere, llvm-commits
      
      Tags: #debug-info
      
      Differential Revision: https://reviews.llvm.org/D50788
      
      llvm-svn: 340679
      84830047
    • Ana Pazos's avatar
      [MC, RISCV] Fixed StringRef Assertion `Index < Length && "Invalid index!"' · 353f67a7
      Ana Pazos authored
      Summary:
      Handle the case IDVal is an empty string.
      
      This bug was uncovered by a LLVM MC Assembler Protocol Buffer
      Fuzzer  for the RISC-V assembly language.
      
      Reviewers: rnk
      
      Reviewed By: rnk
      
      Subscribers: rnk, niravd, pcc, peter.smith, asb, grosbach, llvm-commits, bcain, kito-cheng, shiva0217, rogfer01, PkmX
      
      Differential Revision: https://reviews.llvm.org/D50808
      
      llvm-svn: 340678
      353f67a7
    • Kuba Mracek's avatar
      [llvm] Document "%T" as deprecated in CommandGuide/lit.rst · a2e0c246
      Kuba Mracek authored
      Differential Revision: https://reviews.llvm.org/D48842
      
      llvm-svn: 340677
      a2e0c246
    • Frederic Riss's avatar
      Disable exceptions for TestDataFormatterLibcxxOptional.py · 314614ad
      Frederic Riss authored
      On macOS, some of the <optional> APIs used by the test are available only
      starting on macOS 10.14 when using exceptions. Build the test with
      -fno-exceptions so that the test builds on older systems too.
      
      rdar://problem/43700544
      
      llvm-svn: 340676
      314614ad
    • Eric Christopher's avatar
      This patch adds support to LLVM for writing HermitCore (https://hermitcore.org) ELF binaries. · 2ab82347
      Eric Christopher authored
      HermitCore is a POSIX-compatible kernel for running a single application in an isolated environment to get maximum performance and predictable runtime behavior. It can either be used bare-metal on hardware or a VM (Unikernel) or side by side to an existing Linux system (Multikernel).
      Due to the latter feature, HermitCore binaries are marked with ELFOSABI_STANDALONE to let the Linux ELF loader distinguish them from regular Unix/Linux binaries and load them using the HermitCore "proxy" tool.
      
      Patch by Colin Finck!
      
      llvm-svn: 340675
      2ab82347
    • Ana Pazos's avatar
      [RISCV] Fixed Assertion`Kind == Immediate && "Invalid type access!"' failed. · ecc65edd
      Ana Pazos authored
      Summary:
      Missing check for isImm() in some Immediate classes.
      
      This bug was uncovered by a LLVM MC Assembler Protocol Buffer Fuzzer
      for the RISC-V assembly language.
      
      Reviewers: hiraditya, asb
      
      Reviewed By: hiraditya, asb
      
      Subscribers: llvm-commits, hiraditya, kito-cheng, shiva0217, rkruppe, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, zzheng, edward-jones, mgrang, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei
      
      Differential Revision: https://reviews.llvm.org/D50797
      
      llvm-svn: 340674
      ecc65edd
    • Adrian Prantl's avatar
      Prevent DILocation::getMergedLocation() from creating invalid metadata. · 4ddd0596
      Adrian Prantl authored
      The function's new implementation from r340583 had a bug in it that
      could cause an invalid scope to be generated when merging two
      DILocations with no common ancestor scope.
      
      This patch detects this situation and picks the scope of the first
      location. This is not perfect, because the scope is misleading, but on
      the other hand, this will be a line 0 location.
      
      rdar://problem/43687474
      
      Differential Revision: https://reviews.llvm.org/D51238
      
      llvm-svn: 340672
      4ddd0596