1. Jan 30, 2020
    • Jessica Paquette's avatar
      [AArch64][GlobalISel] Fix TBNZ/TBZ opcode selection · 050cd443
      Jessica Paquette authored
      When the bit is <= 32, we have to use the W register variant for TB(N)Z.
      
      This is because of the way the instruction is encoded.
      
      Differential Revision: https://reviews.llvm.org/D73660
      050cd443
    • LLVM GN Syncbot's avatar
      [gn build] Port 24962ced · 363289b5
      LLVM GN Syncbot authored
      363289b5
    • Hiroshi Yamauchi's avatar
      [Loads] Handle simple cases with same base pointer with constant offsets in... · 24962ced
      Hiroshi Yamauchi authored
      [Loads] Handle simple cases with same base pointer with constant offsets in FindAvailableLoadedValue when AA is null.
      
      Summary:
      This will help with devirtualization (store forwarding with vtable pointers in
      the presence of other stores into members in the constructor.) During inlining,
      we don't have AA.
      
      Reviewers: davidxl
      
      Subscribers: mgorny, Prazek, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71307
      24962ced
    • Cameron McInally's avatar
      [NFCI][AArch64][SVE] Set default DestructiveInstType in AArch64Inst class · 00c22499
      Cameron McInally authored
      Some housekeeping for the DestructiveInstType enum before a larger set of patches to support prefixing destructive oeprations with MOVPRFX.
      
      Differential Revision: https://reviews.llvm.org/D73141
      00c22499
    • Victor Huang's avatar
      [PowerPC][Future] Add prefixed loads and stores for future CPU · 1492b70a
      Victor Huang authored
      A previous patch should have added pld and pstd and any support code in
      the backend that is required for prefixed load and store type operations.
      This patch adds a number of additional prefixed load and store type
      instructions for the future CPU.
      
      Differential Revision: https://reviews.llvm.org/D72577
      1492b70a
    • Benjamin Kramer's avatar
      Rewrite test not to rely on StrEq with StringRef · c2b7e4e8
      Benjamin Kramer authored
      StrEq has some magic inside that should do the explicit conversion from
      StringRef to std::string, but apparently this doesn't work with GCC 5.
      
      Just use EXPECT_EQ, it does the same thing with less magic.
      c2b7e4e8
    • Sanjay Patel's avatar
      [InstCombine] add splat binop tests; NFC · 89195638
      Sanjay Patel authored
      89195638
    • Martin Storsjö's avatar
      [libcxx] [Windows] Store the lconv struct returned from localeconv in locale_t · 7db4f2c6
      Martin Storsjö authored
      This fixes using non-default locales, which currently can crash when
      e.g. formatting numbers.
      
      Within the localeconv_l function, the per-thread locale is temporarily
      changed with __libcpp_locale_guard, then localeconv() is called,
      returning an lconv * struct pointer.
      
      When localeconv_l returns, the __libcpp_locale_guard dtor restores
      the per-thread locale back to the original. This invalidates the
      contents of the earlier returned lconv struct, and all C strings
      that are pointed to within it are also invalidated.
      
      Thus, to have an actually working localeconv_l function, the
      function needs to allocate some sort of storage for the returned
      contents, that stays valid for as long as the caller needs to use
      the returned struct.
      
      Extend the libcxx/win32 specific locale_t class with storage for
      a deep copy of a lconv struct, and change localeconv_l to take
      a reference to the locale_t, to allow it to store the returned
      lconv struct there.
      
      This works fine for libcxx itself, but wouldn't necessarily be right
      for a caller that uses libcxx's localeconv_l function.
      
      This fixes around 11 of libcxx's currently failing tests on windows.
      
      Differential Revision: https://reviews.llvm.org/D69505
      7db4f2c6
    • 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