1. May 16, 2019
    • Xing Xue's avatar
      Fixes for builds that require strict X/Open and POSIX compatiblity · 2dee094a
      Xing Xue authored
      Summary:
      - Use alternative to MAP_ANONYMOUS for allocating mapped memory if it isn't available
      - Use strtok_r instead of strsep as part of getting program path
      - Don't try to find the width of a terminal using "struct winsize" and TIOCGWINSZ on POSIX builds. These aren't defined under POSIX (even though some platforms make them available when they shouldn't), so just check if we are doing a X/Open or POSIX compliant build first.
      
      Author: daltenty
      
      Reviewers: hubert.reinterpretcast, xingxue, andusy
      
      Reviewed By: hubert.reinterpretcast
      
      Subscribers: MaskRay, jsji, hiraditya, kristina, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D61326
      
      llvm-svn: 360898
      2dee094a
    • Alex Bradbury's avatar
      [RISCV][NFC] Add nounwind attribute to functions missing it in test/CodeGen/RISCV · 3966b02c
      Alex Bradbury authored
      This is in preparation for emitting CFI directives.
      
      llvm-svn: 360897
      3966b02c
    • Adhemerval Zanella's avatar
      [clang] Handle lround/llround builtins · 0d9dcd7b
      Adhemerval Zanella authored
      As for other floating-point rounding builtins that can be optimized
      when build with -fno-math-errno, this patch adds support for lround
      and llround.  It currently only optimize for AArch64 backend.
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D61392
      
      llvm-svn: 360896
      0d9dcd7b
    • Xing Xue's avatar
      [tests][go]Add -stdlib=libc++ to build GO test if LLVM is built with libc++ · af8cda15
      Xing Xue authored
      When libc++ is used to build LLVM libraries, these libraries have dependencies on libc++ and C++ STL signatures in these libraries are corresponding to libc++ implementation. Therefore, -stdlib=libc++ is required on the C++ compiler command for building GO tests that link with these LLVM libraries.
      
      Reviewers: hubert.reinterpretcast, sfertile, amyk, EricWF
      
      Reviewed By: sfertile, hubert.reinterpretcast
      
      Subscribers: jsji, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D61900
      
      llvm-svn: 360895
      af8cda15
    • Adhemerval Zanella's avatar
      [AArch64] Handle ISD::LROUND and ISD::LLROUND · 2d28db6b
      Adhemerval Zanella authored
      This patch optimizes ISD::LROUND and ISD::LLROUND to fcvtas
      instruction. It currently only handles the scalar version.
      
      llvm-svn: 360894
      2d28db6b
    • James Henderson's avatar
      [llvm-objdump]Improve testing of some switches #1 · 2e0d0d37
      James Henderson authored
      This is the first in a set of patches I have to improve testing of
      llvm-objdump. This patch targets --all-headers, --section, and
      --full-contents. In the --section case, it deletes a pre-canned binary
      which is only used by the one test and replaces it with yaml.
      
      Reviewed by: grimar, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D61941
      
      llvm-svn: 360893
      2e0d0d37
    • Fangrui Song's avatar
      Recommit [Object] Change object::SectionRef::getContents() to return Expected<StringRef> · e183340c
      Fangrui Song authored
      r360876 didn't fix 2 call sites in clang.
      
      Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now.
      
      Follow-up of D61781.
      
      llvm-svn: 360892
      e183340c
    • Kristof Umann's avatar
      Reland "[analyzer] Add an example plugin for checker dependency handling" · 1b93a24c
      Kristof Umann authored
      Buildbots complained that they couldn't find the newly added plugins.
      
      The solution was to move the check-clang cmake target closer to the bottom of
      the file, after the new dependencies are added.
      
      Differential Revision: https://reviews.llvm.org/D59464
      
      llvm-svn: 360891
      1b93a24c
    • Paul Osmialowski's avatar
      Fix hwloc topology traversal code unable to handle situation where L2 cache is... · 0732fcc7
      Paul Osmialowski authored
      Fix hwloc topology traversal code unable to handle situation where L2 cache is common for the packages
      
      Currently cores within package that share the same L2 cache are grouped together.
      The current logic behind this assumes that the L2 cache is always at deeper
      (or the same) level than the package itself. In case when L2 cache is common
      for all packages (and the packages are at deeper level than L2 cache) the whole of
      the further topology discovery fails to find any computational units resulting in
      following assertion:
      
      Assertion failure at kmp_affinity.cpp(715): nActiveThreads == __kmp_avail_proc.
      OMP: Error #13: Assertion failure at kmp_affinity.cpp(715).
      
      This patch adds a bit of a logic that prevents such situation from occurring.
      
      Differential Revision: https://reviews.llvm.org/D61796
      
      llvm-svn: 360890
      0732fcc7
    • Adhemerval Zanella's avatar
      [CodeGen] Add lround/llround builtins · 73643b50
      Adhemerval Zanella authored
      This patch add the ISD::LROUND and ISD::LLROUND along with new
      intrinsics.  The changes are straightforward as for other
      floating-point rounding functions, with just some adjustments
      required to handle the return value being an interger.
      
      The idea is to optimize lround/llround generation for AArch64
      in a subsequent patch.  Current semantic is just route it to libm
      symbol.
      
      llvm-svn: 360889
      73643b50
    • Matt Arsenault's avatar
      GlobalISel: Add buildFMA to MachineIRBuilder · 2120748f
      Matt Arsenault authored
      llvm-svn: 360888
      2120748f
    • Matt Arsenault's avatar
      RegAllocFast: Improve hinting heuristic · 828b685e
      Matt Arsenault authored
      Trace through multiple COPYs when looking for a physreg source. Add
      hinting for vregs that will be copied into physregs (we only hinted
      for vregs getting copied to a physreg previously).  Give hinted a
      register a bonus when deciding which value to spill.  This is part of
      my rewrite regallocfast series. In fact this one doesn't even have an
      effect unless you also flip the allocation to happen from back to
      front of a basic block. Nonetheless it helps to split this up to ease
      review of D52010
      
      Patch by Matthias Braun
      
      llvm-svn: 360887
      828b685e
    • Clement Courbet's avatar
      [DominatorTree] Print roots unconditionally in `print()`. · 3a0e6e1c
      Clement Courbet authored
      Summary:
      This came up in a debugging session. I was failing to update the root of
      the tree, and got during verification:
      
      ```
      DominatorTree is different than a freshly computed one!
              Current:
      =============================--------------------------------
      Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries.
        [1] %"entry+land.rhs.i" {4294967295,4294967295} [0]
          [2] %opeq1.exit {4294967295,4294967295} [1]
      
              Freshly computed tree:
      =============================--------------------------------
      Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries.
        [1] %"entry+land.rhs.i" {4294967295,4294967295} [0]
          [2] %opeq1.exit {4294967295,4294967295} [1]
      ```
      
      We now print:
      
      ```
      DominatorTree is different than a freshly computed one!
              Current:
      =============================--------------------------------
      Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries.
        [1] %"entry+land.rhs.i" {4294967295,4294967295} [0]
          [2] %opeq1.exit {4294967295,4294967295} [1]
      Roots: <badref>
      
              Freshly computed tree:
      =============================--------------------------------
      Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries.
        [1] %"entry+land.rhs.i" {4294967295,4294967295} [0]
          [2] %opeq1.exit {4294967295,4294967295} [1]
      Roots: %"entry+land.rhs.i"
      ```
      
      Reviewers: kuhar, asbirlea
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D61999
      
      llvm-svn: 360886
      3a0e6e1c
    • Serge Guelton's avatar
      Fix isInSystemMacro in presence of macro and pasted token · ab155469
      Serge Guelton authored
      When a warning is raised from the expansion of a system macro that
      involves pasted token, there was still situations were they were not
      skipped, as showcased by this issue:
      https://bugzilla.redhat.com/show_bug.cgi?id=1472437
      
      Differential Revision: https://reviews.llvm.org/D59413
      
      llvm-svn: 360885
      ab155469
    • Roman Lebedev's avatar
      [NFC] Fixup FileCheck option name in tests added in rL360881 · 62650cf4
      Roman Lebedev authored
      llvm-svn: 360884
      62650cf4
    • Jonas Toth's avatar
      [clang-tidy] Removed superfluous and slightly annoying newlines in run-clang-tidy's output. · f12c9730
      Jonas Toth authored
      Summary: The output of clang-tidy itself already has enough newlines, so the resulting output is more in line with the usual compiler output.
      
      Patch by svenpanne.
      
      Reviewers: alexfh, JonasToth
      
      Reviewed By: JonasToth
      
      Subscribers: JonasToth, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D61850
      
      llvm-svn: 360883
      f12c9730
    • Jonas Toth's avatar
      [clang-tidy] Handle member variables in readability-simplify-boolean-expr · 792dc041
      Jonas Toth authored
      - Add readability-simplify-boolean-expr test cases for member variables
      Fixes PR40179
      
      Patch by LegalizeAdulthood.
      
      Reviewers: alexfh, hokein, aaron.ballman, JonasToth
      
      Reviewed By: JonasToth
      
      Subscribers: jdoerfert, xazax.hun, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D56323
      
      llvm-svn: 360882
      792dc041
    • Roman Lebedev's avatar
      [NFC][CodeGen] Add some more tests for pulling binops through shifts · ec6608d5
      Roman Lebedev authored
      The ashr variant may see relaxation in https://reviews.llvm.org/D61918
      
      llvm-svn: 360881
      ec6608d5
    • Matt Arsenault's avatar
      GlobalISel: Add buildXor/buildNot · d72f25e5
      Matt Arsenault authored
      llvm-svn: 360880
      d72f25e5
    • Matt Arsenault's avatar
      GlobalISel: Add DstOp version of buildIntrinsic · 27ac8408
      Matt Arsenault authored
      llvm-svn: 360879
      27ac8408
    • Hans Wennborg's avatar
      Revert r360876 "[Object] Change object::SectionRef::getContents() to return Expected<StringRef>" · 4da9ff9f
      Hans Wennborg authored
      It broke the Clang build, see llvm-commits thread.
      
      > Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now.
      >
      > Follow-up of D61781.
      
      llvm-svn: 360878
      4da9ff9f
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Correct regbank for 1-bit and/or/xor · a8f88c38
      Matt Arsenault authored
      Bool values should use the scc/vcc regbank since r350611.
      
      llvm-svn: 360877
      a8f88c38
    • Fangrui Song's avatar
      [Object] Change object::SectionRef::getContents() to return Expected<StringRef> · a076ec54
      Fangrui Song authored
      Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now.
      
      Follow-up of D61781.
      
      llvm-svn: 360876
      a076ec54
    • Yvan Roux's avatar
      [lld-link] Add missing "REQUIRES: x86" to COFF/lib-module-asm.ll test. · 671fc5f3
      Yvan Roux authored
      This should fix ARM bots.
      
      llvm-svn: 360875
      671fc5f3
    • Pavel Labath's avatar
      DWARFContext: Return empty data extractors instead of null pointers · 1a8630ac
      Pavel Labath authored
      Summary:
      There are several reasons for doing this:
      - generally, there's no reason to differentiate between a section being
        absent and it being present, but empty
      - it matches more closely what llvm DWARF parser is doing (which also
        doesn't differentiate the two cases)
      - SymbolFileDWARF also doesn't differentiate the two cases, which makes
        porting the rest of sections easier
      - it fixes a bug in how the return-null-if-empty logic was implemented
        (it returned nullptr only the second time we tried to get the
        debug_aranges section), which meant that we hit an assert when trying
        to parse an empty-but-present section
      
      Reviewers: JDevlieghere, clayborg, aprantl
      
      Subscribers: zturner, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D61942
      
      llvm-svn: 360874
      1a8630ac
    • Yvan Roux's avatar
      [crt] Mark dso_handle test as xfailing on ARM. · eff622b2
      Yvan Roux authored
      This is a temporary action to fix the bots.
      
      llvm-svn: 360873
      eff622b2
    • Pavel Labath's avatar
      DWARF: Add ability to reference debug info coming from multiple sections · f4014e11
      Pavel Labath authored
      Summary:
      This patch adds the ability to precisely address debug info in
      situations when a single file can have more than one debug-info-bearing
      sections (as is the case with type units in DWARF v4).
      
      The changes here can be classified into roughly three categories:
      - the code which addresses a debug info by offset gets an additional
        argument, which specifies the section one should look into.
      - the DIERef class also gets an additional member variable specifying
        the section. This way, code dealing with DIERefs can know which
        section is the object referring to.
      - the user_id_t encoding steals one bit from the dwarf_id field to store
        the section. This means the total number of separate object files
        (apple .o, or normal .dwo) is limited to 2 billion, but that is fine
        as it's not possible to hit that number without switching to DWARF64
        anyway.
      
      This patch is functionally equivalent to (and inspired by) the two
      patches (D61503 and D61504) by Jan Kratochvil, but there are differences
      in the implementation:
      - it uses an enum instead of a bool flag to differentiate the sections
      - it increases the size of DIERef struct instead of reducing the amount
        of addressable debug info
      - it sets up DWARFDebugInfo to store the units in a single vector
        instead of two. This sets us up for the future in which type units can
        also live in the debug_info section, and I believe it's cleaner
        because there's no need for unit index remapping
      
      There are no tests with this patch as this is essentially NFC until
      we start parsing type units from the debug_types section.
      
      Reviewers: JDevlieghere, clayborg, aprantl
      
      Subscribers: arphaman, jankratochvil, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D61908
      
      llvm-svn: 360872
      f4014e11
    • Cullen Rhodes's avatar
      [AArch64][SVE2] Asm: implement CMLA/SQRDCMLAH instructions · 472c6ef8
      Cullen Rhodes authored
      Summary:
      This patch adds support for the indexed and unpredicated vectors forms
      of the CMLA and SQRDCMLAH instructions.
      
      The specification can be found here:
      https://developer.arm.com/docs/ddi0602/latest
      
      Reviewed By: SjoerdMeijer
      
      Differential Revision: https://reviews.llvm.org/D61906
      
      llvm-svn: 360871
      472c6ef8
    • Cullen Rhodes's avatar
      [AArch64][SVE2] Asm: implement CDOT instruction · 07eba98d
      Cullen Rhodes authored
      Summary:
      The complex DOT instructions perform a dot-product on quadtuplets from
      two source vectors and the resuling wide real or wide imaginary is
      accumulated into the destination register. The instructions come in two
      forms:
      
      Vector form, e.g.
        cdot z0.s, z1.b, z2.b, #90    - complex dot product on four 8-bit quad-tuplets,
                                        accumulating results in 32-bit elements. The
                                        complex numbers in the second source vector are
                                        rotated by 90 degrees.
      
        cdot z0.d, z1.h, z2.h, #180   - complex dot product on four 16-bit quad-tuplets,
                                        accumulating results in 64-bit elements.
                                        The complex numbers in the second source
                                        vector are rotated by 180 degrees.
      
      Indexed form, e.g.
        cdot z0.s, z1.b, z2.b[3], #0  - complex dot product on four 8-bit quad-tuplets,
                                        with specified quadtuplet from second source vector,
                                        accumulating results in 32-bit elements.
        cdot z0.d, z1.h, z2.h[1], #0  - complex dot product on four 16-bit quad-tuplets,
                                        with specified quadtuplet from second source vector,
                                        accumulating results in 64-bit elements.
      
      The specification can be found here:
      https://developer.arm.com/docs/ddi0602/latest
      
      Reviewed By: SjoerdMeijer, rovka
      
      Differential Revision: https://reviews.llvm.org/D61903
      
      llvm-svn: 360870
      07eba98d
    • Jonas Toth's avatar
      [clang-tidy] Do not list enabled checks when -quiet is given to run-clang-tidy. · 3cbf3c84
      Jonas Toth authored
      Summary: When run-clang-tidy is given the -quiet flag, do not output the potentially hundreds of enabled check names at the beginning.
      
      Patch by svenpanne.
      
      Reviewers: alexfh, JonasToth
      
      Reviewed By: JonasToth
      
      Subscribers: JonasToth, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D61849
      
      llvm-svn: 360869
      3cbf3c84
    • Fangrui Song's avatar
      Simplify Triple::ppc64{,le} checks with Triple::isPPC64() · 2f677ab0
      Fangrui Song authored
      While here, update some ppc64le specific check to isPPC64(), if it
      applies to big-endian as well, in the hope that it will ease the support
      of big-endian if people are interested in this area. The big-endian
      variant is used by at least FreeBSD, Gentoo Linux, Adélie Linux, and
      Void Linux.
      
      llvm-svn: 360868
      2f677ab0
    • Cullen Rhodes's avatar
      [AArch64][SVE2] Asm: add unpredicated integer multiply instructions · 064f6ab5
      Cullen Rhodes authored
      Summary:
      Add support for the following instructions:
      
        * MUL (indexed and unpredicated vectors forms)
        * SQDMULH (indexed and unpredicated vectors forms)
        * SQRDMULH (indexed and unpredicated vectors forms)
        * SMULH (unpredicated, predicated form added in SVE)
        * UMULH (unpredicated, predicated form added in SVE)
        * PMUL (unpredicated)
      
      The specification can be found here:
      https://developer.arm.com/docs/ddi0602/latest
      
      Reviewed By: SjoerdMeijer, rovka
      
      Differential Revision: https://reviews.llvm.org/D61902
      
      llvm-svn: 360867
      064f6ab5
    • Igor Kudrin's avatar
      Add missing "REQUIRES: x86" to the lto/irmover-warning.ll test. · 261a1bc1
      Igor Kudrin authored
      llvm-svn: 360866
      261a1bc1
    • Fangrui Song's avatar
      Simplify ArchSpec::IsMIPS() · ddb93b63
      Fangrui Song authored
      llvm-svn: 360865
      ddb93b63
    • Fangrui Song's avatar
      Add Triple::isPPC64() · 3e92df3e
      Fangrui Song authored
      llvm-svn: 360864
      3e92df3e
    • Karl-Johan Karlsson's avatar
      [builtin] Fixed definitions of builtins that rely on the int/long long type is 32/64 bits · 0e525a4d
      Karl-Johan Karlsson authored
      Summary:
      The definition of the builtins __builtin_bswap32, __builtin_bitreverse32, __builtin_rotateleft32 and __builtin_rotateright32 rely on that the int type is 32 bits wide on the target.
      The defintions of the builtins __builtin_bswap64, __builtin_bitreverse64, __builtin_rotateleft64, and __builtin_rotateright64 rely on that the long long type is 64 bits wide.
      
      On targets where this is not the case (e.g. AVR) clang will generate faulty code (wrong llvm assembler intrinsics).
      
      This patch add support for using 'Z' (the int32_t type) in Bultins.def. The builtins above are changed to be based on the int32_t type instead of the int type, and the int64_t type instead of the long long type.
      
      The AVR backend (experimental) have a native int type that is only 16 bits wide. The supplied testcase will therefore fail if running the testcase on trunk as clang will convert e.g. __builtin_bitreverse32 into llvm.bitreverse.i16 on AVR.
      
      Reviewers: dylanmckay, spatel, rsmith, efriedma
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D61845
      
      llvm-svn: 360863
      0e525a4d
    • Martin Storsjo's avatar
      [PPC] Fix 32-bit build of libunwind · 905af40c
      Martin Storsjo authored
      Clang integrated assembler was unable to build libunwind PPC32 assembly code,
      present in functions used to save/restore register context.
      
      This change consists in replacing the assembly style used in libunwind source,
      to one that is compatible with both Clang integrated assembler as well as
      GNU assembler.
      
      Patch by Leandro Lupori!
      
      Differential Revision: https://reviews.llvm.org/D61792
      
      llvm-svn: 360862
      905af40c
    • Martin Storsjo's avatar
      [PPC64][libunwind] Fix r2 not properly restored · 44266b9e
      Martin Storsjo authored
      This change makes each unwind step inspect the instruction at the
      return address and, if needed, read r2 from its saved location and
      modify the context appropriately.
      
      The unwind logic is able to handle both ELFv1 and ELFv2 stacks.
      
      Reported by Bug 41050
      
      Patch by Leandro Lupori!
      
      Differential Revision: https://reviews.llvm.org/D59694
      
      llvm-svn: 360861
      44266b9e
    • George Rimar's avatar
      [llvm-readobj] - Revert r360676 partially. NFC. · ec895f11
      George Rimar authored
      In the r360676 "Apply clang format. NFC" I applied clang-format
      for whole ELFDumper.cpp. It caused a little discussion,
      one of the points mentioned was that previously nicely lined up
      tables are not so nice now.
      
      This patch reverts them.
      
      llvm-svn: 360860
      ec895f11
    • Clement Courbet's avatar
      Reland r360771 "[MergeICmps] Simplify the code." · c4fdd717
      Clement Courbet authored
      This revision does not seem to be the culprit.
      
      llvm-svn: 360859
      c4fdd717