1. Nov 06, 2019
    • Julian Lettner's avatar
      Revert "[lit] Better/earlier errors when no tests are executed" · d77ef856
      Julian Lettner authored
      This reverts commit d8f2bff7.
      d77ef856
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] Removed dead code from R600ISelLowering.cpp · f2e7679d
      Stanislav Mekhanoshin authored
      This was added to inhibit a warning from gcc 7.3 according to
      the comment. However, it triggers warning from PVS. In addition
      I cannot reproduce it with gcc 7.4 and I also cannot reproduce
      it with gcc 7.3 using compiler explorer.
      
      Differential Revision: https://reviews.llvm.org/D69863
      f2e7679d
    • Philip Reames's avatar
      [X86/Atomics] (Semantically) revert G246098, switch back to the old atomic example · 027aa27d
      Philip Reames authored
      When writing an email for a follow up proposal, I realized one of the diffs in the committed change was incorrect.  Digging into it revealed that the fix is complicated enough to require some thought, so reverting in the meantime.
      
      The problem is visible in this diff (from the revert):
       ; X64-SSE-LABEL: store_fp128:
       ; X64-SSE:       # %bb.0:
      -; X64-SSE-NEXT:    movaps %xmm0, (%rdi)
      +; X64-SSE-NEXT:    subq $24, %rsp
      +; X64-SSE-NEXT:    .cfi_def_cfa_offset 32
      +; X64-SSE-NEXT:    movaps %xmm0, (%rsp)
      +; X64-SSE-NEXT:    movq (%rsp), %rsi
      +; X64-SSE-NEXT:    movq {{[0-9]+}}(%rsp), %rdx
      +; X64-SSE-NEXT:    callq __sync_lock_test_and_set_16
      +; X64-SSE-NEXT:    addq $24, %rsp
      +; X64-SSE-NEXT:    .cfi_def_cfa_offset 8
       ; X64-SSE-NEXT:    retq
         store atomic fp128 %v, fp128* %fptr unordered, align 16
         ret void
      
      The problem here is three fold:
      1) x86-64 doesn't guarantee atomicity of anything larger than 8 bytes.  Some platforms observably break this guarantee, others don't, but the codegen isn't considering this, so it's wrong on at least some platforms.
      2) When I started to track down the problem, I discovered that DAGCombiner had stripped the atomicity off the store entirely.  This comes down to idiomatic usage of DAG.getStore passing all MMO components separately as opposed to just passing the MMO.
      3) On x86 (not -64), there are cases where 8 byte atomiciy is supported, but only for floating point operations.  This would seem to imply that operation typing matters for correctness, and DAGCombine happily folds away bitcasts.  I'm not 100% sure there's a problem here, but I'm not entirely sure there isn't either.
      
      I plan on returning to each issue in turn;  sorry for the churn here.
      027aa27d
    • Michael Liao's avatar
      [HIP] Fix visibility for 'extern' device variables. · 0a220de9
      Michael Liao authored
      Summary:
      - Fix a bug which misses the change for a variable to be set with
        target-specific attributes.
      
      Reviewers: yaxunl
      
      Subscribers: jvesely, nhaehnle, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D63020
      0a220de9
    • Sid Manning's avatar
      [llvm-objdump] Fix spurious "The end of the file was unexpectedly encountered"... · 6cd47f9d
      Sid Manning authored
      [llvm-objdump] Fix spurious "The end of the file was unexpectedly encountered" if a SHT_NOBITS sh_offset is larger than the file size
      
      llvm-objdump -D this file:
      
        int a[100000];
        int main() { return 0; }
      
      Will produce an error: "The end of the file was unexpectedly encountered".
      
      This happens because of a check in Binary.h checkOffset.  (Addr + Size > M.getBufferEnd()).
      
      The sh_offset and sh_size fields can be ignored for SHT_NOBITS sections.
      Fix the error by changing ELFObjectFile<ELFT>::getSectionContents to use
      the file base for SHT_NOBITS sections.
      
      Reviewed By: grimar, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D69192
      6cd47f9d
    • Joel E. Denny's avatar
      [lit] Fix `not` calling internal commands · f1b4c4bf
      Joel E. Denny authored
      Without this patch, when using lit's internal shell, if `not` on a lit
      RUN line calls `env`, `diff`, or any of the other in-process shell
      builtins that lit implements, lit accidentally searches for the latter
      as an external executable.  What's worse is that works fine when a
      developer is testing on a platform where those executables are
      available and behave as expected, but it then breaks on other
      platforms.
      
      `not` seems useful for some builtins, such as `diff`, so this patch
      supports such uses.  `not --crash` does not seem useful for builtins,
      so this patch diagnoses such uses.  In all cases, this patch ensures
      shell builtins are found behind any sequence of `env` and `not`
      commands.
      
      `not` calling `env` calling an external command appears useful when
      the `env` and external command are part of a lit substitution, as in
      D65156.  This patch supports that by looking through any sequence of
      `env` and `not` commands, building the environment from the `env`s,
      and storing the `not`s.  The `not`s are then added back to the command
      line without the `env`s to execute externally.  This avoids the need
      to replicate the `not` implementation, in particular the `--crash`
      option, in lit.
      
      Reviewed By: rnk
      
      Differential Revision: https://reviews.llvm.org/D66531
      f1b4c4bf
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] Removed dead code handling M0CopyReg · 4f12ba50
      Stanislav Mekhanoshin authored
      Static analyzer complains about always false condition.
      See https://bugs.llvm.org/show_bug.cgi?id=43886
      
      Differential Revision: https://reviews.llvm.org/D69860
      4f12ba50
    • Adrian Prantl's avatar
      3606b567
    • Reid Kleckner's avatar
      [dexter] Fix feature tests on Windows · 63f49465
      Reid Kleckner authored
      First, add LLD as a dependency on Windows. The windows batch scripts
      pass -fuse-ld=lld, so they need it.
      
      Second, decode builder stdout/stderr even if the command fails.
      Otherwise it gets printed as b'line 1\n\rline 2\n\r'.
      
      Last, make the batch script one line less noisy. We might want to try to
      do more here, though. It would be nice if we could get as close to
      possible as lit, where you can literally copy & paste the failing
      command to re-run it.
      
      With the two changes above, now the feature tests that use clang++.bat
      pass for me. The clang-cl_vs2015 ones still fail, and I'll fix them
      separately.
      
      Reviewers: jmorse
      
      Differential Revision: https://reviews.llvm.org/D69725
      63f49465
    • Reid Kleckner's avatar
      [dexter] Remove lit check for python 3 · 7035ea6e
      Reid Kleckner authored
      This is checking the version of Python used to run lit, which is not
      necessarily the same as the version used to run the dexter tests.  If
      the tests are run via the build/bin/llvm-lit[.py] helper script, then
      that is likely to pick up whatever version of Python is on PATH.
      Conventionally, this will find Python 2. CMake already checks that
      Python 3 is in use and puts the path to it in the lit site config, so
      this check is redundant, and Python 3 will ultimately be used to run
      dexter.
      
      Reviewers: jmorse
      
      Differential Revision: https://reviews.llvm.org/D69724
      7035ea6e
    • Benjamin Kramer's avatar
      [X86] Specifically limit fmin/fmax commutativity to NoNaNs + NoSignedZeros · 00e53d91
      Benjamin Kramer authored
      The backend UnsafeFPMath flag is not a superset of all the others, so
      limit it to the exact bits needed.
      00e53d91
    • Daniel Sanders's avatar
      [globalisel] Rename G_GEP to G_PTR_ADD · e74c5b96
      Daniel Sanders authored
      Summary:
      G_GEP is rather poorly named. It's a simple pointer+scalar addition and
      doesn't support any of the complexities of getelementptr. I therefore
      propose that we rename it. There's a G_PTR_MASK so let's follow that
      convention and go with G_PTR_ADD
      
      Reviewers: volkan, aditya_nandakumar, bogner, rovka, arsenm
      
      Subscribers: sdardis, jvesely, wdng, nhaehnle, hiraditya, jrtc27, atanasyan, arphaman, Petar.Avramovic, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69734
      e74c5b96
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] return Fail instead of SolfFail from addOperand() · de56a890
      Stanislav Mekhanoshin authored
      addOperand() method of AMDGPU disassembler returns SoftFail
      on error. All instances which may lead to that place are
      an impossible encdoing, not something which is possible to
      encode, but semantically incorrect as described for SoftFail.
      
      Then tablegen generates a check of the following form:
      
      if (Decode...(..) == MCDisassembler::Fail) { return MCDisassembler::Fail; }
      
      Since we can only return Success and SoftFail that is dead
      code as detected by the static code analyzer.
      
      Solution: return Fail as it should be.
      
      See https://bugs.llvm.org/show_bug.cgi?id=43886
      
      Differential Revision: https://reviews.llvm.org/D69819
      de56a890
    • Ilya Biryukov's avatar
      [clangd] Implement semantic highlightings via findExplicitReferences · 87e0cb4f
      Ilya Biryukov authored
      Summary:
      To keep the logic of finding locations of interesting AST nodes in one
      place.
      
      The advantage is better coverage of various AST nodes, both now and in
      the future: as new nodes get added to `findExplicitReferences`, semantic
      highlighting will automatically pick them up.
      
      The drawback of this change is that we have to traverse declarations
      inside our file twice in order to highlight dependent names, 'auto'
      and 'decltype'. Hopefully, this should not affect the actual latency
      too much, most time should be spent in building the AST and not
      traversing it.
      
      Reviewers: hokein
      
      Reviewed By: hokein
      
      Subscribers: nridge, merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69673
      87e0cb4f
    • Jonas Devlieghere's avatar
      [lldb] Fix Python 3 incompatibility in API/lit.cfg.py · a9970036
      Jonas Devlieghere authored
      This code path is only taken on the sanitized bot, where it caused a
      TypeError: "Can't mix strings and bytes in path components".
      a9970036
    • Michael Liao's avatar
      [hip] Enable pointer argument lowering through coercing type. · 15140e4b
      Michael Liao authored
      Reviewers: tra, rjmccall, yaxunl
      
      Subscribers: jvesely, nhaehnle, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69826
      15140e4b
    • Sergey Dmitriev's avatar
      [SLP] - Add couple safety checks to TreeEntry::dump(). NFC · 82588e05
      Sergey Dmitriev authored
      Summary: Check for MainOp and AltOp for NULL before dereferencing or issue NULL.
      
      Reviewers: Vasilis, dtemirbulatov, RKSimon, ABataev
      
      Reviewed By: ABataev
      
      Subscribers: mehdi_amini, hiraditya, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69812
      82588e05
    • Daniel Sanders's avatar
      [globalisel][docs] Add KnownBits Analysis documentation · 312932a3
      Daniel Sanders authored
      Summary:
      This is largely based off of the slides from the keynote
      
      Depends on D69545
      
      Reviewers: volkan, rovka, arsenm
      
      Subscribers: wdng, arphaman, Petar.Avramovic, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69644
      312932a3
    • Kazu Hirata's avatar
      [JumpThreading] Factor out code to merge basic blocks (NFC) · 893afb9c
      Kazu Hirata authored
      Summary:
      This patch factors out code to merge a basic block with its sole
      successor -- partly for readability and partly to facilitate an
      upcoming patch of my own.
      
      Reviewers: wmi
      
      Subscribers: hiraditya, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69852
      893afb9c
    • Steven Wu's avatar
      Revert "[Object][MachO] Rewrite macho-invalid-fat-arch-size into YAML" · e64f7bfe
      Steven Wu authored
      The invalid binary trying to construct triggers an assertion.
      e64f7bfe
    • Simon Pilgrim's avatar
      Remove redundant assignment. NFCI. · 117e6dd6
      Simon Pilgrim authored
      Fixes cppcheck warning.
      117e6dd6
    • Simon Pilgrim's avatar
      Use iterator prefix increment. NFCI. · 76166a1a
      Simon Pilgrim authored
      76166a1a
    • Simon Pilgrim's avatar
    • Steven Wu's avatar
      [Object][MachO] Rewrite macho-invalid-fat-arch-size into YAML · bc496677
      Steven Wu authored
      Rewrite one of the invalid macho test input file with YAML file. The
      original invalid macho is breaking our internal test infrastusture
      because it is too broken to be copy around.
      
      rdar://problem/56879982
      bc496677
    • Fangrui Song's avatar
      [llvm-objcopy][ELF] Implement --only-keep-debug · 5ad0103d
      Fangrui Song authored
      --only-keep-debug produces a debug file as the output that only
      preserves contents of sections useful for debugging purposes (the
      binutils implementation preserves SHT_NOTE and non-SHF_ALLOC sections),
      by changing their section types to SHT_NOBITS and rewritting file
      offsets.
      
      See https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
      
      The intended use case is:
      
      ```
      llvm-objcopy --only-keep-debug a a.dbg
      llvm-objcopy --strip-debug a b
      llvm-objcopy --add-gnu-debuglink=a.dbg b
      ```
      
      The current layout algorithm is incapable of deleting contents and
      shrinking segments, so it is not suitable for implementing the
      functionality.
      
      This patch adds a new algorithm which assigns sh_offset to sections
      first, then modifies p_offset/p_filesz of program headers. It bears a
      resemblance to lld/ELF/Writer.cpp.
      
      Reviewed By: jhenderson, jakehehrlich
      
      Differential Revision: https://reviews.llvm.org/D67137
      5ad0103d
    • Fangrui Song's avatar
      [llvm-objcopy][ELF] Add OriginalType & OriginalFlags · ade55d07
      Fangrui Song authored
      `llvm::objcopy::elf::*Section::classof` matches Type and Flags, yet Type
      and Flags are mutable (by setSectionFlagsAndTypes and upcoming
      --only-keep-debug feature). Add OriginalType & OriginalFlags to be used
      in classof, to prevent classof results from changing.
      
      Reviewed By: jakehehrlich, jhenderson, alexshap
      
      Differential Revision: https://reviews.llvm.org/D69739
      ade55d07
    • David Green's avatar
      [ARM] Multi-vector MVE spill test · 03bf229b
      David Green authored
      This is a test from D67169, that can now be added after the vld2
      intrinsics were committed upstream.
      03bf229b
    • Michał Górny's avatar
      [lldb] [Python] Build readline override module only on Linux · df3ae1eb
      Michał Górny authored
      Restrict building the readline override to Linux only.  It both does not
      build on *BSD systems, and is largely irrelevant since they default to
      using libedit over readline anyway.  This restores the behavior
      of the old readline override that also was built only on Linux.
      
      Differential Revision: https://reviews.llvm.org/D69846
      df3ae1eb
  2. Nov 05, 2019