1. Jan 30, 2020
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Fix tests in release build · d3cea954
      Matt Arsenault authored
      Irritatingly the failure output is different in release vs. debug
      because of the legality check is removed without asserts, so a register
      ends up constrained only in release builds.
      d3cea954
    • Sean Silva's avatar
      Add IntegerAttr::verifyConstructionInvariants. · 9accbd58
      Sean Silva authored
      Summary:
      This will help catch improper use of the MLIR API's. In particular, this
      catches an error that was manifesting as nondeterministic assertion
      failures (the nondeterminism was due to the failure happening only when the
      StorageUniquer's DenseMap's probing happened to compare two specific
      keys).
      
      No test. The fact that all the existing tests pass with this additional
      invariant gives confidence that it is correct/useful.
      
      Differential Revision: https://reviews.llvm.org/D73645
      9accbd58
    • Sterling Augustine's avatar
      Print discriminators when printing .debug_line in GNU style. · c64b5661
      Sterling Augustine authored
      Summary:
      gnu addr2line prints DWARF line table discriminators like so:
      
      <file>:<line> (discriminator <Number>)
      
      This matches that behavior.
      
      Document how and when --output-style=GNU prints discriminators
      
      Add test for new GNU-style discriminator printing.
      
      Reviewers: rupprecht, labath, jhenderson
      
      Subscribers: aprantl, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73318
      c64b5661
    • Shoaib Meenai's avatar
      [build] Fix runtimes build after 2e745ba6 · fa44d72b
      Shoaib Meenai authored
      I missed the NOT in the condition; this part is actually responsible for
      passing LLVM_ENABLE_RUNTIMES to the per-target runtime configures, which
      in turn makes them actually build.
      
      I'll put up a more general solution for review, but restore this in the
      meantime to fix the runtimes build.
      fa44d72b
    • Nikita Popov's avatar
      [InstCombine] Support non-splat vectors in icmp eq + add/sub fold · e086e230
      Nikita Popov authored
      For the
      
          icmp eq (add X, C1), C2 => icmp eq X, C2-C1
          icmp eq (sub C1, X), C2 => icmp eq X, C1-C2
      
      folds, this allows C1 to be non-splat and contain undefs.
      C2 is still splat, due to the structure of the code.
      
      This is to address the remaining part of the regression in D73411,
      where demanded element analysis replaces some elements with undef.
      
      Differential Revision: https://reviews.llvm.org/D73647
      e086e230
    • Nikita Popov's avatar
    • Amara Emerson's avatar
      [GlobalISel][IRTranslator] Follow convention and put constant offset of... · 0da937bb
      Amara Emerson authored
      [GlobalISel][IRTranslator] Follow convention and put constant offset of getelementptr arithmetic on RHS.
      
      We were needlessly putting known constant values on the LHS of a G_MUL, which
      is suboptimal.
      
      Differential Revision: https://reviews.llvm.org/D73650
      0da937bb
    • Nico Weber's avatar
      b998d481
    • Nico Weber's avatar
      attempt to fix symbolize-paths.s on windows · cd68f4be
      Nico Weber authored
      cd68f4be
    • Huihui Zhang's avatar
      Revert "[AArch64] Fix data race on RegisterBank initialization." · 8f6761aa
      Huihui Zhang authored
      Buildbot failure, revert first while looking at the issue.
      
      This reverts commit a5a4a47d.
      8f6761aa
    • Huihui Zhang's avatar
      Revert "[AMDGPU] Fix data race on RegisterBank initialization." · af620fc3
      Huihui Zhang authored
      There looks to be buildbot failure related.
      
      This reverts commit 8bb6c8a2.
      af620fc3
    • Huihui Zhang's avatar
      Revert "[ARM] Fix data race on RegisterBank initialization." · 2ec95457
      Huihui Zhang authored
      There looks to be buildbot failure related.
      
      This reverts commit 91618d94.
      2ec95457
    • Fangrui Song's avatar
      [AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects · 8903e61b
      Fangrui Song authored
      For `MC_GlobalAddress` operands referencing **certain** GlobalObjects,
      we can lower them to STB_LOCAL aliases to avoid costs brought by
      assembler/linker's conservative decisions about symbol interposition:
      
      * An assembler conservatively assumes a global default visibility symbol interposable (ELF
        semantics). So relocations in object files are needed even if the code generator assumed
        the definition exact and non-interposable.
      * The relocations can cause the creation of PLT entries on some targets for -shared links.
        A linker conservatively assumes a global default visibility symbol interposable (if not
        otherwise constrained by -Bsymbolic/--dynamic-list/VER_NDX_LOCAL/etc).
      
      "certain" refers to GlobalObjects in the intersection of
      `hasExactDefinition() and !isInterposable()`: `external`, `appending`, `internal`, `private`.
      Local linkages (`internal` and `private`) cannot be interposed. `appending` is for very
      few objects LLVM interpret specially.  So the set just includes `external`.
      
      This patch emits STB_LOCAL aliases (.Lfoo$local) for such GlobalObjects, so that targets can lower
      MC_GlobalAddress operands to STB_LOCAL aliases if applicable.
      We may extend the scope and include GlobalAlias in the future.
      
      LLVM's existing -fno-semantic-interposition behaviors give us license to do such optimizations:
      
      * Various optimizations (ipconstprop, inliner, sccp, sroa, etc) treat normal ExternalLinkage
        GlobalObjects as non-interposable.
      * Before D72197, MC resolved a PC-relative VK_None fixup to a non-local symbol at assembly time (no
        outstanding relocation), if the target is defined in the same section. Put it simply, even if IR
        optimizations failed to optimize and allowed interposition for the function call in
        `void foo() {} void bar() { foo(); }`, the assembler would disallow it.
      
      This patch sets up AsmPrinter infrastructure to make -fno-semantic-interposition more so.
      With and without the patch, the object file output should be identical:
      `.Lfoo$local` does not take a symbol table entry.
      
      Reviewed By: sfertile
      
      Differential Revision: https://reviews.llvm.org/D73228
      8903e61b
    • Sterling Augustine's avatar
      Handle non-absolute include dirs properly for both dwarf4 and dwarf5. · 0758ac4e
      Sterling Augustine authored
      Summary:
      Add test case for the same. This test case will also serve as a
      starting point for later symbolizer tests.
      
      Reviewers: dblaikie, jdoerfert
      
      Subscribers: hiraditya, llvm-commits, jhenderson
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73583
      0758ac4e
    • Simon Pilgrim's avatar
      [DAGCombiner] ISD::SHL/SRA/SRL - use general SelectionDAG::FoldConstantArithmetic · f7245ef8
      Simon Pilgrim authored
      This handles all the constant splat / opaque testing for us.
      f7245ef8
    • Huihui Zhang's avatar
      [ConstantFold][SVE] Fix constant folding for scalable vector binary operations. · d2e2fc45
      Huihui Zhang authored
      Summary:
      Scalable vector should not be evaluated element by element.
      Add support to handle scalable vector UndefValue.
      
      Reviewers: sdesmalen, huntergr, spatel, lebedev.ri, apazos, efriedma, willlovett
      
      Reviewed By: efriedma
      
      Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71445
      d2e2fc45
    • Sam McCall's avatar
      [clangd] Don't mmap source files on all platforms --> don't crash on git checkout · b500c49c
      Sam McCall authored
      Summary:
      Previously we mmapped on unix and not on windows: on windows mmap takes
      an exclusive lock on the file and prevents the user saving changes!
      
      The failure mode on linux is a bit more subtle: if the file is changed on disk
      but the SourceManager sticks around, then subsequent operations on the
      SourceManager will fail as invariants are violated (e.g. null-termination).
      
      This commonly manifests as crashes after switching git branches with many files
      open in clangd.
      
      Nominally mmap is for performance here, and we should be willing to give some
      up to stop crashing. Measurements on my system (linux+desktop+SSD) at least
      show no measurable regression on an a fairly IO-heavy workload: drop disk caches,
      open SemaOverload.cpp, wait for first diagnostics.
      
      for i in `seq 100`; do
        for variant in mmap volatile; do
          echo 3 | sudo tee /proc/sys/vm/drop_caches
          /usr/bin/time --append --quiet -o ~/timings -f "%C %E" \
          bin/clangd.$variant -sync -background-index=0 < /tmp/mirror > /dev/null
        done
      done
      
      bin/clangd.mmap -sync -background-index=0 0:07.60
      bin/clangd.volatile -sync -background-index=0 0:07.89
      bin/clangd.mmap -sync -background-index=0 0:07.44
      bin/clangd.volatile -sync -background-index=0 0:07.89
      bin/clangd.mmap -sync -background-index=0 0:07.42
      bin/clangd.volatile -sync -background-index=0 0:07.50
      bin/clangd.mmap -sync -background-index=0 0:07.90
      bin/clangd.volatile -sync -background-index=0 0:07.53
      bin/clangd.mmap -sync -background-index=0 0:07.64
      bin/clangd.volatile -sync -background-index=0 0:07.55
      bin/clangd.mmap -sync -background-index=0 0:07.75
      bin/clangd.volatile -sync -background-index=0 0:07.47
      bin/clangd.mmap -sync -background-index=0 0:07.90
      bin/clangd.volatile -sync -background-index=0 0:07.50
      bin/clangd.mmap -sync -background-index=0 0:07.81
      bin/clangd.volatile -sync -background-index=0 0:07.95
      bin/clangd.mmap -sync -background-index=0 0:07.55
      bin/clangd.volatile -sync -background-index=0 0:07.65
      bin/clangd.mmap -sync -background-index=0 0:08.15
      bin/clangd.volatile -sync -background-index=0 0:07.54
      bin/clangd.mmap -sync -background-index=0 0:07.78
      bin/clangd.volatile -sync -background-index=0 0:07.61
      bin/clangd.mmap -sync -background-index=0 0:07.78
      bin/clangd.volatile -sync -background-index=0 0:07.55
      bin/clangd.mmap -sync -background-index=0 0:07.41
      bin/clangd.volatile -sync -background-index=0 0:07.40
      bin/clangd.mmap -sync -background-index=0 0:07.54
      bin/clangd.volatile -sync -background-index=0 0:07.42
      bin/clangd.mmap -sync -background-index=0 0:07.45
      bin/clangd.volatile -sync -background-index=0 0:07.49
      bin/clangd.mmap -sync -background-index=0 0:07.95
      bin/clangd.volatile -sync -background-index=0 0:07.66
      bin/clangd.mmap -sync -background-index=0 0:08.04
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D73617
      b500c49c
    • Austin Kerbow's avatar
      [AMDGPU][GlobalISel] Select 8-byte LDS Ops with 4-byte alignment · 2605adb6
      Austin Kerbow authored
      Reviewers: arsenm
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73585
      2605adb6
    • Jonas Devlieghere's avatar
      [lldb/Host] Fix implicit StringRef to std::string conversion · ce07cdea
      Jonas Devlieghere authored
      lldb\source\Host\windows\Host.cpp(228): error C2440: 'initializing':
      cannot convert from 'llvm::StringRef' to
      'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'
      ce07cdea
    • Adrian Prantl's avatar
      Run clang-format on DwarfExpression (NFC) · 18dbe1b2
      Adrian Prantl authored
      18dbe1b2
    • Adrian Prantl's avatar
      816ee8a4
    • Jonas Devlieghere's avatar
      [SmallString] Add explicit conversion to std::string · d7049213
      Jonas Devlieghere authored
      With the conversion between StringRef and std::string now being
      explicit, converting SmallStrings becomes more tedious. This patch adds
      an explicit operator so you can write std::string(Str) instead of
      Str.str().str().
      
      Differential revision: https://reviews.llvm.org/D73640
      d7049213
    • Huihui Zhang's avatar
      [ARM] Fix data race on RegisterBank initialization. · 91618d94
      Huihui Zhang authored
      Summary:
      The initialization of RegisterBank needs to be done only once. The
      logic of AlreadyInit has data race, use llvm::call_once instead.
      
      This is continuing work of D73587.
      
      Reviewers: arsenm, rovka, dsanders, t.p.northover, efriedma, apazos
      
      Reviewed By: arsenm
      
      Subscribers: wdng, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73605
      91618d94
    • Huihui Zhang's avatar
      [AMDGPU] Fix data race on RegisterBank initialization. · 8bb6c8a2
      Huihui Zhang authored
      Summary:
      The initialization of RegisterBank needs to be done only once. The
      logic of AlreadyInit has data race, use llvm::call_once instead.
      
      This is continuing work of D73587.
      
      Reviewers: arsenm, tstellar, ronlieb, efriedma, apazos, nhaehnle
      
      Reviewed By: nhaehnle
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73604
      8bb6c8a2
    • Huihui Zhang's avatar
      [AArch64] Fix data race on RegisterBank initialization. · a5a4a47d
      Huihui Zhang authored
      Summary:
      The initialization of RegisterBank needs to be done only once. The
      logic of AlreadyInit has a data race, use llvm::call_once instead.
      
      This issue was identified through thread sanitizer.
      
      Reviewers: efriedma, apazos, qcolombet, dsanders
      
      Reviewed By: efriedma
      
      Subscribers: arsenm, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73587
      a5a4a47d
    • Eric Fiselier's avatar
      [libcxx] Add a std::string_view pretty printer for libcxx. · b4c911ec
      Eric Fiselier authored
      This adds a std::string_view pretty printer for libcxx and updates the gdb
      pretty printer test.
      
      Patch by Ali Tamur (tamur@google.com)
      Reviewed as https://reviews.llvm.org/D73514
      b4c911ec
    • Adrian Prantl's avatar
      Add dwarfdump support for DW_OP_regval_type. · aa6ec19c
      Adrian Prantl authored
      Differential Revision: https://reviews.llvm.org/D73598
      aa6ec19c
    • Fangrui Song's avatar
      [ELF] Mention symbol name in reportRangeError() · 4a4ce14e
      Fangrui Song authored
      For an out-of-range relocation referencing a non-local symbol, report the symbol name and the object file that defines the symbol. As an example:
      ```
      t.o:(function func: .text.func+0x3): relocation R_X86_64_32S out of range: -281474974609120 is not in [-2147483648, 2147483647]
      ```
      =>
      ```
      t.o:(function func: .text.func+0x3): relocation R_X86_64_32S out of range: -281474974609120 is not in [-2147483648, 2147483647]; references func
      >>> defined in t1.o
      ```
      
      Reviewed By: grimar
      
      Differential Revision: https://reviews.llvm.org/D73518
      4a4ce14e
    • Simon Pilgrim's avatar
      [DAGCombiner] ISD::MUL - use general SelectionDAG::FoldConstantArithmetic · 25b8e963
      Simon Pilgrim authored
      This handles all the constant splat / opaque testing for us.
      25b8e963
    • Simon Pilgrim's avatar
    • Nikita Popov's avatar
      [InstCombine] Regenerate test checks; NFC · 6a74641e
      Nikita Popov authored
      6a74641e
    • Bjorn Pettersson's avatar
      [scudo] Skip building scudo standalone if sys/auxv.h can't be found · f4ca2ac8
      Bjorn Pettersson authored
      Summary:
      Since commit c299d198 scudo
      standalone can't be built without including sys/auxv.h.
      I do not have that file on my system, and my builds have failed
      when trying to simply build "all" runtimes. Assuming that "all"
      means "all possible given the current environment" we need to
      guard the setting of COMPILER_RT_HAS_SCUDO_STANDALONE=TRUE by
      first checking if sys/auxv.h can be found.
      
      Reviewers: pcc, cryptoad
      
      Reviewed By: pcc
      
      Subscribers: mgorny, #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D73631
      f4ca2ac8
    • Jonas Devlieghere's avatar
      [lldb/Reproducers] Add logging to the string template specialization · 33fa6727
      Jonas Devlieghere authored
      Only the templated function had logging for deserialization. The string
      deserializer is implemented as a specialization and now prints to the
      log as well.
      33fa6727
    • Craig Topper's avatar
      [X86] Custom lower ISD::FROUND with SSE4.1 to avoid a libcall. · 90c31b0f
      Craig Topper authored
      ISD::FROUND is defined to round to nearest with ties rounding
      away from 0. This mode isn't supported in hardware on X86.
      
      But as long as we aren't compiling with trapping math, we can
      emulate this with floor(X + copysign(nextafter(0.5, 0.0), X)).
      
      We have to use nextafter to avoid some corner cases that adding
      0.5 would have. For example, if X is nextafter(0.5, 0.0) it should
      round to 0.0, but adding 0.5 would need one extra bit of mantissa
      than can be stored so it rounds to 1.0. Adding nextafter(0.5, 0.0)
      instead will just increase the exponent by 1 and leave the mantissa
      as all 1s. This would be nextafter(1.0, 0.0) which will floor to 0.0.
      
      Techically this requires -fno-trapping-math which isn't our default.
      But if we care about exceptions we should be using constrained
      intrinsics. Constrained intrinsics would use STRICT_FROUND which
      won't go through this code.
      
      Fixes PR42195.
      
      Differential Revision: https://reviews.llvm.org/D73607
      90c31b0f
    • Francesco Petrogalli's avatar
      [llvm][docs] LangRef for IR attribute `vector-function-abi-variant`. · 4bc07c33
      Francesco Petrogalli authored
      Reviewers: jdoerfert, andwar, simoll, rengolin, hfinkel, xtian
      
      Reviewed By: jdoerfert
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72798
      4bc07c33
    • Jay Foad's avatar
      [AMDGPU] Cluster FLAT instructions with both vaddr and saddr · d07a7895
      Jay Foad authored
      Reviewers: rampitec, arsenm
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73634
      d07a7895
    • Sergey Dmitriev's avatar
      [Clang][Bundler] Add 'exclude' flag to target objects sections · 6e82d0df
      Sergey Dmitriev authored
      Summary: This flag tells link editor to exclude section from linker inputs when linking executable or shared library.
      
      Reviewers: ABataev, alexshap, jdoerfert
      
      Reviewed By: ABataev
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D73408
      6e82d0df
    • Simon Pilgrim's avatar
      [DAGCombiner] Sub/SUBSAT - use general SelectionDAG::FoldConstantArithmetic · 4b04e117
      Simon Pilgrim authored
      This handles all the constant splat / opaque testing for us.
      4b04e117
    • Simon Pilgrim's avatar
      [DAGCombiner] visitIMINMAX - use general SelectionDAG::FoldConstantArithmetic · 48bd6a09
      Simon Pilgrim authored
      This handles all the constant splat / opaque testing for us instead of the ConstantSDNode variant where we have to do it ourselves.
      48bd6a09
    • Craig Topper's avatar
      [X86] Use a shorter sequence to implement FLT_ROUNDS · e5edd641
      Craig Topper authored
      This code needs to map from the FPCW 2-bit encoding for rounding mode to the 2-bit encoding defined for FLT_ROUNDS. The previous implementation did some clever swapping of bits and adding 1 modulo 4 to do the mapping.
      
      This patch instead uses an 8-bit immediate as a lookup table of four 2-bit values. Then we use the 2-bit FPCW encoding to index the lookup table by using a right shift and an AND. This requires extracting the 2-bit value from FPCW and multipying it by 2 to make it usable as a shift amount. But still results in less code.
      
      Differential Revision: https://reviews.llvm.org/D73599
      e5edd641