1. Oct 24, 2019
    • Simon Tatham's avatar
      [ARM] Add some sample IR MVE intrinsics with C++ isel. · ceeff95c
      Simon Tatham authored
      This adds some initial example IR intrinsics for MVE instructions that
      deliver multiple output values, and hence, have to be instruction-
      selected by custom C++ code instead of Tablegen patterns.
      
      I've added the writeback gather load instructions (taking a vector of
      base addresses and a single common offset, returning a vector of
      loaded values and an updated vector of base addresses); one example
      from the long shift family (taking and returning a 64-bit value in two
      GPRs); and the VADC instruction (which propagates a carry bit from
      each vector-lane addition to the next, taking an input carry flag in
      FPSCR and outputting the final one in FPSCR as well).
      
      To support the VPT-predicated forms of these instructions, I've
      written some helper functions to add the cluster of MVE predicate
      operands to the end of a MachineInstr. `AddMVEPredicateToOps` is used
      when the instruction actually is predicated (so it takes a predicate
      mask argument), and `AddEmptyMVEPredicateToOps` is for when the
      instruction is unpredicated (so it fills in $noreg for the mask). Each
      one comes in a form suitable for `vpred_n`, and one for `vpred_r`
      which takes the extra 'inactive' parameter.
      
      For VADC, the representation of the carry flag in the IR intrinsic is
      a word intended to be moved directly to and from `FPSCR_nzcvqc`, i.e.
      with the carry flag in bit 29 of the word. (The user-facing ACLE
      intrinsic will want it to be in bit 0, but I'll do that on the clang
      side.)
      
      Reviewers: dmgreen, miyuki, ostannard
      
      Subscribers: kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68699
      ceeff95c
    • Simon Tatham's avatar
      [ARM] Begin adding IR intrinsics for MVE instructions. · 1b45297e
      Simon Tatham authored
      This commit, together with the next few, will add a representative
      sample of the kind of IR intrinsics that we'll need in order to
      implement the user-facing ACLE intrinsics for MVE. Supporting all of
      them will take more work; the intention of this initial series of
      commits is to implement an intrinsic or two from lots of different
      categories, as examples and proofs of concept.
      
      This initial commit introduces a small number of IR intrinsics for
      instructions simple enough that they can use Tablegen ISel patterns:
      the predicated versions of the VADD and VSUB instructions (both
      integer and FP), VMIN and VMAX, and the float->half VCVT instruction
      (predicated and unpredicated).
      
      When using VPT-predicated instructions in automatic code generation,
      it will be convenient to specify the predicate value as a vector of
      the appropriate number of i1. To make it easy to specify all sizes of
      an instruction in one go and give each one the matching predicate
      vector type, I've added a system of Tablegen informational records
      describing MVE's vector types: each one gives the underlying LLVM IR
      ValueType (which may not be the same if the MVE vector is of
      explicitly signed or unsigned integers) and an appropriate vNi1 to use
      as the predicate vector.
      
      (Also, those info records include the usual encoding for the types, so
      that as we add associations between each instruction encoding and one
      of the new `MVEVectorVTInfo` records, we can remove some of the
      existing template parameters and replace them with references to the
      vector type info's fields.)
      
      The user-facing ACLE intrinsics will receive a predicate mask as a
      16-bit integer, so I've also provided a pair of intrinsics i2v and
      v2i, to convert between an integer and a vector of i1 by just changing
      the register class.
      
      Reviewers: dmgreen, miyuki, ostannard
      
      Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D67158
      1b45297e
    • Michael Liao's avatar
      [AMDGPU] Skip additional folding on the same operand. · b2a65f0d
      Michael Liao authored
      Reviewers: rampitec, arsenm
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69355
      b2a65f0d
    • Michael Liao's avatar
      950b800c
    • Ilya Biryukov's avatar
    • Simon Atanasyan's avatar
      [docs] Add Mips as a supported architecture in GettingStarted.rst · fd77e578
      Simon Atanasyan authored
      Patch by Miloš Stojanović
      
      Differential Revision: https://reviews.llvm.org/D69380
      fd77e578
    • Simon Atanasyan's avatar
      [docs] Update link to the MIPS 64-bit ELF object file specification · c84cfaf9
      Simon Atanasyan authored
      Patch by Miloš Stojanović
      
      Differential Revision: https://reviews.llvm.org/D69377
      c84cfaf9
    • Petar Avramovic's avatar
      [MIPS GlobalISel] Select MSA vector generic and builtin fabs · e3b49df5
      Petar Avramovic authored
      selectImpl is able to select G_FABS when we set bank for vector
      operands to fprb. Add detailed tests.
      Note: G_FABS is generated from llvm-ir intrinsics llvm.fabs.*,
      and at the moment MIPS is not able to generate this intrinsic for
      vector type (some targets generate vector llvm.fabs.* from calls
      to a builtin function).
      We can handle fabs using __builtin_msa_fmax_a_<format> and passing
      same vector as both arguments. __builtin_msa_fmax_a_<format> will
      be directly selected into FMAX_A_<format> in legalizeIntrinsic.
      
      Differential Revision: https://reviews.llvm.org/D69346
      e3b49df5
    • evgeny's avatar
      Don't add -fsplit-lto-unit for thin LTO builds with PS4 and Darwin toolchains · 1ae8e8d2
      evgeny authored
      These toolchains use legacy thin LTO API, which is not capable of unit splitting
      Differential revision: https://reviews.llvm.org/D69173
      1ae8e8d2
    • David Tellenbach's avatar
      [compiler-rt] Expose __hwasan_tag_mismatch_stub · 6d11abfe
      David Tellenbach authored
      Summary:
      GCC would like to emit a function call to report a tag mismatch
      rather than hard-code the `brk` instruction directly.
      
      __hwasan_tag_mismatch_stub contains most of the functionality to do
      this already, but requires exposure in the dynamic library.
      
      This patch moves __hwasan_tag_mismatch_stub outside of the anonymous
      namespace that it was defined in and declares it in
      hwasan_interface_internal.h.
      
      We also add the ability to pass sizes larger than 16 bytes to this
      reporting function by providing a fourth parameter that is only looked
      at when the size provided is not in the original accepted range.
      
      This does not change the behaviour where it is already being called,
      since the previous definition only accepted sizes up to 16 bytes and
      hence the change in behaviour is not seen by existing users.
      The change in declaration does not matter, since the only existing use
      is in the __hwasan_tag_mismatch function written in assembly.
      
      Reviewers: eugenis, kcc, pcc, #sanitizers
      
      Reviewed By: eugenis, #sanitizers
      
      Subscribers: kristof.beyls, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D69113
      
      Patch by Matthew Malcomson <matthew.malcomson@arm.com>
      6d11abfe
    • David Tellenbach's avatar
      Revert "Expose __hwasan_tag_mismatch_stub" · 93aec861
      David Tellenbach authored
      Attribution to author of patch got lost.
      
      This reverts commit 612eadb7.
      93aec861
    • David Tellenbach's avatar
      Expose __hwasan_tag_mismatch_stub · 612eadb7
      David Tellenbach authored
      Summary:
      GCC would like to emit a function call to report a tag mismatch
      rather than hard-code the `brk` instruction directly.
      
      __hwasan_tag_mismatch_stub contains most of the functionality to do
      this already, but requires exposure in the dynamic library.
      
      This patch moves __hwasan_tag_mismatch_stub outside of the anonymous
      namespace that it was defined in and declares it in
      hwasan_interface_internal.h.
      
      We also add the ability to pass sizes larger than 16 bytes to this
      reporting function by providing a fourth parameter that is only looked
      at when the size provided is not in the original accepted range.
      
      This does not change the behaviour where it is already being called,
      since the previous definition only accepted sizes up to 16 bytes and
      hence the change in behaviour is not seen by existing users.
      The change in declaration does not matter, since the only existing use
      is in the __hwasan_tag_mismatch function written in assembly.
      
      Tested with gcc and clang on an AArch64 vm.
      
      Reviewers: eugenis, kcc, pcc, #sanitizers
      
      Reviewed By: eugenis, #sanitizers
      
      Subscribers: kristof.beyls, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D69113
      612eadb7
    • Marek Kurdej's avatar
      73cebfe4
    • Benjamin Kramer's avatar
    • Haojian Wu's avatar
      [clangd] Handle the missing constructor initializers in findExplicitReferences. · 13fc899c
      Haojian Wu authored
      Reviewers: ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69241
      13fc899c
    • Haojian Wu's avatar
      [clangd] Collect name references in the index. · bf71e4fe
      Haojian Wu authored
      Summary:
      This is used for cross-file rename. When renaming a class, we expect to
      rename all related constructors/destructors.
      
      Reviewers: kadircet, ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69338
      bf71e4fe
    • Petar Avramovic's avatar
      [MIPS GlobalISel] MSA vector generic and builtin fadd, fsub, fmul, fdiv · 914ce664
      Petar Avramovic authored
      Select vector G_FADD, G_FSUB, G_FMUL and G_FDIV for MIPS32 with MSA. We
      have to set bank for vector operands to fprb and selectImpl will do the
      rest. __builtin_msa_fadd_<format>, __builtin_msa_fsub_<format>,
      __builtin_msa_fmul_<format> and __builtin_msa_fdiv_<format> will be
      transformed into G_FADD, G_FSUB, G_FMUL and G_FDIV in legalizeIntrinsic
      respectively and selected in the same way.
      
      Differential Revision: https://reviews.llvm.org/D69340
      914ce664
    • Petar Avramovic's avatar
      [MIPS GlobalISel] MSA vector generic and builtin sdiv, srem, udiv, urem · 1d7f79c0
      Petar Avramovic authored
      Select vector G_SDIV, G_SREM, G_UDIV and G_UREM for MIPS32 with MSA. We
      have to set bank for vector operands to fprb and selectImpl will do the
      rest. __builtin_msa_div_s_<format>, __builtin_msa_mod_s_<format>,
      __builtin_msa_div_u_<format> and __builtin_msa_mod_u_<format> will be
      transformed into G_SDIV, G_SREM, G_UDIV and G_UREM in legalizeIntrinsic
      respectively and selected in the same way.
      
      Differential Revision: https://reviews.llvm.org/D69333
      1d7f79c0
    • Craig Topper's avatar
      [X86] Replace some regular expressions in xray tests with explicit checks to show bad assembly. · 7f1ffef5
      Craig Topper authored
      We're print 16-bit or 32-bit registers in copy instructions to
      64-bit registers. This code will not assemble if it were to be
      parsed back in. Emitting to binary works because we'll encode
      the register the same way no matter what the size is.
      7f1ffef5
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] Allow folding of sgpr to vgpr copy · 61e7a61b
      Stanislav Mekhanoshin authored
      Potentially sgpr to sgpr copy should also be possible.
      That is however trickier because we may end up with a
      wrong register class at use because of xm0/xexec permutations.
      
      Differential Revision: https://reviews.llvm.org/D69280
      61e7a61b
    • Shoaib Meenai's avatar
      [Hexagon] Fix typo. NFC · e3d26b42
      Shoaib Meenai authored
      Testing git push access.
      e3d26b42
    • Meike Baumgärtner's avatar
      Add beginning of LLVM's GettingStarted to GitHub readme · da6384fb
      Meike Baumgärtner authored
      Reviewed and approved by chandlerc.
      
      As GitHub is the canonical LLVM repository now, embrace GitHub's way of displaying basic build instructions in the top-level readme.md.
      da6384fb
    • Chandler Carruth's avatar
      Improve Clang's getting involved document and make it more inclusive in wording. · dc1499b9
      Chandler Carruth authored
      Summary: Working with Meike and others to improve the wording in this document.
      
      Reviewers: klimek
      
      Subscribers: mcrosier, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69351
      dc1499b9
    • David Tenty's avatar
      Use portable flag with nm in extract_symbols.py · bf869683
      David Tenty authored
      Summary:
      nm is one of the tools that extract_symbols.py can use to extract
      symbols from llvm libraries as part of the build process. This patch
      updates the invocation of nm to use the -P POSIX option for "portable
      output" so we get a consistently parsable output format on all
      platforms.
      
      A link to the relevant nm format: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/nm.html
      
      Reviewers: hubert.reinterpretcast, stevewan, sfertile
      
      Reviewed By: stevewan
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69004
      bf869683
    • Meike Baumgärtner's avatar
      Improve language in GettingStarted.rst · 23fdd513
      Meike Baumgärtner authored
      This patch was reviewed and approved by chandlerc.
      
      "Getting Started with the LLVM System" is the first point of contact for many newcomers in the LLVM community.
       * Make the first two paragraphs more welcoming
       * Use more inclusive language
      23fdd513
    • Stephan T. Lavavej's avatar
      7c9844b6
    • Chandler Carruth's avatar
      Remove a no longer accurate sentence from the coding standards. · bf2975ec
      Chandler Carruth authored
      (And test my commit access. We're working on larger changes here.)
      bf2975ec
    • Louis Dionne's avatar
      [NFC] Strip trailing whitespace from libc++ · 6b77ebdc
      Louis Dionne authored
      6b77ebdc
    • Hans Wennborg's avatar
      Revert 4334892e "[DAGCombine][ARM] x ==/!= c -> (x - c) ==/!= 0 iff '-c'... · 684ebc60
      Hans Wennborg authored
      Revert 4334892e "[DAGCombine][ARM] x ==/!= c  ->  (x - c) ==/!= 0  iff '-c' can be folded into the x node."
      
      This broke various Windows builds, see comments on the Phabricator
      review.
      
      This also reverts the follow-up 20bf0cf2.
      
      > Summary:
      > This fold, helps recover from the rest of the D62266 ARM regressions.
      > https://rise4fun.com/Alive/TvpC
      >
      > Note that while the fold is quite flexible, i've restricted it
      > to the single interesting pattern at the moment.
      >
      > Reviewers: efriedma, craig.topper, spatel, RKSimon, deadalnix
      >
      > Reviewed By: deadalnix
      >
      > Subscribers: javed.absar, kristof.beyls, llvm-commits
      >
      > Tags: #llvm
      >
      > Differential Revision: https://reviews.llvm.org/D62450
      684ebc60
    • Raphael Isemann's avatar
      [lldb] Add nodebug attribute to import-std-module/sysroot test · d01fd2f3
      Raphael Isemann authored
      Summary:
      So far we rely on the default argument and the fact that we don't call this
      inline function in our actual `main.cpp` to make sure that this function can only
      be called if LLDB loads this header as a C++ module. This patch just adds
      the nodebug attribute as yet another measure to make sure LLDB can't call this
      function without the standard module loaded. Note that the test is already
      requiring clang for the sysroot setup, so its fine that this is a Clang specific attribute.
      
      Reviewers: friss, labath
      
      Subscribers: JDevlieghere, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D68861
      d01fd2f3
    • Kevin P. Neal's avatar
      Minor movement of one function with now-correct strictfp attribute to pass · b689cc64
      Kevin P. Neal authored
      against the latest version of D68233.
      b689cc64
  2. Oct 23, 2019
    • Sam McCall's avatar
      [clangd] abort if shutdown takes more than a minute. · 8bda5f20
      Sam McCall authored
      Summary:
      A certain class of bug (e.g. infloop on an AST worker thread) currently means
      clangd never terminates, even if the editor shuts down the protocol and closes
      our stdin, and the main thread recognizes that.
      
      Instead, let's wait 60 seconds for threads to finish cleanly, and then crash
      if they haven't.
      
      (Obviously, we should still fix these bugs).
      
      Reviewers: kadircet
      
      Subscribers: MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits, ilya-biryukov
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69329
      8bda5f20
    • Roman Lebedev's avatar
      [Analysis] Update Analysis/LazyValueAnalysis/lvi-after-jumpthreading.ll · 60286818
      Roman Lebedev authored
      I should have updated it in 1f665046
      but i didn't even realize those tests were there.
      60286818
    • stevewan's avatar
      Fix non-portable GNU diff option · 342c02d0
      stevewan authored
      Summary: This is a fix to revision D68839 and rL375023. This patch substitutes POSIX option "-b" for the non-portable GNU option "--strip-trailing-cr".
      
      Reviewers: daltenty, hubert.reinterpretcast
      
      Reviewed By: daltenty
      
      Subscribers: mehdi_amini, hiraditya, steven_wu, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69342
      342c02d0
    • Roman Lebedev's avatar
      [LVI][NFC] Factor solveBlockValueSaturatingIntrinsic() out of solveBlockValueIntrinsic() · 8eda8f8c
      Roman Lebedev authored
      Now that there's SaturatingInst class, this is cleaner.
      8eda8f8c
    • Roman Lebedev's avatar
      [LVI][CVP] LazyValueInfoImpl::solveBlockValueBinaryOp(): use no-wrap flags from `add` op · 1f665046
      Roman Lebedev authored
      Summary:
      This was suggested in https://reviews.llvm.org/D69277#1717210
      In this form (this is what was suggested, right?), the results aren't staggering
      (especially since given LVI cross-block focus)
      this does catch some things (as per test-suite), but not too much:
      
      | statistic                                        |       old |       new | delta | % change |
      | correlated-value-propagation.NumAddNSW           |      4981 |      4982 |     1 |  0.0201% |
      | correlated-value-propagation.NumAddNW            |     12125 |     12126 |     1 |  0.0082% |
      | correlated-value-propagation.NumCmps             |      1199 |      1202 |     3 |  0.2502% |
      | correlated-value-propagation.NumDeadCases        |       112 |       111 |    -1 | -0.8929% |
      | correlated-value-propagation.NumMulNSW           |       275 |       278 |     3 |  1.0909% |
      | correlated-value-propagation.NumMulNUW           |      1323 |      1326 |     3 |  0.2268% |
      | correlated-value-propagation.NumMulNW            |      1598 |      1604 |     6 |  0.3755% |
      | correlated-value-propagation.NumNSW              |      7158 |      7167 |     9 |  0.1257% |
      | correlated-value-propagation.NumNUW              |     13304 |     13310 |     6 |  0.0451% |
      | correlated-value-propagation.NumNW               |     20462 |     20477 |    15 |  0.0733% |
      | correlated-value-propagation.NumOverflows        |         4 |         7 |     3 | 75.0000% |
      | correlated-value-propagation.NumPhis             |     15366 |     15381 |    15 |  0.0976% |
      | correlated-value-propagation.NumSExt             |      6273 |      6277 |     4 |  0.0638% |
      | correlated-value-propagation.NumShlNSW           |      1172 |      1171 |    -1 | -0.0853% |
      | correlated-value-propagation.NumShlNUW           |      2793 |      2794 |     1 |  0.0358% |
      | correlated-value-propagation.NumSubNSW           |       730 |       736 |     6 |  0.8219% |
      | correlated-value-propagation.NumSubNUW           |      2044 |      2046 |     2 |  0.0978% |
      | correlated-value-propagation.NumSubNW            |      2774 |      2782 |     8 |  0.2884% |
      | instcount.NumAddInst                             |    277586 |    277569 |   -17 | -0.0061% |
      | instcount.NumAndInst                             |     66056 |     66054 |    -2 | -0.0030% |
      | instcount.NumBrInst                              |    709147 |    709146 |    -1 | -0.0001% |
      | instcount.NumCallInst                            |    528579 |    528576 |    -3 | -0.0006% |
      | instcount.NumExtractValueInst                    |     18307 |     18301 |    -6 | -0.0328% |
      | instcount.NumOrInst                              |    102660 |    102665 |     5 |  0.0049% |
      | instcount.NumPHIInst                             |    318008 |    318007 |    -1 | -0.0003% |
      | instcount.NumSelectInst                          |     46373 |     46370 |    -3 | -0.0065% |
      | instcount.NumSExtInst                            |     79496 |     79488 |    -8 | -0.0101% |
      | instcount.NumShlInst                             |     40654 |     40657 |     3 |  0.0074% |
      | instcount.NumTruncInst                           |     62251 |     62249 |    -2 | -0.0032% |
      | instcount.NumZExtInst                            |     68211 |     68221 |    10 |  0.0147% |
      | instcount.TotalBlocks                            |    843910 |    843909 |    -1 | -0.0001% |
      | instcount.TotalInsts                             |   7387448 |   7387423 |   -25 | -0.0003% |
      
      Reviewers: nikic, reames
      
      Reviewed By: nikic
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69321
      1f665046
    • Artem Dergachev's avatar
      [analyzer] Fix off-by-one in operator call parameter binding. · be86fdb8
      Artem Dergachev authored
      Member operator declarations and member operator expressions
      have different numbering of parameters and arguments respectively:
      one of them includes "this", the other does not.
      
      Account for this inconsistency when figuring out whether
      the parameter needs to be manually rebound from the Environment
      to the Store when entering a stack frame of an operator call,
      as opposed to being constructed with a constructor and as such
      already having the necessary Store bindings.
      
      Differential Revision: https://reviews.llvm.org/D69155
      be86fdb8
    • Casey Carter's avatar
      [libc++][NFC] Remove excess trailing newlines from most files · 689ce810
      Casey Carter authored
      Testing git commit access.
      689ce810
    • Simon Atanasyan's avatar
      [mips] Use `expandLoadAddress` for JAL expansion · 8e574e56
      Simon Atanasyan authored
      - Reduce code duplication
      - Get partial support of JAL expansion for XGOT.
      8e574e56
    • Simon Atanasyan's avatar
      c470a9b5