Started 1 yr 5 mo ago
Took 59 min

Failed Build clang-r359494-t55990-b55990.tar.gz (Apr 29, 2019 2:13:41 PM)

Issues

Found 2 issues:
Warning: clock of the subversion server appears to be out of sync. This can result in inconsistent check out behavior.
+ : lnt-test-suite-x86_64-O3-flto
+ build get lnt
+ build get compiler
At revision 359505

WARNING: clock of the subversion server appears to be out of sync. This can result in inconsistent check out behavior.
+ build get test-suite
+ DEPENDENCY_FILES=/Users/buildslave/jenkins/workspace/lnt-test-suite-x86_64-O3-flto/config/tasks/lnt-testsuite.dep
Error: <html>
+ . /Users/buildslave/jenkins/workspace/lnt-test-suite-x86_64-O3-flto/config/tasks/utils/lnt_submit.sh
++ echo '@@@ LNT Submit @@@'
@@@ LNT Submit @@@
++ '[' -n http://104.154.54.203/db_default/v4/nts/submitRun -a -n lnt-test-suite-x86_64-O3-flto ']'
+++ lnt submit http://104.154.54.203/db_default/v4/nts/submitRun /Users/buildslave/jenkins/workspace/lnt-test-suite-x86_64-O3-flto/lnt-sandbox/report.json
++ LNT_RESULT_URL='error: <html>

<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">

Build Log

Revision: 358206
Changes
  1. [sanitizer] Add BUILDBOT_MONO_REPO_PATH to use for local debugging (detail)
    by vitalybuka
  2. Add LLVM lab buildslaves for Windows/Ubuntu builders.

    The initial buildslave configurations for a new hardware in LLVM lab.
    Requested for the staged buildebot http://lab.llvm.org:8014

    Patch by Vlad Vereschaka.

    Differential Revision: https://reviews.llvm.org/D60635 (detail)
    by gkistanova
Revision: 358206
Changes
  1. [gn] Use label_name rather than target_output_name for objects

    Multiple targets in the same output directory can use the same
    target_output_name. The typical example of that is having a shared
    and a static library of the same, e.g. libc++.so and libc++.a.
    When that's the case, the object files produced for each target
    are going to conflict. Using the label_name avoids this conflict
    since labels are guaranteed to be unique within a single BUILD.gn
    file which corresponds to a single output directory.

    Differential Revision: https://reviews.llvm.org/D60329 (detail)
    by phosek
  2. Fix string UAF in new FileCheck test (detail)
    by rnk
  3. [X86][SSE] isHorizontalBinOp - add support for target shuffles

    Add target shuffle decoding to isHorizontalBinOp as well as ISD::VECTOR_SHUFFLE support.

    This does mean we can go through bitcasts so we need to bitcast the extracted args to ensure they are the correct type

    Fixes PR39936 and should help with PR39920/PR39921

    Differential Revision: https://reviews.llvm.org/D61245 (detail)
    by rksimon
  4. [llvm-pdbutil] FunctionDumper::dump(PDBSymbolTypeFunctionArg) - fix null dereference warning

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  5. computePolynomialFromPointer - add missing early-out return for non-pointer types.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  6. [InstCombine] reduce code duplication; NFC

    Follow-up to:
    rL359482

    Avoid this potential problem throughout by giving the type a name
    and verifying the assumption that both operands are the same type. (detail)
    by spatel
  7. Fix additional cases of more that two dashes for options in tests. (detail)
    by dhinton
  8. Remove duplicate line. NFCI.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  9. [InstCombine] visitFCmpInst - appease copy+paste pattern warning. NFCI.

    PVS Studio's copy+paste recognizer was seeing this as a typo, technically Op0/Op1 in a fcmp should always be the same type, but we might as well avoid the issue.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  10. [globalisel] Improve Legalizer debug output

    * LegalizeAction should be printed by name rather than number
    * Newly created instructions are incomplete at the point the observer first sees
      them. They are therefore recorded in a small vector and printed just before
      the legalizer moves on to another instruction. By this point, the instruction
      must be complete. (detail)
    by dsanders
  11. [CommandLine] Don't allow unlimitted dashes for options. Part 1 or 5

    Summary:
    Prior to this patch, the CommandLine parser would strip an
    unlimitted number of dashes from options.  This patch limits it to
    two.

    Reviewers: rnk

    Reviewed By: rnk

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61229 (detail)
    by dhinton
  12. [X86] scaleShuffleMask - avoid potential signed overflow warning.

    Use size_t assignment to prevent a bad explicit type conversion warning.

    Given the typical size of shuffle masks this was never going to happen, but this at least stops the warning.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  13. [TextAPI] Fix Symbol::dump which was failing to append the SymbolKind string.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  14. [llvm-mca][x86] Fix MMX PMOVMSKB test

    This is defined as part of SSE1, XMM PMOVMSKB doesn't appear until SSE2 (detail)
    by rksimon
  15. [DAG] Refactor DAGCombiner::ReassociateOps

    Summary:
    Extract the logic for doing reassociations
    from DAGCombiner::reassociateOps into a helper
    function DAGCombiner::reassociateOpsCommutative,
    and use that helper to trigger reassociation
    on the original operand order, or the commuted
    operand order.

    Codegen is not identical since the operand order will
    be different when doing the reassociations for the
    commuted case. That causes some unfortunate churn in
    some test cases. Apart from that this should be NFC.

    Reviewers: spatel, craig.topper, tstellar

    Reviewed By: spatel

    Subscribers: dmgreen, dschuff, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, hiraditya, aheejin, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61199 (detail)
    by bjope
  16. FileCheck [3/12]: Stricter parsing of @LINE expressions

    Summary:
    This patch is part of a patch series to add support for FileCheck
    numeric expressions. This specific patch gives earlier and better
    diagnostics for the @LINE expressions.

    Rather than detect parsing errors at matching time, this commit adds
    enhance parsing to detect issues with @LINE expressions at parse time
    and diagnose them more accurately.

    Copyright:
        - Linaro (changes up to diff 183612 of revision D55940)
        - GraphCore (changes in later versions of revision D55940 and
                     in new revision created off D55940)

    Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

    Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60383 (detail)
    by thopre
  17. [TableGen] Fix null pointer dereferencing.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  18. Avoid "checking a pointer after dereferencing" warning. NFCI.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  19. Move if() to newline to stop ambiguity over whether it should be else if. NFCI.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  20. Fix operator precedence warning. NFCI.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  21. Remove superfluous break from switch statement. NFCI.

    Reported in https://www.viva64.com/en/b/0629/ (detail)
    by rksimon
  22. [llvm-extract] Expose the group extraction feature of the BlockExtractor

    This patch extends the `-bb` option to be able to use the group
    extraction feature from the BlockExtractor.
    In particular, `-bb=func:bb` is modified to support a list of basic
    blocks per function: `-bb=func:bb1[;bb2...]` that will be extracted
    together if at all possible (region must be single entry.)

    Differential Revision: https://reviews.llvm.org/D60973 (detail)
    by qcolombet
  23. [BlockExtractor] Expose a constructor for the group extraction

    NFC

    Differential Revision: https://reviews.llvm.org/D60971 (detail)
    by qcolombet
  24. [BlockExtractor] Change the basic block separator from ',' to ';'

    This change aims at making the file format be compatible with the
    way LLVM handles command line options.

    Differential Revision: https://reviews.llvm.org/D60970 (detail)
    by qcolombet
  25. Add AVX support to this test.

    Requested by Craig Topper and Andrew Kaylor as part of D55897. (detail)
    by kpn
  26. [X86] Remove duplicate string comparison

    Fix typo introduced in rL332824 where we simplified the extact string matches for "avx512.mask.permvar.sf.256" and "avx512.mask.permvar.si.256" to a string startswith test for "avx512.mask.permvar." (detail)
    by rksimon
  27. [AArch64][SVE] Asm: add aliases for unpredicated bitwise logical instructions

    This patch adds aliases for element sizes .B/.H/.S to the
    AND/ORR/EOR/BIC bitwise logical instructions. The assembler now accepts
    these instructions with all element sizes up to 64-bit (.D). The
    preferred disassembly is .D. (detail)
    by c-rhodes
  28. [X86][SSE] Add scalar horizontal add/sub tests for non-0/1 element extractions (detail)
    by rksimon
  29. FileCheck [2/12]: Stricter parsing of -D option

    Summary:
    This patch is part of a patch series to add support for FileCheck
    numeric expressions. This specific patch gives earlier and better
    diagnostics for the -D option.

    Prior to this change, parsing of -D option was very loose: it assumed
    that there is an equal sign (which to be fair is now checked by the
    FileCheck executable) and that the part on the left of the equal sign
    was a valid variable name. This commit adds logic to ensure that this
    is the case and gives diagnostic when it is not, making it clear that
    the issue came from a command-line option error. This is achieved by
    sharing the variable parsing code into a new function ParseVariable.

    Copyright:
        - Linaro (changes up to diff 183612 of revision D55940)
        - GraphCore (changes in later versions of revision D55940 and
                     in new revision created off D55940)

    Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

    Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60382 (detail)
    by thopre
  30. [LoopSimplifyCFG] Suppress expensive DomTree verification

    This patch makes verification level lower for builds with
    inexpensive checks.

    Differential Revision: https://reviews.llvm.org/D61055 (detail)
    by yrouban
  31. [yaml2obj] - Simplify and reduce the code. NFC.

    This inlines 2 single line static methods
    and simplifies the code.

    It is also possible to remove the `Is64Bit`
    variable since it is used only once,
    but I am not sure it will be better for readability. (detail)
    by grimar
  32. [yaml2obj] - Replace a loop with write_zeros(). NFCI.

    This looks better. (detail)
    by grimar
  33. [yaml2obj] - Cleanup and simplify the code. NFCI.

    The current code has the following problems:
    `initSymtabSectionHeader` and `initStrtabSectionHeader` method
    names saying us they are going to initialize the section headers.
    Though for a few cases sh_flags field is initialized outside of them.
    It does not look clean. This patch moves initialization of the
    sh_flags inside these methods.

    Also, it removes an excessive variable, what together with the above
    change hopefully makes the code a bit more readable. (detail)
    by grimar
  34. [X86][SSE] Moved haddps test from phaddsub.ll to haddsub.ll (D61245)

    Also merged duplicate PR39921 + PR39936 tests (detail)
    by rksimon
  35. [InstCombine][X86] Add PACKSS tests for truncation of sign-extended comparisons (detail)
    by rksimon
  36. [ARM] Add bitcast/extract_subvec. of fp16 vectors

    Summary:
    This patch adds some basic operations for fp16
    vectors, such as bitcast from fp16 to i16,
    required to perform extract_subvector (also added
    here) and extract_element.

    Reviewers: SjoerdMeijer, DavidSpickett, t.p.northover, ostannard

    Reviewed By: ostannard

    Subscribers: javed.absar, kristof.beyls, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60618 (detail)
    by dnsampaio
  37. [ARM] Add v4f16 and v8f16 types to the CallingConv

    Summary:
    The Procedure Call Standard for the Arm Architecture
    states that float16x4_t and float16x8_t behave just
    as uint16x4_t and uint16x8_t for argument passing.
    This patch adds the fp16 vectors to the
    ARMCallingConv.td file.

    Reviewers: miyuki, ostannard

    Reviewed By: ostannard

    Subscribers: ostannard, javed.absar, kristof.beyls, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60720 (detail)
    by dnsampaio
  38. vs integration: Use llvm-lib for librarian

    This uses llvm-lib.exe for the librarian instead of Visual Studio
    provided lib.exe. Without this it is not possible to create static
    libraries with -flto using the plugin.

    Original patch by Steven Noonan

    This fixes: PR41147

    Differential Revision: https://reviews.llvm.org/D61193 (detail)
    by russell_gallop
  39. gn: Fix check-clang build after r359179 (detail)
    by hans
  40. Try to use /proc on FreeBSD for getExecutablePath

    Currently, clang's libTooling passes this function a fake argv0, which
    means that no libTooling tools can find the standard headers on FreeBSD.
    With this change, these will now work on any FreeBSD systems that have
    procfs mounted.  This isn't the right fix for the libTooling issue, but
    it does bring the FreeBSD implementation of getExecutablePath closer to
    the Linux and macOS implementations. (detail)
    by theraven
  41. [DebugInfo] Terminate more location-list ranges at the end of blocks

    This patch fixes PR40795, where constant-valued variable locations can
    "leak" into blocks placed at higher addresses. The root of this is that
    DbgEntityHistoryCalculator terminates all register variable locations at
    the end of each block, but not constant-value variable locations.

    Fixing this requires constant-valued DBG_VALUE instructions to be
    broadcast into all blocks where the variable location remains valid, as
    documented in the LiveDebugValues section of SourceLevelDebugging.rst,
    and correct termination in DbgEntityHistoryCalculator.

    Differential Revision: https://reviews.llvm.org/D59431 (detail)
    by jmorse
  42. [DWARF] Fix dump of local/foreign TU lists in .debug_names

    Differential Revision: https://reviews.llvm.org/D61241 (detail)
    by maskray
  43. [DWARF] Delete a redundant check in getFileNameByIndex() (detail)
    by maskray
  44. [X86] Remove some intel syntax aliases on (v)cvtpd2(u)dq, (v)cvtpd2ps, (v)cvt(u)qq2ps. Add 'x' and'y' suffix aliases to masked version of the same in att syntax.

    The 128/256 bit version of these instructions require an 'x' or 'y' suffix to
    disambiguate the memory form in att syntax.

    We were allowing the same suffix in intel syntax, but it appears gas does not
    do that.

    gas does allow the 'x' and 'y' suffix on register and broadcast forms even
    though its not needed. We were allowing it on unmasked register form, but not on
    masked versions or on masked or unmasked broadcast form.

    While there fix some test coverage holes so they can be extended with the 'x'
    and 'y' suffix tests. (detail)
    by ctopper
  45. [llvm-nm] -print-size => --print-size (detail)
    by maskray
  46. [llvm-nm] Simplify and fix a buffer overflow

    * char SymbolAddrStr[18] can't hold "%" PRIo64 which may need 22 characters.
    * Use range-based for
    * Delete unnecessary typedef
    * format(...).print(Str, sizeof(Str)) + outs() << Str => outs() << format(...)
    * Use cascading outs() << .. << ..
    * Use iterator_range(Container &&c)
    * (A & B) == B => A & B   if B is a power of 2
    * replace null sentinel in constants with makeArrayRef (detail)
    by maskray
  47. llvm-cvtres: Attempt to make llvm-cvtres/duplicate.test work on big-endian systems (detail)
    by nico
  48. [X86] Add PR39921 HADD pairwise reduction test and AVX2 test coverage (detail)
    by rksimon
  49. [X86][AVX] Add fast-hops target for add/fadd reduction tests (detail)
    by rksimon
  50. [X86] Add PR39936 HADD Tests (detail)
    by rksimon
  51. [X86][SSE] combineExtractVectorElt - add early-out to return zero/undef for out-of-range extraction indices. (detail)
    by rksimon
  52. [ConstantRange] Add makeExactNoWrapRegion()

    I got confused on the terminology, and the change in D60598 was not
    correct. I was thinking of "exact" in terms of the result being
    non-approximate. However, the relevant distinction here is whether
    the result is

    * Largest range such that:
       Forall Y in Other: Forall X in Result: X BinOp Y does not wrap.
       (makeGuaranteedNoWrapRegion)
    * Smallest range such that:
       Forall Y in Other: Forall X not in Result: X BinOp Y wraps.
       (A hypothetical makeAllowedNoWrapRegion)
    * Both. (makeExactNoWrapRegion)

    I'm adding a separate makeExactNoWrapRegion method accepting a
    single APInt (same as makeExactICmpRegion) and using it in the
    places where the guarantee is relevant.

    Differential Revision: https://reviews.llvm.org/D60960 (detail)
    by nikic
  53. [X86][AVX] Enabled AVX512F tests and add PR40815 test case (detail)
    by rksimon
  54. [X86][AVX] Combine non-lane crossing binary shuffles using X86ISD::VPERMV3

    Some of the combines might be further improved if we lower more shuffles with X86ISD::VPERMV3 directly, instead of waiting to combine the results. (detail)
    by rksimon
  55. [SelectionDAG] include FP min/max variants as binary operators

    The x86 test diffs don't look great because of extra move ops,
    but FP min/max should clearly be included in the list. (detail)
    by spatel
  56. [DAGCombiner] try repeated fdiv divisor transform before building estimate

    This was originally part of D61028, but it's an independent diff.

    If we try the repeated divisor reciprocal transform before producing an estimate sequence,
    then we have an opportunity to use scalar fdiv. On x86, the trade-off is 1 divss vs. 5
    vector FP ops in the default estimate sequence. On recent chips (Skylake, Ryzen), the
    full-precision division is only 3 cycle throughput, so that's probably the better perf
    default option and avoids problems from x86's inaccurate estimates.

    The last 2 tests show that users still have the option to override the defaults by using
    the function attributes for reciprocal estimates, but those patterns are potentially made
    faster by converting the vector ops (including ymm ops) to scalar math.

    Differential Revision: https://reviews.llvm.org/D61149 (detail)
    by spatel
  57. [MCA] Fix typo in AVX2 gather tests. NFC (detail)
    by adibiagio
  58. [X86][SSE] Optimize llvm.experimental.vector.reduce.xor.vXi1 parity reduction (PR38840)

    An xor reduction of a bool vector can be optimized to a parity check of the MOVMSK/BITCAST'd integer - if the population count is odd return 1, else return 0.

    Differential Revision: https://reviews.llvm.org/D61230 (detail)
    by rksimon
  59. [X86][AVX] Add AVX512DQ coverage for masked memory ops tests (PR34584) (detail)
    by rksimon
  60. [X86] Remove (V)MOV64toSDrr/m and (V)MOVDI2SSrr/m. Use 128-bit result MOVD/MOVQ and COPY_TO_REGCLASS instead

    Summary:
    The register form of these instructions are CodeGenOnly instructions that cover
    GR32->FR32 and GR64->FR64 bitcasts. There is a similar set of instructions for
    the opposite bitcast. Due to the patterns using bitcasts these instructions get
    marked as "bitcast" machine instructions as well. The peephole pass is able to
    look through these as well as other copies to try to avoid register bank copies.

    Because FR32/FR64/VR128 are all coalescable to each other we can end up in a
    situation where a GR32->FR32->VR128->FR64->GR64 sequence can be reduced to
    GR32->GR64 which the copyPhysReg code can't handle.

    To prevent this, this patch removes one set of the 'bitcast' instructions. So
    now we can only go GR32->VR128->FR32 or GR64->VR128->FR64. The instruction that
    converts from GR32/GR64->VR128 has no special significance to the peephole pass
    and won't be looked through.

    I guess the other option would be to add support to copyPhysReg to just promote
    the GR32->GR64 to a GR64->GR64 copy. The upper bits were basically undefined
    anyway. But removing the CodeGenOnly instruction in favor of one that won't be
    optimized seemed safer.

    I deleted the peephole test because it couldn't be made to work with the bitcast
    instructions removed.

    The load version of the instructions were unnecessary as the pattern that selects
    them contains a bitcasted load which should never happen.

    Fixes PR41619.

    Reviewers: RKSimon, spatel

    Reviewed By: RKSimon

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61223 (detail)
    by ctopper
  61. Revert rL359389: [X86][SSE] Add support for <64 x i1> bool reduction

    Minor generalization of the existing <32 x i1> pre-AVX2 split code.
    ........
    Causing irregular buildbot failures. (detail)
    by rksimon
  62. [X86][AVX] Add additional SSE/AVX expandload and compressstore targets (detail)
    by rksimon
  63. [X86][SSE] Add support for <64 x i1> bool reduction

    Minor generalization of the existing <32 x i1> pre-AVX2 split code. (detail)
    by rksimon
  64. [X86][AVX] Cleanup and add additional expandload and compressstore tests

    sort order by types and add vXi32/vXi16/vXi8 test coverage (detail)
    by rksimon
  65. [X86][AVX512] Improve vector bool reductions

    As predicate masks are legal on AVX512 targets, we avoid MOVMSK in these cases, but we can just bitcast the bool vector to the integer equivalent directly - avoiding expansion of the reduction to a shuffle pattern. (detail)
    by rksimon
  66. [X86] Add vector boolean reduction tests (PR38840)

    AND/OR/XOR tests for the @llvm.experimental.vector.reduce intrinsics

    AND/OR are pretty good (pre-AVX512), XOR (not so common but used for parity reduction) is still pretty bad. (detail)
    by rksimon
  67. [lli] Fix a typo in a cl::opt description.

    Patch by Wasiher. Thanks Wasiher!

    Differential Revision: https://reviews.llvm.org/D61135 (detail)
    by lhames
  68. [llvm-nm][llvm-readelf] Avoid single-dash -long-option in tests (detail)
    by maskray
  69. Fix check-prefixes typo (detail)
    by rksimon
  70. [DJB] Fix variable case after D61178 (detail)
    by maskray
  71. [llvm-nm] Support section type 'u': STB_GNU_UNIQUE (detail)
    by maskray
  72. [X86][SSE] Add initial test case for subvector insert/extract of illegal types

    Suggested by @nikic on D59188 (detail)
    by rksimon
  73. [X86][AVX] Merge mask select with shuffles across extract_subvector (PR40332)

    Fixes PR40332 in the limited case where we're selecting between a target shuffle and a zero vector.

    We can extend this in the future to handle more opcodes and non-zero selections. (detail)
    by rksimon
  74. [MCA] Add field `IsEliminated` to class Instruction. NFCI (detail)
    by adibiagio
  75. [cmake] Disable a GCC optimization when building LLVM for MIPS

    GCC when compiling LLVM for MIPS can introduce a jump to an uninitialized
    value when shrink wrapping is enabled. As shrink wrapping is enabled in
    GCC at all optimization levels, it must be disabled. This bug exists for
    all versions of GCC since 4.9.2.

    This partially resolves PR37701 / GCC PR target/86069.

    Patch by Simon Dardis.

    Differential Revision: https://reviews.llvm.org/D48069 (detail)
    by atanasyan
  76. [X86] Use MOVQ for i64 atomic_stores when SSE2 is enabled

    Summary: If we have SSE2 we can use a MOVQ to store 64-bits and avoid falling back to a cmpxchg8b loop. If its a seq_cst store we need to insert an mfence after the store.

    Reviewers: spatel, RKSimon, reames, jfb, efriedma

    Reviewed By: RKSimon

    Subscribers: hiraditya, dexonsmith, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60546 (detail)
    by ctopper
  77. Revert "AMDGPU: Split block for si_end_cf"

    This reverts commit 7a6ef3004655dd86d722199c471ae78c28e31bb4.

    We discovered some internal test failures, so reverting for now.

    Differential Revision: https://reviews.llvm.org/D61213 (detail)
    by msearles
  78. [AMDGPU] gfx1010 VOPC implementation

    Differential Revision: https://reviews.llvm.org/D61208 (detail)
    by rampitec
  79. [ORC] Add a 'plugin' interface to ObjectLinkingLayer for events/configuration.

    ObjectLinkingLayer::Plugin provides event notifications when objects are loaded,
    emitted, and removed. It also provides a modifyPassConfig callback that allows
    plugins to modify the JITLink pass configuration.

    This patch moves eh-frame registration into its own plugin, and teaches
    llvm-jitlink to only add that plugin when performing execution runs on
    non-Windows platforms. This should allow us to re-enable the test case that was
    removed in r359198. (detail)
    by lhames
  80. [GlobalISel][AArch64] Use getConstantVRegValWithLookThrough for extracts

    getConstantVRegValWithLookThrough does the same thing as the
    getConstantValueForReg function, and has more visibility across GISel. Plus, it
    supports looking through G_TRUNC, G_SEXT, and G_ZEXT. So, we get better code
    reuse and more functionality for free by using it.

    Add some test cases to select-extract-vector-elt.mir to show that we can now
    look through those instructions. (detail)
    by paquette
  81. [AsmPrinter] refactor to support %c w/ GlobalAddress'

    Summary:
    Targets like ARM, MSP430, PPC, and SystemZ have complex behavior when
    printing the address of a MachineOperand::MO_GlobalAddress. Move that
    handling into a new overriden method in each base class. A virtual
    method was added to the base class for handling the generic case.

    Refactors a few subclasses to support the target independent %a, %c, and
    %n.

    The patch also contains small cleanups for AVRAsmPrinter and
    SystemZAsmPrinter.

    It seems that NVPTXTargetLowering is possibly missing some logic to
    transform GlobalAddressSDNodes for
    TargetLowering::LowerAsmOperandForConstraint to handle with "i" extended
    inline assembly asm constraints.

    Fixes:
    - https://bugs.llvm.org/show_bug.cgi?id=41402
    - https://github.com/ClangBuiltLinux/linux/issues/449

    Reviewers: echristo, void

    Reviewed By: void

    Subscribers: void, craig.topper, jholewinski, dschuff, jyknight, dylanmckay, sdardis, nemanjai, javed.absar, sbc100, jgravelle-google, eraman, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, jrtc27, atanasyan, jsji, llvm-commits, kees, tpimh, nathanchance, peter.smith, srhines

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60887 (detail)
    by nickdesaulniers
  82. [X86][AVX] Fold extract_subvector(broadcast(x)) -> broadcast(x) iff x has one use (detail)
    by rksimon
  83. [AArch64][GlobalISel] Select G_BSWAP for vectors of s32 and s64

    There are instructions for these, so mark them as legal. Select the correct
    instruction in AArch64InstructionSelector.cpp.

    Update select-bswap.mir and arm64-rev.ll to reflect the changes. (detail)
    by paquette
  84. [AMDGPU] gfx1010 VOP3 and VOP3P implementation

    Differential Revision: https://reviews.llvm.org/D61202 (detail)
    by rampitec
  85. [DAGCombine] Cleanup visitEXTRACT_SUBVECTOR. NFCI.

    Use ArrayRef::slice, reduce some rather awkward long lines for legibility and run clang-format. (detail)
    by rksimon
  86. [ConstantRange] Add abs() support

    Add support for abs() to ConstantRange. This will allow to handle
    SPF_ABS select flavor in LVI and will also come in handy as a
    primitive for the srem implementation.

    The implementation is slightly tricky, because a) abs of signed min
    is signed min and b) sign-wrapped ranges may have an abs() that is
    smaller than a full range, so we need to explicitly handle them.

    Differential Revision: https://reviews.llvm.org/D61084 (detail)
    by nikic
  87. [X86] Sink NoRegister creation for unused Base/Index registers into getAddressOperands. NFCI (detail)
    by ctopper
  88. [X86] Segment registers should have i16 type not i32.

    Probably doesn't really matter, but was inconsistent with the rest of the code. (detail)
    by ctopper
  89. [AMDGPU] gfx1010 VOP2 changes

    Differential Revision: https://reviews.llvm.org/D61156 (detail)
    by rampitec
  90. [llvm-nm] Revert inadvertently committed 'i' change in r359314 (detail)
    by maskray
  91. [ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' change (detail)
    by maskray
  92. [PowerPC] Update P9 vector costs for insert/extract element

    The PPC vector cost model values for insert/extract element reflect older
    processors that lacked vector insert/extract and move-to/move-from VSR
    instructions.  Update getVectorInstrCost to give appropriate values for when
    the newer instructions are present.

    Differential Revision: https://reviews.llvm.org/D60160 (detail)
    by froese
  93. [llvm-nm] Generalize symbol types 'N', 'n' and '?' (detail)
    by maskray
  94. [llvm-nm] Fix handling of symbol types 't' 'd' 'r'

    In addition, fix and convert the two tests to yaml2obj based. This
    allows us to delete two executables.

    X86/weak.test: 'v' was not tested
    X86/init-fini.test: symbol types of __bss_start _edata _end were wrong
      GNU nm reports __init_array_start as 't', and __preinit_array_start as 'd'.
      __init_array_start is 't' just because its section ".init_array" starts with ".init"

      'd' makes more sense and allows us to drop the weird SHT_INIT_ARRAY rule.
      So, change __init_array_start to 'd' instead. (detail)
    by maskray
  95. [docs] Put DefaultOption bullet in alphabetical order. (detail)
    by dhinton
  96. [llvm-nm][llvm-size] Use --double-dash options in tests (detail)
    by maskray
  97. s/Dwarf 5/DWARF v5/ NFC (detail)
    by maskray
  98. [x86] add tests for fmin/fmax; NFC

    'maximum' and 'minimum' still crash, so they are commented out. (detail)
    by spatel
  99. Fix llvm-objcopy/ELF/preserve-segment-contents test on UTF-8 locale

    Differential Revision: https://reviews.llvm.org/D61137 (detail)
    by aganea
  100. [yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.

    No need to use SmallVector of char* here.
    This simplifies the code. (detail)
    by grimar
  101. [yaml2obj] - Remove excessive variable. NFC.

    `auto &Strtab` was used only once. (detail)
    by grimar
  102. Fix Wparentheses warning. NFCI. (detail)
    by rksimon
  103. [yaml2obj] - Make the code to match the LLVM style. NFCI.

    This renames the variables to uppercase and
    removes use of `auto` for unobvious type. (detail)
    by grimar
  104. [yaml2elf] - Cleanup the initSectionHeaders(). NFCI.

    This encapsulates the section specific code inside the
    corresponding writeSectionContent methods.
    Making the code a bit more consistent. (detail)
    by grimar
  105. [X86][SSE] Pull out OR(EXTRACTELT(X,0),OR(EXTRACTELT(X,1),...)) matching code from LowerVectorAllZeroTest

    Create a matchBitOpReduction helper that checks for the pattern with any opcode.

    First step towards reusing this code to recognize other scalar reduction patterns. (detail)
    by rksimon
  106. Minor formatting tweak, no behavior change (detail)
    by nico
  107. caseFoldingDjbHash: simplify and make the US-ASCII fast path faster

    The slow path (with at least one non US-ASCII) will be slower but that
    doesn't matter.

    Differential Revision: https://reviews.llvm.org/D61178 (detail)
    by maskray
  108. [X86][SSE] Disable shouldFoldConstantShiftPairToMask for btver1/btver2 targets (PR40758)

    As detailed on PR40758, Bobcat/Jaguar can perform vector immediate shifts on the same pipes as vector ANDs with the same latency - so it doesn't make sense to replace a shl+lshr with a shift+and pair as it requires an additional mask (with the extra constant pool, loading and register pressure costs).

    Differential Revision: https://reviews.llvm.org/D61068 (detail)
    by rksimon
  109. [X86][AVX] Combine shuffles extracted from a common vector

    A small step towards combining shuffles across vector sizes - this recognizes when a shuffle's operands are all extracted from the same larger source and tries to combine to an unary shuffle of that source instead. Fixes one of the test cases from PR34380.

    Differential Revision: https://reviews.llvm.org/D60512 (detail)
    by rksimon
  110. [InferAddressSpaces] Add AS parameter to the pass factory

    This enables the pass to be used in the absence of
    TargetTransformInfo. When the argument isn't passed, the factory
    defaults to UninitializedAddressSpace and the flat address space is
    obtained from the TargetTransformInfo as before this change. Existing
    users won't have to change.

    Patch by Kevin Petit.

    Differential Revision: https://reviews.llvm.org/D60602 (detail)
    by svenvh
  111. Fix alignment in AArch64InstructionSelector::emitConstantPoolEntry()

    The code was using the alignment of a pointer to the value, not the
    alignment of the constant itself.

    Maybe we got away with it so far because the pointer alignment is
    fairly high, but we did end up under-aligning <16 x i8> vectors,
    which was caught in the Chromium build after lld stopped over-aligning
    the .rodata.cst16 section in r356428. (See crbug.com/953815)

    Differential revision: https://reviews.llvm.org/D61124 (detail)
    by hans
  112. [GlobalISel] Fix inserting copies in the right position for reg definitions

    When constrainRegClass is called if the constraining happens on a use the COPY
    needs to be inserted before the instruction that contains the MachineOperand,
    but if we are constraining a definition it actually needs to be added
    after the instruction. In addition, the COPY needs to have its operands
    flipped (in the use case we are copying from the old unconstrained register
    to the new constrained register, while in the definition case we are copying
    from the new constrained register that the instruction defines to the old
    unconstrained register). (detail)
    by mggm
  113. Fix typos: (re)?sor?uce -> (re)?source

    Closes: https://github.com/llvm/llvm-project/pull/10

    In-collaboration-with: Olivier Cochard-Labbé <olivier@FreeBSD.org>
    Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>

    Differential Revision: https://reviews.llvm.org/D61021 (detail)
    by maskray
  114. [NFC] Add baseline tests for int isKnownNonZero

    Add baseline tests for improvements of isKnownNonZero for integer types.

    Differential Revision: https://reviews.llvm.org/D60932 (detail)
    by dlrobertson
  115. [llvm-objcopy] Accept --long-option but not -long-option

    Summary:

    llvm-{objcopy,strip} (and many other LLVM binary utilities) accept
    cl::opt style -long-option as well as many short options (e.g. -p -S
    -x). People who use them as replacement of GNU binutils often use the
    grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x,
    -Wd => -W -d, -sj.text => -s -j.text

    There is ambiguity if a long option starts with the character used by a
    short option. Drop the support for -long-option to resolve the ambiguity.

    This divergence from other utilities is accepted (other utilities
    continue supporting -long-option).
    https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

    Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola

    Reviewed By: jakehehrlich, jhenderson, rupprecht

    Subscribers: grimar, emaste, arichardson, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60439 (detail)
    by maskray
  116. [GlobalOpt] Swap the expensive check for cold calls with the cheap TTI check

    isValidCandidateForColdCC is much more expensive than
    TTI.useColdCCForColdCall, which by default just returns false. Avoid
    doing this work if we're not going to look at the answer anyway.

    This change is NFC, but I see significant compile time improvements on
    some code with pathologically many functions. (detail)
    by bogner
  117. [ORC] Remove symbols from dependency lists when failing materialization.

    When failing materialization of a symbol X, remove X from the dependants list
    of any of X's dependencies. This ensures that when X's dependencies are
    emitted (or fail themselves) they do not try to access the no-longer-existing
    MaterializationInfo for X. (detail)
    by lhames
  118. [CUDA] Implemented _[bi]mma* builtins.

    These builtins provide access to the new integer and
    sub-integer variants of MMA (matrix multiply-accumulate) instructions
    provided by CUDA-10.x on sm_75 (AKA Turing) GPUs.

    Also added a feature for PTX 6.4. While Clang/LLVM does not generate
    any PTX instructions that need it, we still need to pass it through to
    ptxas in order to be able to compile code that uses the new 'mma'
    instruction as inline assembly (e.g used by NVIDIA's CUTLASS library
    https://github.com/NVIDIA/cutlass/blob/master/cutlass/arch/mma.h#L101)

    Differential Revision: https://reviews.llvm.org/D60279 (detail)
    by tra
  119. PTX 6.3 extends `wmma` instruction to support s8/u8/s4/u4/b1 -> s32.

    All of the new instructions are still handled mostly by tablegen. I've slightly
    refactored the code to drive intrinsic/instruction generation from a master
    list of supported variants, so all irregularities have to be implemented in one place only.

    The test generation script wmma.py has been refactored in a similar way.

    Differential Revision: https://reviews.llvm.org/D60015 (detail)
    by tra
  120. [NVPTX] generate correct MMA instruction mnemonics with PTX63+.

    PTX 6.3 requires using ".aligned" in the MMA instruction names.
    In order to generate correct name, now we pass current
    PTX version to each instruction as an extra constant operand
    and InstPrinter adjusts its output accordingly.

    Differential Revision: https://reviews.llvm.org/D59393 (detail)
    by tra
  121. [NVPTX] Refactor generation of MMA intrinsics and instructions. NFC.

    Generalized constructions of 'fragments' of MMA operations to provide
    common primitives for construction of the ops. This will make it easier
    to add new variants of the instructions that operate on integer types.

    Use nested foreach loops which makes it possible to better control
    naming of the intrinsics.

    This patch does not affect LLVM's output, so there are no test changes.

    Differential Revision: https://reviews.llvm.org/D59389 (detail)
    by tra
  122. [Object][XCOFF] Add intial support for section header table.

    Adds a representation of the section header table to XCOFFObjectFile,
    and implements enough to dump the section headers with llvm-obdump.

    Differential Revision: https://reviews.llvm.org/D60784 (detail)
    by sfertile
  123. [CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPC

    Summary:
    This value is derived from the host triple, which on the machine
    I'm currently using is `ppc64le-linux-redhat`. This change makes
    LLVM compile.

    Reviewers: nemanjai
    Differential Revision: https://reviews.llvm.org/D57118 (detail)
    by kfischer
  124. [AMDGPU] gfx1010 - fix ubsan failure

    Revert DecoderNamespace in one place for now. It will need more
    changes to properly work. (detail)
    by rampitec
  125. [x86] add tests for vector fdiv reciprocal estimate; NFC (detail)
    by spatel
  126. Assigning to a local object in a return statement prevents copy elision. NFC.

    I added a diagnostic along the lines of `-Wpessimizing-move` to detect `return x = y` suppressing copy elision, but I don't know if the diagnostic is really worth it. Anyway, here are the places where my diagnostic reported that copy elision would have been possible if not for the assignment.

    P1155R1 in the post-San-Diego WG21 (C++ committee) mailing discusses whether WG21 should fix this pitfall by just changing the core language to permit copy elision in cases like these.

    (Kona update: The bulk of P1155 is proceeding to CWG review, but specifically *not* the parts that explored the notion of permitting copy-elision in these specific cases.)

    Reviewed By: dblaikie

    Author: Arthur O'Dwyer

    Differential Revision: https://reviews.llvm.org/D54885 (detail)
    by dblaikie
  127. [GlobalISel][AArch64] Make G_EXTRACT_VECTOR_ELT legal for v8s16s

    This case was missing before, so we couldn't legalize it.

    Add it to AArch64LegalizerInfo.cpp and update select-extract-vector-elt.mir. (detail)
    by paquette
  128. [ObjC][ARC] Let ARC optimizer bail out if the number of pointer states
    it keeps track of becomes too large

    ARC optimizer does a top-down and a bottom-up traversal of the whole
    function to pair up retain and release instructions and remove them.
    This can be expensive if the number of instructions in the function and
    pointer states it tracks are large since it has to look at each pointer
    state and determine whether the instruction being visited can
    potentially use the pointer.

    This patch adds a command line option that sets a limit to the number of
    pointers it tracks.

    rdar://problem/49477063

    Differential Revision: https://reviews.llvm.org/D61100 (detail)
    by ahatanak
  129. [AMDGPU] gfx1010 VOP1 instructions

    Differential Revision: https://reviews.llvm.org/D61099 (detail)
    by rampitec
  130. [AMDGPU] gfx1010 utility functions

    Differential Revision: https://reviews.llvm.org/D61094 (detail)
    by rampitec
  131. [GlobalISel][AArch64] Add generic legalization rule for extends

    This adds a legalization rule for G_ZEXT, G_ANYEXT, and G_SEXT which allows
    extends whenever the types will fit in registers (or the source is an s1).

    Update tests. Add GISel checks throughout all of arm64-vabs.ll,
    where we now select a good portion of the code. Add GISel checks to
    arm64-subvector-extend.ll, which has a good number of vector extends in it.

    Differential Revision: https://reviews.llvm.org/D60889 (detail)
    by paquette
  132. [SelectionDAG][X86] Use stack load/store in PromoteIntRes_BITCAST when the input needs to be be split and the output type is a vector.

    We had special case handling here, but it uses a scalar any_extend for the
    promotion then bitcasts to the final type. This won't split up the input data
    into multiple promoted elements like we need.

    This patch falls back to doing the conversion through memory.

    Fixes PR41594 which I believe was reflected in the bitcast-vector-bool.ll
    changes. The changes to vector-half-conversions.ll are fixing a previously
    unknown miscompile from this issue.

    Differential Revision: https://reviews.llvm.org/D61114 (detail)
    by ctopper
  133. [Evaluator] Walk initial elements when handling load through bitcast

    When evaluating a store through a bitcast, the evaluator tries to move the
    bitcast from the pointer onto the stored value. If the cast is invalid, it
    tries to "introspect" the type to get a valid cast by obtaining a pointer to
    the initial element (if the type is nested, this may require walking several
    initial elements).

    In some situations it is possible to get a bitcast on a load (e.g. with
    unions, where the bitcast may not be the same type as the store). However,
    equivalent logic to the store to introspect the type is missing. This patch
    add this logic.

    Note, when developing the patch I was unhappy with adding similar logic
    directly to the load case as it could get out of step. Instead, I have
    abstracted the "introspection" into a helper function, with the specifics
    being handled by a passed-in lambda function.

    Differential Revision: https://reviews.llvm.org/D60793 (detail)
    by rlougher
  134. [GlobalISel][AArch64] Legalize G_FNEARBYINT

    Add legalizer support for G_FNEARBYINT. It's the same as G_FCEIL etc.

    Since the importer allows us to automatically select this after legalization,
    also add tests for selection etc. Also update arm64-vfloatintrinsics.ll. (detail)
    by paquette
  135. [GlobalISel] Add IRTranslator support for G_FNEARBYINT

    Translate llvm.nearbyint into G_FNEARBYINT as a simple intrinsic. Update
    arm64-irtranslator.ll.

    Differential Revision: https://reviews.llvm.org/D60922 (detail)
    by paquette
  136. [GlobalISel] Add a G_FNEARBYINT opcode

    For eventually selecting llvm.nearbyint. Equivalent to the SelectionDAG
    nearbyint node.

    Update legalizer-info-validation.mir.

    Differential Revision: https://reviews.llvm.org/D60921 (detail)
    by paquette
  137. Revert "[JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows."

    This reverts r359169, as it broke one of the windows bots. (detail)
    by lhames
  138. gn build: Document llvm_enable_dia_sdk variable better (detail)
    by nico
  139. gn build: Make setting llvm_enable_dia_sdk=true work

    If this is set, %INCLUDE% must contain ".../DIA SDK/include"
    and %LIB% must contain ".../DIA SKD/lib/amd64" (assuming you're doing a
    64-bit build). (detail)
    by nico
  140. [InstCombine][X86] Tweak generic expansion of PACKSS/PACKUS to shuffle then truncate. NFCI.

    This has no effect on constant folding but will be useful when we expand non-saturating PACKSS/PACKUS intrinsics. (detail)
    by rksimon
  141. [Support] json::OStream::flush(), which passes through to the underlying stream (detail)
    by sammccall
  142. gn build: Merge r359179 (detail)
    by nico
  143. gn build: Merge r359174 (detail)
    by nico
  144. gn build: Merge r359142 (detail)
    by nico
  145. [Support] Add JSON streaming output API, faster where the heavy value types aren't needed.

    Summary:
    There's still a little bit of constant factor that could be trimmed (e.g.
    more overloads to avoid round-tripping primitives through json::Value).
    But this solves the memory scaling problem, and greatly improves the performance
    constant factor, and the API should leave room for optimization if needed.

    Adapt TimeProfiler to use it, eliminating almost all the performance regression
    from r358476.

    Performance test on my machine:
    perf stat -r 5 ~/llvmbuild-opt/bin/clang++ -w -S -ftime-trace -mllvm -time-trace-granularity=0 spirit.cpp

    Handcrafted JSON (HEAD=r358532 with r358476 reverted): 2480ms
    json::Value (HEAD): 2757ms (+11%)
    After this patch: 2520 ms (+1.6%)

    Reviewers: anton-afanasyev, lebedev.ri

    Subscribers: kristina, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60804 (detail)
    by sammccall
  146. [InstCombine][X86] Add PACKSS/PACKUS tests for truncation where saturation won't occur (detail)
    by rksimon
  147. [Support] Try to unbreak windows buildbot

    After r359179. (detail)
    by ibiryukov
  148. Parallel: only allow the first TaskGroup to run tasks parallelly

    Summary:
    Concurrent (e.g. nested) llvm::parallel::for_each() may lead to dead
    locks. See PR35788 (fixed by rLLD322041) and PR41508 (fixed by D60757).

    When parallel_for_each() is about to return, in ~Latch() called by
    ~TaskGroup(), a thread (in the default executor) may block in
    Latch::sync() waiting for Count to become zero. If all threads in the
    default executor are blocked, it is a dead lock.

    To fix this, force serial execution if the current TaskGroup is not the
    first one. For a nested llvm::parallel::for_each(), this parallelizes
    the outermost loop and serializes inner loops.

    Differential Revision: https://reviews.llvm.org/D61115 (detail)
    by maskray
  149. [llvm-objdump] Prep for adding newlines before and after "Disassembly of section ...:" (detail)
    by maskray
  150. [ConstantRange] [a, b) udiv a full range is [0, umax(b)).

    Reviewers: nikic, spatel, efriedma

    Reviewed By: nikic

    Differential Revision: https://reviews.llvm.org/D60536 (detail)
    by fhahn
  151. [Testing] Move clangd::Annotations to llvm testing support

    Summary:
    Annotations allow writing nice-looking unit test code when one needs
    access to locations from the source code, e.g. running code completion
    at particular offsets in a file. See comments in Annotations.cpp for
    more details on the API.

    Also got rid of a duplicate annotations parsing code in clang's code
    complete tests.

    Reviewers: gribozavr, sammccall

    Reviewed By: gribozavr

    Subscribers: mgorny, hiraditya, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D59814 (detail)
    by ibiryukov
  152. [yaml2obj] - Don't crash on invalid inputs.

    yaml2obj might crash on invalid input when unable to parse the YAML.

    Recently a crash with a very similar nature was fixed for an empty files.
    This patch revisits the fix and does it in yaml::Input instead.
    It seems to be more correct way to handle such situation.

    With that crash for invalid inputs is also fixed now.

    Differential revision: https://reviews.llvm.org/D61059 (detail)
    by grimar
  153. Fix include order. NFCI. (detail)
    by rksimon
  154. [X86][SSE] combineBitcastvxi1 - add support for bitcasting to non-scalar integers

    Truncate the movmsk scalar integer result to the equivalent scalar integer width as before but then bitcast to the requested type.

    We still have the issue identified in PR41594 but D61114 should handle this. (detail)
    by rksimon
  155. [Support] Add a GTest matcher for Optional<T>

    Reviewers: sammccall

    Reviewed By: sammccall

    Subscribers: mgorny, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61071 (detail)
    by ibiryukov
  156. [NFC][LoopIdiomRecognize] Some basic baseline tests for bcmp loop idiom

    Doubt this is the final test coverage, but this appears to have good
    coverage already, so i figure i might as well precommit it. (detail)
    by lebedevri
  157. [MIPS] Use custom bitcast lowering to avoid excessive instructions

    On Mips32r2 bitcast can be expanded to two sw instructions and an ldc1
    when using bitcast i64 to double or an sdc1 and two lw instructions when
    using bitcast double to i64. By introducing custom lowering that uses
    mtc1/mthc1 we can avoid excessive instructions.

    Patch by Mirko Brkusanin.

    Differential Revision: https://reviews.llvm.org/D61069 (detail)
    by atanasyan
  158. [X86] Remove part of an if condition that should always be true.

    The IndexReg will always be non-null at this point. Earlier in the function, if
    IndexReg was null we set it to CurDAG->getRegister(0, VT) which made it
    non-null. (detail)
    by ctopper
  159. [JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows.

    This should fix the MachO/x86-64 eh-frame regression test by ensuring that
    the symbols __ZTIi and ___gxx_personality_v0 are defined on all platforms. (detail)
    by lhames
  160. [llvm-rtdyld] Add support for passing command line arguments to rtdyld-run code.

    The --args option can now be used to pass arguments to code linked with
    llvm-rtdyld. E.g.

    $ llvm-rtdyld file1.o file2.o --args a b c

    is equivalent to:

    $ ld -o program file1.o file2.o
    $ ./program a b c

    This is the rtdyld counterpart to the jitlink change in r359115, and makes
    benchmarking and comparison between the tools easier. (detail)
    by lhames
  161. Enable LoopVectorization by default.

    Summary:
    When refactoring vectorization flags, vectorization was disabled by default in the new pass manager.
    This patch re-enables is for both managers, and changes the assumptions opt makes, based on the new defaults.
    Comments in opt.cpp should clarify the intended use of all flags to enable/disable vectorization.

    Reviewers: chandlerc, jgorbe

    Subscribers: jlebar, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61091 (detail)
    by asbirlea
  162. [llvm-objdump] errorToErrorCode+message -> toString

    For test/Object/elf-invalid-phdr.test, the intended error message got lost due to errorToErrorCode(). (detail)
    by maskray
  163. Consolidate existing utilities for interpreting vector predicate maskes [NFC] (detail)
    by reames
  164. Fix unused variable warning in LoopFusion pass.

    Do not wrap the contents of printFusionCandidates in the LLVM_DEBUG macro. This
    fixes an unused variable warning generated when compiling without asserts but
    with -DENABLE_LLVM_DUMP.

    Differential Revision: https://reviews.llvm.org/D61035 (detail)
    by kbarton
  165. [InstCombine] Be consistent w/handling of masked intrinsics style wise [NFC] (detail)
    by reames
  166. [utils] Add a lldb data formatter for llvm::SmallString.

    Result:

    (lldb) p val
    (llvm::SmallString<32>) $31 = "patatino" (detail)
    by davide
  167. Fix spelling error. NFC

    Summary: Test commit.

    Reviewers: msearles, jkorous

    Reviewed By: jkorous

    Subscribers: dexonsmith, arsenm, jvesely, nhaehnle, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61093 (detail)
    by kerbowa
  168. llvm-cvtres: Make new dupe resource error a bit friendlier

    For well-known type IDs, include the name of the type.

    To not duplicate the ID->name map, make llvm-readobj call this new
    function as well.  It has slightly different output, so this also
    requires updating a few tests.

    Differential Revision: https://reviews.llvm.org/D61086 (detail)
    by nico
  169. posix_spawn should retry upon EINTR

    Summary:
    We've seen cases of bots failing with:
      clang: error: unable to execute command: posix_spawn failed: Interrupted system call

    Add a small retry loop to posix_spawn in case this happens. Don't retry too much in case there's some systemic problem going on, but retry a few times.
    <rdar://problem/50181448>

    Reviewers: Bigcheese, arphaman

    Subscribers: jkorous, dexonsmith, kristina, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61096 (detail)
    by jfb
  170. Mark new jitlink test XFAIL for windows (detail)
    by rnk
  171. Recommitting r358783 and r358786 "[MS] Emit S_HEAPALLOCSITE debug info" with fixes for buildbot error (undefined assembler label).

    Summary:
    This emits labels around heapallocsite calls and S_HEAPALLOCSITE debug
    info in codeview. Currently only changes FastISel, so emitting labels still
    needs to be implemented in SelectionDAG.

    Reviewers: rnk

    Subscribers: aprantl, hiraditya, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D61083 (detail)
    by akhuang
  172. [DAGCombiner] scale repeated FP divisor by splat factor

    If we have a vector FP division with a splatted divisor, use the existing transform
    that converts 'x/y' into 'x * (1.0/y)' to allow more conversions. This can then
    potentially be converted into a scalar FP division by existing combines (rL358984)
    as seen in the tests here.

    That can be a potentially big perf difference if scalar fdiv has better timing
    (including avoiding possible frequency throttling for vector ops).

    Differential Revision: https://reviews.llvm.org/D61028 (detail)
    by spatel
  173. [PowerPC] Allow using initial-exec TLS with PIC

    Using initial-exec TLS variables is a reasonable performance
    optimisation for system libraries. Use the correct PIC mechanism to get
    hold of the GOT to avoid text relocations.

    Differential Revision: https://reviews.llvm.org/D61026 (detail)
    by joerg
  174. Add period at end of comment. (detail)
    by sfertile
  175. [X86] Attempt to fix use-after-poison from r359121. (detail)
    by ctopper
  176. [AMDGPU] gfx1010 SOP instructions

    Differential Revision: https://reviews.llvm.org/D61080 (detail)
    by rampitec
  177. [SLP] Fix crash after r358519, by V. Porpodas.

    Summary: The code did not check if operand was undef before casting it to Instruction.

    Reviewers: RKSimon, ABataev, dtemirbulatov

    Reviewed By: ABataev

    Subscribers: uabelho

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61024 (detail)
    by abataev
  178. Try once more to ensure constant initializaton of ManagedStatics

    First, use the old style of linker initialization for MSVC 2019 in
    addition to 2017. MSVC 2019 emits a dynamic initializer for
    ManagedStatic when compiled in debug mode, and according to zturner,
    also sometimes in release mode. I wasn't able to reproduce that, but it
    seems best to stick with the old code that works.

    When clang is using the MSVC STL, we have to give ManagedStatic a
    constexpr constructor that fully zero initializes all fields, otherwise
    it emits a dynamic initializer. The MSVC STL implementation of
    std::atomic has a non-trivial (but constexpr) default constructor that
    zero initializes the atomic value. Because one of the fields has a
    non-trivial constructor, ManagedStatic ends up with a non-trivial ctor.
    The ctor is not constexpr, so clang ends up emitting a dynamic
    initializer, even though it simply does zero initialization. To make it
    constexpr, we must initialize all fields of the ManagedStatic.

    However, while the constructor that takes a pointer is marked constexpr,
    clang says it does not evaluate to a constant because it contains a cast
    from a pointer to an integer. I filed this as:
    https://developercommunity.visualstudio.com/content/problem/545566/stdatomic-value-constructor-is-not-actually-conste.html

    Once we do that, we can add back the
    LLVM_REQUIRE_CONSTANT_INITIALIZATION marker, and so far as I'm aware it
    compiles successfully on all supported targets. (detail)
    by rnk
  179. Add optional arg to profile count getters to filter
    synthetic profile count.

    Differential Revision: http://reviews.llvm.org/D61025 (detail)
    by davidxl
  180. [X86] Prevent folding a load into an AND if that AND is really a ZEXT_INREG that should use movzx.

    This can save a 32-bit immediate move.

    We would shrink the load and fold it if it was non-volatile, but that's trickier to check for. (detail)
    by ctopper
  181. llvm-cvtres: Remove a default argument. No behavior change. (detail)
    by nico
  182. Revert using fcopyfile(3) to implement sys::fs::copy_file(Twine, int) on macOS

    It turns out that I mesread the man page and fcopyfile(3) does not
    actually support COPYFILE_CLONE for files.

    <rdar://problem/50148757> (detail)
    by adrian
  183. DebugInfo: Emit only declarations (not whole definitions) of non-unit user defined types into type units

    While this doesn't come up in reasonable cases currently (the only user
    defined types not in type units are ones without linkage - which makes
    for near-ODR violations, because it'd be a type with linkage referencing
    a type without linkage - such a type can't be validly defined in more
    than one TU, so arguably it shouldn't be in a type unit to begin with -
    but it's a convenient way to demonstrate an issue that will become more
    revalent with homed modular debug info type definitions - which also
    don't need to be in type units but more legitimately so).

    Precursor to the Clang change to de-type-unit (by omitting the
    'identifier') types homed due to strong linkage vtables. (making that
    change without this one would lead to major type duplication in type
    units) (detail)
    by dblaikie
  184. [X86] Remove dead nodes left after ReplaceAllUsesWith calls during address matching

    ReplaceAllUsesWith doesn't remove the node that was replaced. So its left around in the graph messing up use counts on other nodes.

    One thing to note, is that this isn't valid if the node being deleted is the root node of an LEA match that gets rejected. In that case the node needs to stay alive because the isel table walking code would still have a reference to it that its going to try to match next. I don't think that's the case here though because the nodes being deleted here should be "and", "srl", and "zero_extend" none of which can be the root node of an LEA match.

    Differential Revision: https://reviews.llvm.org/D61048 (detail)
    by ctopper
  185. [AMDGPU] gfx1010 sgpr register changes

    Differential Revision: https://reviews.llvm.org/D61045 (detail)
    by rampitec
  186. [X86][SSE] Add tests for bitcasting vXi1 bool vectors to non-simple types. (detail)
    by rksimon
  187. [JITLink] Add support for passing arguments to jit-linked code.

    The --args option can now be used to pass arguments to code linked with
    llvm-jitlink. E.g.

    $ llvm-jitlink file1.o file2.o --args a b c

    is equivalent to:

    $ ld -o program file1.o file2.o
    $ ./program a b c (detail)
    by lhames
  188. [LLVM-C] Deprecate the LLVMValueRef-returning metadata creation functions

    Summary: There is still some value in using these functions while the remaining LLVMValueRef-based accessors are still around, but LLVMMDNodeInContext in particular has some wonky semantics that make it worth replacing outright.

    Reviewers: whitequark, deadalnix

    Reviewed By: whitequark

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60524 (detail)
    by codafi
  189. [AMDGPU] Add gfx1010 target definitions

    Differential Revision: https://reviews.llvm.org/D61041 (detail)
    by rampitec
  190. [InstCombine][X86] Use generic expansion of PACKSS/PACKUS for constant folding. NFCI.

    This patch rewrites the existing PACKSS/PACKUS constant folding code to expand as a generic expansion.

    This is a first NFCI step toward expanding PACKSS/PACKUS intrinsics which are acting as non-saturating truncations (although technically the expansion could be used in all cases - but we'll probably want to be conservative). (detail)
    by rksimon
  191. Revert "[llvm-objdump] errorToErrorCode+message -> toString"

    Revert r359100

    It breaks llvm/test/Object/elf-invalid-phdr.test (detail)
    by jfb
  192. llvm-undname: Fix assert-on->4GiB-string-literal, found by oss-fuzz (detail)
    by nico
  193. [JITLink] Refer to FDE's CIE (not the most recent CIE) when parsing eh-frame.

    Frame Descriptor Entries (FDEs) have a pointer back to a Common Information
    Entry (CIE) that describes how the rest FDE should be parsed. JITLink had been
    assuming that FDEs always referred to the most recent CIE encountered, but the
    spec allows them to point back to any previously encountered CIE. This patch
    fixes JITLink to look up the correct CIE for the FDE.

    The testcase is a MachO binary with an FDE that refers to a CIE that is not the
    one immediately proceeding it (the layout can be viewed wit
    'dwarfdump --eh-frame <testcase>'. This test case had to be a binary as llvm-mc
    now sorts FDEs (as of r356216) to ensure FDEs *do* point to the most recent CIE. (detail)
    by lhames
  194. [llvm-objdump] Delete redundant check (detail)
    by maskray
  195. [obj2yamp] - Simplify and cleanup the code in ELFDumper<ELFT>::dumpGroup a bit. NFC.

    This makes the variables naming to match LLVM style,
    simplifies the code used to extract the group members,
    simplifies the loop and reorders the code around a bit. (detail)
    by grimar
  196. [llvm-objdump] errorToErrorCode+message -> toString (detail)
    by maskray
  197. [AMDGPU][MC] Parser cleanup and refactoring

    Reviewers: artem.tamazov, arsenm

    Differential Revision: https://reviews.llvm.org/D60767 (detail)
    by dpreobra
  198. [x86] make sure horizontal op and broadcast types match to simplify (PR41414)

    If the types don't match, we can't just remove the shuffle.
    There may be some other opportunity for optimization here,
    but this should prevent the crashing seen in:
    https://bugs.llvm.org/show_bug.cgi?id=41414 (detail)
    by spatel
  199. [LLVM-C] Use dyn_cast instead of unwrap in LLVMGetDebugLoc functions

    Summary:
    The `unwrap<Type>` calls can assert with:
    ```
    Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast
    ```
    so replace them with `dyn_cast`.

    Reviewers: whitequark, abdulras, hiraditya, compnerd

    Reviewed By: whitequark

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60473 (detail)
    by whitequark
  200. [yaml2obj] Replace num_zeros with write_zeros (detail)
    by maskray
  201. [yaml2elf] - Replace a loop with write_zeros(). NFC.

    And apply clang-format to the method changed. (detail)
    by grimar
  202. [X86] Add shouldFoldConstantShiftPairToMask override placeholder. NFCI.

    Prep work toward fixing PR40758 (detail)
    by rksimon
  203. Let llvm-cvtres (and lld-link) report duplicate resources

    If two .res files contain the same resource, cvtres.exe (and hence
    link.exe) reject the input with this message:

        CVTRES : fatal error CVT1100: duplicate resource.  type:STRING, name:101, language:0x0409
        LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

    llvm-cvtres (and lld-link) used to silently pick one of the duplicate
    resources instead. This patch makes them report an error as well.
    We slightly improve on cvtres by printing the name of two .res files
    containing duplicate entries as well.

    Differential Revision: https://reviews.llvm.org/D61049 (detail)
    by nico
  204. [X86][SSE] Add masked bit test cases for PR26697 (detail)
    by rksimon
  205. Add "const" in GetUnderlyingObjects. NFC

    Summary:
    Both the input Value pointer and the returned Value
    pointers in GetUnderlyingObjects are now declared as
    const.

    It turned out that all current (in-tree) uses of
    GetUnderlyingObjects were trivial to update, being
    satisfied with have those Value pointers declared
    as const. Actually, in the past several of the users
    had to use const_cast, just because of ValueTracking
    not providing a version of GetUnderlyingObjects with
    "const" Value pointers. With this patch we get rid
    of those const casts.

    Reviewers: hfinkel, materi, jkorous

    Reviewed By: jkorous

    Subscribers: dexonsmith, jkorous, jholewinski, sdardis, eraman, hiraditya, jrtc27, atanasyan, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61038 (detail)
    by bjope
  206. [Mips][CodeGen] Remove MachineFunction::setSubtarget. Change Mips to just copy the subtarget from the MachineFunction instead of recalculating it.

    Summary:
    The MachineFunction should have been created with the correct subtarget. As
    long as there is no way to change it, MipsTargetMachine can just capture it
    directly from the MachineFunction without calling getSubtargetImpl again.

    While there, const correct the Subtarget pointer to avoid a const_cast.

    I believe the Mips16Subtarget and NoMips16Subtarget members are never used, but
    I'll leave there removal for a separate patch.

    Reviewers: echristo, atanasyan

    Reviewed By: atanasyan

    Subscribers: sdardis, arichardson, hiraditya, jrtc27, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60936 (detail)
    by ctopper
  207. [CommandLine] Provide parser<unsigned long> instantiation to allow cl::opt<uint64_t> on LP64 platforms

    Summary:
    And migrate opt<unsigned long long> to opt<uint64_t>

    Fixes PR19665

    Differential Revision: https://reviews.llvm.org/D60933 (detail)
    by maskray
  208. llvm-cvtres: Accept /? as help flag, like cvtres.exe (detail)
    by nico
  209. gn build: Merge r359050 more (detail)
    by nico
  210. gn build: Merge r359050 (detail)
    by nico
  211. Revert [AliasAnalysis] AAResults preserves AAManager.

    Triggers use-after-free. (detail)
    by asbirlea
  212. [Remarks] Fix documentation indentation

    Fix the documentation bot:

    http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30450/steps/docs-llvm-html/logs/stdio (detail)
    by thegameg
  213. [Remarks] Add string deduplication using a string table

    * Add support for uniquing strings in the remark streamer and emitting the string table in the remarks section.

    * Add parsing support for the string table in the RemarkParser.

    From this remark:

    ```
    --- !Missed
    Pass:     inline
    Name:     NoDefinition
    DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
                Line: 7, Column: 3 }
    Function: printArgsNoRet
    Args:
      - Callee:   printf
      - String:   ' will not be inlined into '
      - Caller:   printArgsNoRet
        DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
                    Line: 6, Column: 0 }
      - String:   ' because its definition is unavailable'
    ...
    ```

    to:

    ```
    --- !Missed
    Pass: 0
    Name: 1
    DebugLoc: { File: 3, Line: 7, Column: 3 }
    Function: 2
    Args:
      - Callee:   4
      - String:   5
      - Caller:   2
        DebugLoc: { File: 3, Line: 6, Column: 0 }
      - String:   6
    ...
    ```

    And the string table in the .remarks/__remarks section containing:

    ```
    inline\0NoDefinition\0printArgsNoRet\0
    test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c\0printf\0
    will not be inlined into \0 because its definition is unavailable\0
    ```

    This is mostly supposed to be used for testing purposes, but it gives us
    a 2x reduction in the remark size, and is an incremental change for the
    updates to the remarks file format.

    Differential Revision: https://reviews.llvm.org/D60227 (detail)
    by thegameg
  214. [Lint] Permit aliasing noalias readonly arguments

    Summary:
    If two arguments are both readonly, then they have no memory dependency
    that would violate noalias, even if they do actually overlap.

    Reviewers: hfinkel, efriedma

    Reviewed By: efriedma

    Subscribers: efriedma, hiraditya, llvm-commits, tstellar

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60239 (detail)
    by cuviper
  215. [AArch64][GlobalISel] Select G_INTRINSIC_ROUND

    Add selection support for G_INTRINSIC_ROUND, add a selection test, and add
    check lines to arm64-vfloatintrinsics.ll and f16-instructions.ll. (detail)
    by paquette
  216. [AArch64][GlobalISel] Mark G_INTRINSIC_ROUND as a pre-isel floating point opcode

    Add G_INTRINSIC_ROUND to isPreISelGenericFloatingPointOpcode to ensure that its
    input and output are assigned the correct register bank.

    Add a regbankselect test to verify that we get what we expect here. (detail)
    by paquette
  217. The error message for mismatched value sites is very cryptic.
    Make it more readable for an average user.

    Differential Revision: https://reviews.llvm.org/D60896 (detail)
    by dmikulin
  218. [CMake] Use add_dependencies in add_llvm_install_targets

    Summary:
    The CMake documentation says that the `DEPENDS` field of
    add_custom_target is for files and output of custom commands. Adding a
    dependency on a target should be done with `add_dependency`.

    Differential Revision: https://reviews.llvm.org/D60879 (detail)
    by xiaobai
  219. [CGP] Look through bitcasts when duplicating returns for tail calls

    The simple case of:

    ```
    int *callee();
    void *caller(void *a) {
      if (a == NULL)
        return callee();
      return a;
    }
    ```

    would generate a regular call instead of a tail call because we don't
    look through the bitcast of the call to `callee` when duplicating the
    return blocks.

    Differential Revision: https://reviews.llvm.org/D60837 (detail)
    by thegameg
  220. [X86] Add codegen prepare test exercising a bitcast + tail call

    In preparation of https://reviews.llvm.org/D60837, add this test where
    we don't perform a tail call because we don't look through a bitcast. (detail)
    by thegameg
  221. [WebAssembly] Emit br_table for most switch instructions

    Summary:
    Always convert switches to br_tables unless there is only one case,
    which is equivalent to a simple branch. This reduces code size for wasm,
    and we defer possible jump table optimizations to the VM.
    Addresses PR41502.

    Reviewers: kripken, sunfish

    Subscribers: dschuff, sbc100, jgravelle-google, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60966 (detail)
    by aheejin
  222. [WebAssembly] Make LBB markers not affected by test order

    Summary:
    This way we can change the order of tests or delete some of them without
    affecting tests for other functions.

    Reviewers: tlively

    Subscribers: sunfish, dschuff, sbc100, jgravelle-google, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60929 (detail)
    by aheejin
  223. Revert "[MS] Emit S_HEAPALLOCSITE debug info" because of ToTWin64(db)
    buildbot failure.

    This reverts commit d07d6d617713bececf57f3547434dd52f0f13f9e and
    c774f687b6880484a126ed3e3d737e74c926f0ae. (detail)
    by akhuang
  224. [AArch64][GlobalISel] Legalize G_INTRINSIC_ROUND

    Add it to the same rule as G_FCEIL etc. Add a legalizer test, and add a missing
    switch case to AArch64LegalizerInfo.cpp. (detail)
    by paquette
  225. [MemorySSA] LCSSA preserves MemorySSA.

    Summary:
    Enabling MemorySSA in the old pass manager leads to MemorySSA being run
    twice due to the fact that LCSSA and LoopSimplify do not preserve
    MemorySSA. This is the first step to address that: target LCSSA.

    LCSSA does not make any changes that invalidate MemorySSA, so it
    preserves it by design. It must preserve AA as well, for this to hold.

    After this patch, MemorySSA is still run twice in the old pass manager.
    Step two follows: target LoopSimplify.

    Subscribers: mehdi_amini, jlebar, Prazek, llvm-commits, george.burgess.iv, chandlerc

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60832 (detail)
    by asbirlea
  226. [X86] Autogenerate complete checks. NFC

    Prep for D60993 (detail)
    by ctopper
  227. [AArch64][GlobalISel] Actually select G_INTRINSIC_TRUNC

    Apparently FileCheck wasn't actually matching the fallback check lines in
    arm64-vfloatintrinsics.ll properly. So, there were selection fallbacks for
    G_INTRINSIC_TRUNC there.

    Actually hook it up into AArch64InstructionSelector.cpp and write a proper
    selection test.

    I guess I'll figure out the FileCheck magic to make the fallback checks work
    properly in arm64-vfloatintrinsics.ll. (detail)
    by paquette
  228. [ObjC][ARC] Check the basic block size before calling
    DominatorTree::dominate.

    ARC contract pass has an optimization that replaces the uses of the
    argument of an ObjC runtime function call with the call result.

    For example:

    ; Before optimization
    %1 = tail call i8* @foo1()
    %2 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %1)
    store i8* %1, i8** @g0, align 8

    ; After optimization
    %1 = tail call i8* @foo1()
    %2 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %1)
    store i8* %2, i8** @g0, align 8 // %1 is replaced with %2

    Before replacing the argument use, DominatorTree::dominate is called to
    determine whether the user instruction is dominated by the ObjC runtime
    function call instruction. The call to DominatorTree::dominate can be
    expensive if the two instructions belong to the same basic block and the
    size of the basic block is large. This patch checks the basic block size
    and just bails out if the size exceeds the limit set by command line
    option "arc-contract-max-bb-size".

    rdar://problem/49477063

    Differential Revision: https://reviews.llvm.org/D60900 (detail)
    by ahatanak
  229. Reapply: "DebugInfo: Emit only one kind of accelerated access/name table""

    Originally committed in r358931
    Reverted in r358997

    Seems this change made Apple accelerator tables miss names (because
    names started respecting the CU NameTableKind GNU & assuming that
    shouldn't produce accelerated names too), which is never correct (apple
    accelerator tables don't have separators or CU lists - if present, they
    must describe all names in all CUs).

    Original Description:
    Currently to opt in to debug_names in DWARFv5, the IR must contain
    'nameTableKind: Default' which also enables debug_pubnames.

    Instead, only allow one of {debug_names, apple_names, debug_pubnames,
    debug_gnu_pubnames}.

    nameTableKind: Default gives debug_names in DWARFv5 and greater,
    debug_pubnames in v4 and earlier - and apple_names when tuning for lldb
    on MachO.
    nameTableKind: GNU always gives gnu_pubnames (detail)
    by dblaikie
  230. [ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PM

    Summary:
    The opt level was not being passed down to the ThinLTO backend when
    invoked via clang (for distributed ThinLTO).

    This exposed an issue where the new PM was asserting if the Thin or
    regular LTO backend pipelines were invoked with -O0 (not a new issue,
    could be provoked by invoking in-process *LTO backends via linker using
    new PM and -O0). Fix this similar to the old PM where -O0 only does the
    necessary lowering of type metadata (WPD and LowerTypeTest passes) and
    then quits, rather than asserting.

    Reviewers: xur

    Subscribers: mehdi_amini, inglorion, eraman, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits, pcc

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D61022 (detail)
    by tejohnson
  231. llvm-cvtres: Split addChild(ID) into two functions

    Before, there was an IsData parameter. Now, there are two different
    functions for data nodes and ID nodes. No behavior change, needed for a
    follow-up change to make two data nodes (but not two ID nodes) with the
    same ID an error.

    For consistency, rename another addChild() overload to addNameChild(). (detail)
    by nico
  232. [AArch64][GlobalISel] Teach regbankselect about G_INTRINSIC_TRUNC

    Add it to isPreISelGenericFloatingPointOpcode, and add a regbankselect test.

    Update arm64-vfloatintrinsics.ll now that we can select it. (detail)
    by paquette
  233. [AArch64][GlobalISel] Legalize G_INTRINSIC_TRUNC

    Same patch as G_FCEIL etc.

    Add the missing switch case in widenScalar, add G_INTRINSIC_TRUNC to the correct
    rule in AArch64LegalizerInfo.cpp, and add a test. (detail)
    by paquette
  234. [ConstantRange] Add urem support

    Add urem support to ConstantRange, so we can handle in in LVI. This
    is an approximate implementation that tries to capture the most useful
    conditions: If the LHS is always strictly smaller than the RHS, then
    the urem is a no-op and the result is the same as the LHS range.
    Otherwise the lower bound is zero and the upper bound is
    min(LHSMax, RHSMax - 1).

    Differential Revision: https://reviews.llvm.org/D60952 (detail)
    by nikic
  235. [ConstantRangeTest] Move helper methods; NFC

    Move Test(Unsigned|Signed)BinOpExhaustive() towards the top of the
    file, so they're easier to reuse. (detail)
    by nikic
  236. [AMDGPU] Fixed addReg() in SIOptimizeExecMaskingPreRA.cpp

    The second argument is flags, not subreg.

    Differential Revision: https://reviews.llvm.org/D61031 (detail)
    by rampitec
  237. [AArch64][GlobalISel] Legalize G_FMA for more vector types

    Same as G_FCEIL, G_FABS, etc. Just move it into that rule.

    Add a legalizer test for G_FMA, which we didn't have before and update
    arm64-vfloatintrinsics.ll. (detail)
    by paquette
  238. [AliasAnalysis] AAResults preserves AAManager.

    Summary:
    AAResults should not invalidate AAManager.
    Update tests.

    Reviewers: chandlerc

    Subscribers: mehdi_amini, jlebar, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60914 (detail)
    by asbirlea
  239. [AArch64][GlobalISel] Add G_FMA to isPreISelGenericFloatingPointOpcode

    Noticed an unnecessary fallback in arm64-vmul caused by this.

    Also add a regbankselect test for G_FMA. (detail)
    by paquette
  240. [APSInt][OpenMP] Fix isNegative, etc. for unsigned types

    Without this patch, APSInt inherits APInt::isNegative, which merely
    checks the sign bit without regard to whether the type is actually
    signed.  isNonNegative and isStrictlyPositive call isNegative and so
    are also affected.

    This patch adjusts APSInt to override isNegative, isNonNegative, and
    isStrictlyPositive with implementations that consider whether the type
    is signed.

    A large set of Clang OpenMP tests are affected.  Without this patch,
    these tests assume that `true` is not a valid argument for clauses
    like `collapse`.  Indeed, `true` fails APInt::isStrictlyPositive but
    not APSInt::isStrictlyPositive.  This patch adjusts those tests to
    assume `true` should be accepted.

    This patch also adds tests revealing various other similar fixes due
    to APSInt::isNegative calls in Clang's ExprConstant.cpp and
    SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object
    size based on `alloc_size`, `<<` and `>>` shift count validation, and
    OpenMP array section validation.

    Reviewed By: lebedev.ri, ABataev, hfinkel

    Differential Revision: https://reviews.llvm.org/D59712 (detail)
    by jdenny
  241. [dsymutil] Put Swift interface files into a per-arch subdirectory.

    This was meant to be part of the original commit r358921, but somehow
    got lost.

    <rdar://problem/49751748> (detail)
    by adrian
  242. [x86] fix test checks for fdiv combine; NFC

    Must have picked up some transient code changes when originally generating this. (detail)
    by spatel
  243. llvm-undname: Support demangling the spaceship operator

    Also add a test for demanling the co_await operator. (detail)
    by nico
  244. [x86] add tests for vector fdiv with splat divisor; NFC (detail)
    by spatel
  245. [dsymutil] Fix use-after-free when sys::path::append grows the buffer.

    <rdar://problem/50117620> (detail)
    by adrian
  246. Revert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer." (detail)
    by adrian
  247. [dsymutil] Fix use-after-free when sys::path::append grows the buffer.

    <rdar://problem/50117620> (detail)
    by adrian
  248. [InstCombine] Convert a masked.load of a dereferenceable address to an unconditional load

    If we have a masked.load from a location we know to be dereferenceable, we can simply issue a speculative unconditional load against that address. The key advantage is that it produces IR which is well understood by the optimizer. The select (cnd, load, passthrough) form produced should be pattern matchable back to hardware predication if profitable.

    Differential Revision: https://reviews.llvm.org/D59703 (detail)
    by reames
  249. [x86] use psubus for more vsetcc lowering (PR39859)

    Circling back to a leftover bit from PR39859:
    https://bugs.llvm.org/show_bug.cgi?id=39859#c1

    ...we have this counter-intuitive (based on the test diffs) opportunity to use 'psubus'.
    This appears to be the better perf option for both Haswell and Jaguar based on llvm-mca.
    We already do this transform for the SETULT predicate, so this makes the code more
    symmetrical too. If we have pminub/pminuw, we prefer those, so this should not affect
    anything but pre-SSE4.1 subtargets.

      $ cat before.s
    movdqa -16(%rip), %xmm2    ## xmm2 = [32768,32768,32768,32768,32768,32768,32768,32768]
    pxor %xmm0, %xmm2
    pcmpgtw -32(%rip), %xmm2 ## xmm2 = [255,255,255,255,255,255,255,255]
    pand %xmm2, %xmm0
    pandn %xmm1, %xmm2
    por %xmm2, %xmm0

      $ cat after.s
    movdqa -16(%rip), %xmm2    ## xmm2 = [256,256,256,256,256,256,256,256]
    psubusw %xmm0, %xmm2
    pxor %xmm3, %xmm3
    pcmpeqw %xmm2, %xmm3
    pand %xmm3, %xmm0
    pandn %xmm1, %xmm3
    por %xmm3, %xmm0

      $ llvm-mca before.s -mcpu=haswell
      Iterations:        100
      Instructions:      600
      Total Cycles:      909
      Total uOps:        700

      Dispatch Width:    4
      uOps Per Cycle:    0.77
      IPC:               0.66
      Block RThroughput: 1.8

      $ llvm-mca after.s -mcpu=haswell
      Iterations:        100
      Instructions:      700
      Total Cycles:      409
      Total uOps:        700

      Dispatch Width:    4
      uOps Per Cycle:    1.71
      IPC:               1.71
      Block RThroughput: 1.8

    Differential Revision: https://reviews.llvm.org/D60838 (detail)
    by spatel
  250. [SPARC] Use the correct register set for the "r" asm constraint.

    64bit mode must use 64bit registers, otherwise assumptions about the top
    half of the registers are made. Problem found by Takeshi Nakayama in
    NetBSD. (detail)
    by joerg
  251. Revert "DebugInfo: Emit only one kind of accelerated access/name table"

    Regresses some apple_names situations - still investigating.

    This reverts commit r358931. (detail)
    by dblaikie
  252. Use llvm::stable_sort

    While touching the code, simplify if feasible. (detail)
    by maskray
  253. [RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers

    This patch adds support for parsing and assembling the %tls_ie_pcrel_hi
    and %tls_gd_pcrel_hi modifiers.

    Differential Revision: https://reviews.llvm.org/D55342 (detail)
    by lewis-revill
  254. gn build: Merge r358944 (detail)
    by nico
  255. [AMDGPU] Fix hidden argument metadata duplication for V3

    Essentially complete a proper rebase of the V3 metadata change over
    https://reviews.llvm.org/D49096.

    Minimize the diff between the V2 and V3 variants of the relevant lit
    tests, and clean up some trailing whitespace. (detail)
    by scott.linder
  256. gn build: Merge r358949 (detail)
    by nico
  257. [X86] Pull out collectConcatOps helper. NFCI.

    Create collectConcatOps helper that returns all the subvector ops for CONCAT_VECTORS or a INSERT_SUBVECTOR series. (detail)
    by rksimon
  258. ARM: disallow add/sub to sp unless Rn is also sp.

    The manual says that Thumb2 add/sub instructions are only allowed to modify sp
    if the first source is also sp. This is slightly different from the usual rGPR
    restriction since it's context-sensitive, so implement it in C++. (detail)
    by tnorthover
  259. [Docs] ReleaseNotes: fixup markup in memcmp()->bcmp() entry (detail)
    by lebedevri
  260. [DAGCombiner] generalize binop-of-splats scalarization

    If we only match build vectors, we can miss some patterns
    that use shuffles as seen in the affected tests.

    Note that the underlying calls within getSplatSourceVector()
    have the potential for compile-time explosion because of
    exponential recursion looking through binop opcodes, but
    currently the list of supported opcodes is very limited.
    Both of those problems should be addressed in follow-up
    patches. (detail)
    by spatel
  261. AMDGPU: Fix LCSSA phi lowering in SILowerI1Copies

    Summary:
    When an LCSSA phi survives through instruction selection, the pass
    ends up removing that phi entirely because it is dominated by the
    logic that does the lanemask merging.

    This then used to trigger an assertion when processing a dependent
    phi instruction.

    Change-Id: Id4949719f8298062fe476a25718acccc109113b6

    Reviewers: llvm-commits

    Subscribers: kzhuravl, jvesely, wdng, yaxunl, t-tye, tpr, dstuttard, rtaylor, arsenm

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60999 (detail)
    by nha
  262. [CallSite removal] move InlineCost to CallBase usage

    Converting InlineCost interface and its internals into CallBase usage.
    Inliners themselves are still not converted.

    Reviewed By: reames
    Tags: #llvm
    Differential Revision: https://reviews.llvm.org/D60636 (detail)
    by fedor.sergeev
  263. Removing the explicit specifier from some default constructors; NFC. (detail)
    by aaronballman
  264. [ARM] Update check for CBZ in Ifcvt

    The check for creating CBZ in constant island pass recently obtained the
    ability to search backwards to find a Cmp instruction. The code in IfCvt should
    mirror this to allow more conversions to the smaller form. The common code has
    been pulled out into a separate function to be shared between the two places.

    Differential Revision: https://reviews.llvm.org/D60090 (detail)
    by dmgreen
  265. [ARM] Don't replicate instructions in Ifcvt at minsize

    Ifcvt can replicate instructions as it converts them to be predicated. This
    stops that from happening on thumb2 targets at minsize where an extra IT
    instruction is likely needed.

    Differential Revision: https://reviews.llvm.org/D60089 (detail)
    by dmgreen
  266. Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI. (detail)
    by rksimon
  267. Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI. (detail)
    by rksimon
  268. [DAGCombiner] Combine OR as ADD when no common bits are set

    Summary:
    The DAGCombiner is rewriting (canonicalizing) an ISD::ADD
    with no common bits set in the operands as an ISD::OR node.

    This could sometimes result in "missing out" on some
    combines that normally are performed for ADD. To be more
    specific this could happen if we already have rewritten an
    ADD into OR, and later (after legalizations or combines)
    we expose patterns that could have been optimized if we
    had seen the OR as an ADD (e.g. reassociations based on ADD).

    To make the DAG combiner less sensitive to if ADD or OR is
    used for these "no common bits set" ADD/OR operations we
    now apply most of the ADD combines also to an OR operation,
    when value tracking indicates that the operands have no
    common bits set.

    Reviewers: spatel, RKSimon, craig.topper, kparzysz

    Reviewed By: spatel

    Subscribers: arsenm, rampitec, lebedev.ri, jvesely, nhaehnle, hiraditya, javed.absar, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D59758 (detail)
    by bjope
  269. [AArch64] Add support for MTE intrinsics

    This patch provides intrinsics support for Memory Tagging Extension (MTE),
    which was introduced with the Armv8.5-a architecture.
    The intrinsics are described in detail in the latest
    ACLE Q1 2019 documentation: https://developer.arm.com/docs/101028/latest
    Reviewed by: David Spickett
    Differential Revision: https://reviews.llvm.org/D60486 (detail)
    by javed.absar
  270. [ARM][FIX] Add missing f16.lane.vldN/vstN lowering

    Summary:
    Add missing D and Q lane VLDSTLane lowering
    for fp16 elements.

    Reviewers: efriedma, kosarev, SjoerdMeijer, ostannard

    Reviewed By: efriedma

    Subscribers: javed.absar, kristof.beyls, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60874 (detail)
    by dnsampaio
  271. [llvm-mc] - Properly set the the address align field of the compressed sections.

    About the compressed sections spec says:
    (https://docs.oracle.com/cd/E37838_01/html/E36783/section_compression.html)
    sh_addralign fields of the section header for a compressed section
    reflect the requirements of the compressed section.

    Currently, llvm-mc always puts uncompressed section alignment to sh_addralign.
    It is not correct. zlib styled section contains an Elfxx_Chdr header,
    so we should either use 4 or 8 values depending on the target
    (Uncompressed section alignment is stored in ch_addralign field of the compression header).

    GNU assembler version 2.31.1 also has this issue,
    but in 2.32.51 it was already fixed. This is how it was found
    during debugging of the https://bugs.llvm.org/show_bug.cgi?id=40482
    actually.

    Differential revision: https://reviews.llvm.org/D60965 (detail)
    by grimar
  272. [LSR] Limit the recursion for setup cost

    In some circumstances we can end up with setup costs that are very complex to
    compute, even though the scevs are not very complex to create. This can also
    lead to setupcosts that are calculated to be exactly -1, which LSR treats as an
    invalid cost. This patch puts a limit on the recursion depth for setup cost to
    prevent them taking too long.

    Thanks to @reames for the report and test case.

    Differential Revision: https://reviews.llvm.org/D60944 (detail)
    by dmgreen
  273. [WebAssembly] Bail out of fastisel earlier when computing PIC addresses

    This change partially reverts https://reviews.llvm.org/D54647 in favor
    of bailing out during computeAddress instead.

    This catches the condition earlier and handles more cases.

    Differential Revision: https://reviews.llvm.org/D60986 (detail)
    by sbc
  274. add Qiu Chaofan (qiucf@cn.ibm.com) to the CREDITS.txt (detail)
    by chaofan
  275. Revert "Use const DebugLoc&"

    This reverts r358910 (git commit 2b744665308fc8d30a3baecb4947f2bd81aa7d30)

    While this patch *seems* trivial and safe and correct, it is not. The
    copies are actually load bearing copies. You can observe this with MSan
    or other ways of checking for use-after-destroy, but otherwise this may
    result in ... difficult to debug inexplicable behavior.

    I suspect the issue is that the debug location is used after the
    original reference to it is removed. The metadata backing it gets
    destroyed as its last references goes away, and then we reference it
    later through these const references. (detail)
    by chandlerc
  276. [CMake] Replace the sanitizer support in runtimes build with multilib

    This is a more generic solution; while the sanitizer support can be used
    only for sanitizer instrumented builds, the multilib support can be used
    to build other variants such as noexcept which is what we would like to use
    in Fuchsia.

    The name CMake target name uses the target name, same as for the regular
    runtimes build and the name of the multilib, concatenated with '+'. The
    libraries are installed in a subdirectory named after the multilib.

    Differential Revision: https://reviews.llvm.org/D60926 (detail)
    by phosek
  277. Fully qualify llvm::Optional, some compilers complain otherwise. (detail)
    by adrian
  278. DebugInfo: Emit only one kind of accelerated access/name table

    Currently to opt in to debug_names in DWARFv5, the IR must contain
    'nameTableKind: Default' which also enables debug_pubnames.

    Instead, only allow one of {debug_names, apple_names, debug_pubnames,
    debug_gnu_pubnames}.

    nameTableKind: Default gives debug_names in DWARFv5 and greater,
    debug_pubnames in v4 and earlier - and apple_names when tuning for lldb
    on MachO.
    nameTableKind: GNU always gives gnu_pubnames (detail)
    by dblaikie
  279. [SelectionDAG] move splat util functions up from x86 lowering

    This was supposed to be NFC, but the change in SDLoc
    definitions causes instruction scheduling changes.

    There's nothing x86-specific in this code, and it can
    likely be used from DAGCombiner's simplifyVBinOp(). (detail)
    by spatel
  280. Try to work around compile errors with older versions of GCC. (detail)
    by adrian
  281. Relax test to check for a valid number instead of a specific number. (detail)
    by dyung
  282. [AMDGPU] Fix an issue in `op_sel_hi` skipping.

    Summary:
    - Only apply packed literal `op_sel_hi` skipping on operands requiring
      packed literals. Even an instruction is `packed`, it may have operand
      requiring non-packed literal, such as `v_dot2_f32_f16`.

    Reviewers: rampitec, arsenm, kzhuravl

    Subscribers: jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60978 (detail)
    by hliao
  283. [dsymutil] Collect parseable Swift interfaces in the .dSYM bundle.

    When a Swift module built with debug info imports a library without
    debug info from a textual interface, the textual interface is
    necessary to reconstruct types defined in the library's interface. By
    recording the Swift interface files in DWARF dsymutil can collect them
    and LLDB can find them.

    This patch teaches dsymutil to look for DW_TAG_imported_modules and
    records all references to parseable Swift ingterfrace files and copies
    them to

      a.out.dSYM/Contents/Resources/<Arch>/<ModuleName>.swiftinterface

    <rdar://problem/49751748> (detail)
    by adrian
  284. [InstCombine] Eliminate stores to constant memory

    If we have a store to a piece of memory which is known constant, then we know the store must be storing back the same value. As a result, the store (or memset, or memmove) must either be down a dead path, or a noop. In either case, it is valid to simply remove the store.

    The motivating case for this involves a memmove to a buffer which is constant down a path which is dynamically dead.

    Note that I'm choosing to implement the less aggressive of two possible semantics here. We could simply say that the store *is undefined*, and prune the path. Consensus in the review was that the more aggressive form might be a good follow on change at a later date.

    Differential Revision: https://reviews.llvm.org/D60659 (detail)
    by reames
  285. [Support] unflake TempFileCollisions test

    Summary:
    This test was added to verify that createUniqueEntity() does
    not enter an infinite loop when all possible names are taken. However,
    it also checked that all possible names are generated, which is flaky
    (because the names are generated randomly). This change increases the
    number of attempts we make to make flakes exceedingly
    unlikely (3.88e-62).

    Reviewers: fedor.sergeev, rsmith

    Reviewed By: fedor.sergeev

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D56336 (detail)
    by inglorion
  286. [InstSimplify] Move masked.gather w/no active lanes handling to InstSimplify from InstCombine

    In the process, use the existing masked.load combine which is slightly stronger, and handles a mix of zero and undef elements in the mask. (detail)
    by reames
  287. gn build: Merge r358869 (detail)
    by nico
  288. Use const DebugLoc& (detail)
    by arsenm
  289. AMDGPU: Skip debug instructions in assert

    These are inserted after branch relaxation, and for some reason it's
    decided to put them in the long branch expansion block. It's probably
    not great to rely on the source block address, so this should probably
    be switched to being PC relative instead of relying on the block
    address (detail)
    by arsenm
  290. [Tests] Revise a test as requested by reviewer in D59703 (detail)
    by reames
  291. [Tests] Add a negative test for masked.gather part of D59703 (detail)
    by reames
  292. [IPSCCP] Add missing `AssumptionCacheTracker` dependency

    Back in August, r340525 introduced a dependency on the assumption
    cache tracker in the ipsccp pass, but that commit missed a call to
    INITIALIZE_PASS_DEPENDENCY, which leaves the assumption cache
    improperly registered if SCCP is the only thing that pulls it in. (detail)
    by bogner
  293. [LPM/BPI] Preserve BPI through trivial loop pass pipeline (e.g. LCSSA, LoopSimplify)

    Currently, we do not expose BPI to loop passes at all. In the old pass manager, we appear to have been ignoring the fact that LCSSA and/or LoopSimplify didn't preserve BPI, and making it available to the following loop passes anyways.  In the new one, it's invalidated before running any loop pass if either LCSSA or LoopSimplify actually make changes. If they don't make changes, then BPI is valid and available.  So, we go ahead and teach LCSSA and LoopSimplify how to preserve BPI for consistency between old and new pass managers.

    This patch avoids an invalidation between the two requires in the following trivial pass pipeline:
    opt -passes="requires<branch-prob>,loop(no-op-loop),requires<branch-prob>"
    (when the input file is one which requires either LCSSA or LoopSimplify to canonicalize the loops)

    Differential Revision: https://reviews.llvm.org/D60790 (detail)
    by reames
  294. [PGO/SamplePGO][NFC] Move the function updateProfWeight from Instruction
    to CallInst.

    The issue was raised here: https://reviews.llvm.org/D60903#1472783

    The function Instruction::updateProfWeight is only used for CallInst in
    profile update. From the current interface, it is very easy to think that
    the function can also be used for branch instruction. However, Branch
    instruction does't need the scaling the function provides for
    branch_weights and VP (value profile), in addition, scaling may introduce
    inaccuracy for branch probablity.

    The patch moves the function updateProfWeight from Instruction class to
    CallInst to remove the confusion. The patch also changes the scaling of
    branch_weights from a loop to a block because we know that ProfileData
    for branch_weights of CallInst will only have two operands at most.

    Differential Revision: https://reviews.llvm.org/D60911 (detail)
    by wmi
  295. Use llvm::stable_sort. NFC (detail)
    by maskray
  296. Remove spurious semicolons; NFC. (detail)
    by aaronballman
  297. AMDGPU/GlobalISel: Fix non-power-of-2 G_EXTRACT sources (detail)
    by arsenm
  298. STLExtras: add stable_sort wrappers (detail)
    by maskray
  299. GlobalISel: Legalize scalar G_EXTRACT sources (detail)
    by arsenm
  300. llvm-undname: Fix an assert-on-invalid, found by oss-fuzz (detail)
    by nico
  301. AMDGPU: Fix not checking for copy when looking at copy src

    Effectively reverts r356956. The check for isFullCopy was excessive,
    but there still needs to be a check that this is a copy. (detail)
    by arsenm
  302. [AMDGPU][MC] Corrected parsing of SP3 'neg' modifier

    See bug 41156: https://bugs.llvm.org/show_bug.cgi?id=41156

    Reviewers: artem.tamazov, arsenm

    Differential Revision: https://reviews.llvm.org/D60624 (detail)
    by dpreobra
  303. [TargetLowering][AMDGPU][X86] Improve SimplifyDemandedBits bitcast handling

    This patch adds support for BigBitWidth -> SmallBitWidth bitcasts, splitting the DemandedBits/Elts accordingly.

    The AMDGPU backend needed an extra  (srl (and x, c1 << c2), c2) -> (and (srl(x, c2), c1) combine to encourage BFE creation, I investigated putting this in DAGCombine but it caused a lot of noise on other targets - some improvements, some regressions.

    The X86 changes are all definite wins.

    Differential Revision: https://reviews.llvm.org/D60462 (detail)
    by rksimon
  304. [DAGCombiner] make variable name less ambiguous; NFC (detail)
    by spatel
  305. [DAGCombiner] prepare shuffle-of-splat to handle more patterns; NFC (detail)
    by spatel
  306. [LLVM-C] Add accessors to the default floating-point metadata node

    Summary: Add a getter and setter pair for floating-point accuracy metadata.

    Reviewers: whitequark, deadalnix

    Reviewed By: whitequark

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60527 (detail)
    by codafi
  307. [NewPM] Add Option handling for SimpleLoopUnswitch

    This patch enables passing options to SimpleLoopUnswitch via the passes pipeline.

    Reviewers: chandlerc, fedor.sergeev, leonardchan, philip.pfaffe
    Reviewed By: fedor.sergeev
    Subscribers: llvm-commits
    Differential Revision: https://reviews.llvm.org/D60676 (detail)
    by skatkov
  308. [AMDGPU] Regenerate uitofp i8 to float conversion tests.

    Prep work for D60462 (detail)
    by rksimon
  309. [NewPM] Add dummy Test for LoopVectorize option parsing. (detail)
    by skatkov
  310. Revert "[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC"

    This reverts commit 7bf4d7c07f2fac862ef34c82ad0fef6513452445.

    After thinking about this more, this isn't right, the range is not exact
    in the same sense as makeExactICmpRegion(). This needs a separate
    function. (detail)
    by nikic
  311. [ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC

    Following D60632 makeGuaranteedNoWrapRegion() always returns an
    exact nowrap region. Rename the function accordingly. This is in
    line with the naming of makeExactICmpRegion(). (detail)
    by nikic
  312. [X86] Reject 512-bit types in getRegForInlineAsmConstraint when AVX512 is not enabled. Same for 256 bit and AVX. (detail)
    by ctopper
  313. [JITLink] Remove a lot of reduntant 'JITLink_' prefixes. NFC. (detail)
    by lhames
  314. [cmake] Add llvm-jit to LLVM_TEST_DEPENDS

    Otherwise llvm-jit would say "utils/lit/lit/llvm/subst.py:127: note: Did not find llvm-jitlink in ..." (detail)
    by maskray
  315. [JITLink] Fix section start address calculation in eh-frame recorder.

    Section atoms are not sorted, so we need to scan the whole section to find the
    start address.

    No test case: Found by inspection, and any reproduction would depend on pointer
    ordering. (detail)
    by lhames
  316. Attemp get llvm-jitlink building on Windows

    By removing an include of dlfcn.h that looks unused.

    And clang-format a too-long line while here. (detail)
    by nico
  317. [JITLink] Add an option to dump relocated section content.

    The -dump-relocated-section-content option will dump the contents of each
    section after relocations are applied, and before any checks are run or
    code executed. (detail)
    by lhames
  318. gn build: Re-run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format` (detail)
    by nico
  319. gn build: Merge r358749

    Since the symlinks list for llvm-symbolizer is now never empty,
    the :symlinks target no longer needs an explicit dep on :llvm-symbolizer
    -- there will be at least one dep on a symlink, and each symlink depends
    on :llvm-symbolizer already.

    Since llvm-symbolizer:symlinks now produces symlinks that check-llvm
    uses, make llvm/test depend on the symlink target. (detail)
    by nico
  320. gn build: Merge r358818 (JITLink) (detail)
    by nico
  321. [cmake] Fix bug in r358779 - [CMake] Pass monorepo build settings in cross compile

    Escape semicolons in the targets list so that cmake doesn't expand
    them to spaces. (detail)
    by dhinton
  322. llvm-undname: Fix hex escapes in wchar_t, char16_t, char32_t strings

    llvm-undname used to put '\x' in front of every pair of nibbles, but
    u"\xD7\xFF" produces a string with 6 bytes: \xD7 \0 \xFF \0 (and \0\0). Correct
    for a single character (plus terminating \0) is u\xD7FF instead.
    Now, wchar_t, char16_t, and char32_t strings roundtrip from source to
    clang-cl (and cl.exe) and then llvm-undname.

    (...at least as long as it's not a string like L"\xD7FF" L"foo" which
    gets demangled as L"\xD7FFfoo", where the compiler then considers the
    "f" as part of the hex escape. That seems ok.)

    Also add a comment saying that the "almost-valid" char32_t string I
    added in my last commit is actually produced by compilers. (detail)
    by nico
  323. llvm-undname: Fix stack overflow on almost-valid

    If a unsigned with all 4 bytes non-0 was passed to outputHex(), there
    were two off-by-ones in it:

    - Both MaxPos and Pos left space for the final \0, which left the buffer
      one byte to small. Set MaxPos to 16 instead of 15 to fix.

    - The `assert(Pos >= 0);` was after a `Pos--`, move it up one line.

    Since valid Unicode codepoints are <= 0x10ffff, this could never really
    happen in practice.

    Found by oss-fuzz. (detail)
    by nico
  324. [ConstantRange] Add saturating add/sub methods

    Add support for uadd_sat and friends to ConstantRange, so we can
    handle uadd.sat and friends in LVI. The implementation is forwarding
    to the corresponding APInt methods with appropriate bounds.

    One thing worth pointing out here is that the handling of wrapping
    ranges is not maximally accurate. A simple example is that adding 0
    to a wrapped range will return a full range, rather than the original
    wrapped range. The tests also only check that the non-wrapping
    envelope is correct and minimal.

    Differential Revision: https://reviews.llvm.org/D60946 (detail)
    by nikic
  325. [ConstantRange] Add getNonEmpty() constructor

    ConstantRanges have an annoying special case: If upper and lower are
    the same, it can be either an empty or a full set. When constructing
    constant ranges nearly always a full set is intended, but this still
    requires an explicit check in many places.

    This revision adds a getNonEmpty() constructor that disambiguates this
    case: If upper and lower are the same, a full set is created.

    Differential Revision: https://reviews.llvm.org/D60947 (detail)
    by nikic
  326. [AArch64] add tests with multiple binop+splat vals; NFC

    See D60890 for context. (detail)
    by spatel
  327. llvm-undname: Fix stack overflow on invalid found by oss-fuzz (detail)
    by nico
  328. gn build: Fix build after r358837 (detail)
    by nico
  329. [ARM] Rewrite isLegalT2AddressImmediate

    This does two main things, firstly adding some at least basic addressing modes
    for i64 types, and secondly treats floats and doubles sensibly when there is no
    fpu. The floating point change can help codesize in some cases, especially with
    D60294.

    Most backends seems to not consider the exact VT in isLegalAddressingMode,
    instead switching on type size. That is now what this does when the target does
    not have an fpu (as the float data will be loaded using LDR's). i64's currently
    use the address range of an LDRD (even though they may be legalised and loaded
    with an LDR). This is at least better than marking them all as illegal
    addressing modes.

    I have not attempted to do much with vectors yet. That will need changing once
    MVE is added.

    Differential Revision: https://reviews.llvm.org/D60677 (detail)
    by dmgreen
  330. [X86] Add the rounding control operand to the printing for some scalar FMA instructions. (detail)
    by ctopper
  331. [CachePruning] Simplify comparator (detail)
    by maskray
  332. [JITLink] Add dependency on MCParser to unit test after rL358818

    This is required by -DBUILD_SHARED_LIBS=on builds for createMCAsmParser. (detail)
    by maskray
  333. [X86] Don't form masked vfpclass instruction from and+vfpclass unless the fpclass only has a single use. (detail)
    by ctopper
  334. [JITLink] Remove an overly strict error check in JITLink's eh-frame parser.

    The error check required FDEs to refer to the most recent CIE, but the eh-frame
    spec allows them to refer to any previously seen CIE. This patch removes the
    offending check. (detail)
    by lhames
  335. [BinaryFormat] Fix bitfield-ordering of MachO::relocation_info on big-endian.

    Hopefully this will fix the JITLink regression test failures on big-endian
    testers (e.g.
    http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/12702) (detail)
    by lhames
  336. [JITLink] Factor basic common GOT and stub creation code into its own class. (detail)
    by lhames
  337. [gn] Move Features.inc to clangd, create a config for it

    ClangdLSPServer and clangd unittests now include Features.inc so we
    need to append the target_gen_dir that contains it to their
    include_dirs. To do so, we use a public config that's applied to
    any target that depends on the features one.

    Differential Revision: https://reviews.llvm.org/D60919 (detail)
    by phosek
  338. [JITLink] Add dependencies on MCDissassembler and Target to unit test. (detail)
    by lhames
  339. llvm-undname: Improve string literal demangling with embedded \0 chars

    - Don't assert when a string looks like a u32 string to the heuristic
      but doesn't have a length that's 0 mod 4.  Instead, classify those
      as u16 with embedded \0 chars. Found by oss-fuzz.
    - Print embedded nul bytes as \0 instead of \x00. (detail)
    by nico
  340. ftime-trace: Trace the name of the currently active pass as well.

    Differential Revision: https://reviews.llvm.org/D60782 (detail)
    by nico
  341. [JITLink] Add yet more detail to MachO/x86-64 unsupported relocation errors.

    Knowing the address/symbolnum field values makes it easier to identify the
    unsupported relocation, and provides enough information for the full bit
    pattern of the relocation to be reconstructed. (detail)
    by lhames
  342. [JITLink][ORC] Add JITLink to the list of dependencies for ORC.

    The new ObjectLinkingLayer in ORC depends on JITLink.

    This should fix the build error at
    http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/9621 (detail)
    by lhames
  343. [JITLink] Fix a bad formatv format string. (detail)
    by lhames
  344. [JITLink] Disable MachO/x86-64 regression test if the X86 target is not built. (detail)
    by lhames
  345. Revert r358800. Breaks Obsequi from the test suite.

    The last attempt fixed gcc and consumer-typeset, but Obsequi seems to fail with
    a different issue. (detail)
    by aemerson
  346. [JITLink] Add llvm-jitlink to the list of available tools in lit.

    Should fix the 'llvm-jitlink command not found' errors that are appearing on
    some builders. (detail)
    by lhames
  347. [JITLink] Add BinaryFormat to JITLink's dependencies.

    Hopefully this will fix the missing dependence on llvm::identify_magic that is
    showing up on some PPC bots. E.g.

    http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/9617 (detail)
    by lhames
  348. [JITLink] Add more detail to MachO/x86-64 "unsupported relocation" errors.

    The extra information here will be helpful in diagnosing errors, like the
    ones currently occuring on the PPC big-endian bots. :) (detail)
    by lhames
  349. [JITLink] Add check to JITLink unit test to bail out for unsupported targets.

    This should prevent spurious JITLink unit test failures for builds that do not
    support the target(s) required by the tests. (detail)
    by lhames
  350. [JITLink] Silence some MSVC implicit cast warnings. (detail)
    by lhames
  351. [JITLink] Add llvm-jitlink subdirectory to tools/LLVMBuild.txt (detail)
    by lhames
  352. [JITLink] Use memset instead of bzero. (detail)
    by lhames
  353. [JITLink] Silence a narrowing conversion warning. (detail)
    by lhames
  354. [JITLink] Update BuildingAJIT tutorials to account for API changes in r358818.

    DynamicLibrarySearchGenerator::GetForCurrentProcess now takes a char (the global
    prefix) rather than a DataLayout reference. (detail)
    by lhames
  355. [JITLink] Fix a missing header and bad prototype. (detail)
    by lhames
  356. Initial implementation of JITLink - A replacement for RuntimeDyld.

    Summary:

    JITLink is a jit-linker that performs the same high-level task as RuntimeDyld:
    it parses relocatable object files and makes their contents runnable in a target
    process.

    JITLink aims to improve on RuntimeDyld in several ways:

    (1) A clear design intended to maximize code-sharing while minimizing coupling.

    RuntimeDyld has been developed in an ad-hoc fashion for a number of years and
    this had led to intermingling of code for multiple architectures (e.g. in
    RuntimeDyldELF::processRelocationRef) in a way that makes the code more
    difficult to read, reason about, extend. JITLink is designed to isolate
    format and architecture specific code, while still sharing generic code.

    (2) Support for native code models.

    RuntimeDyld required the use of large code models (where calls to external
    functions are made indirectly via registers) for many of platforms due to its
    restrictive model for stub generation (one "stub" per symbol). JITLink allows
    arbitrary mutation of the atom graph, allowing both GOT and PLT atoms to be
    added naturally.

    (3) Native support for asynchronous linking.

    JITLink uses asynchronous calls for symbol resolution and finalization: these
    callbacks are passed a continuation function that they must call to complete the
    linker's work. This allows for cleaner interoperation with the new concurrent
    ORC JIT APIs, while still being easily implementable in synchronous style if
    asynchrony is not needed.

    To maximise sharing, the design has a hierarchy of common code:

    (1) Generic atom-graph data structure and algorithms (e.g. dead stripping and
    |  memory allocation) that are intended to be shared by all architectures.
    |
    + -- (2) Shared per-format code that utilizes (1), e.g. Generic MachO to
           |  atom-graph parsing.
           |
           + -- (3) Architecture specific code that uses (1) and (2). E.g.
                    JITLinkerMachO_x86_64, which adds x86-64 specific relocation
                    support to (2) to build and patch up the atom graph.

    To support asynchronous symbol resolution and finalization, the callbacks for
    these operations take continuations as arguments:

      using JITLinkAsyncLookupContinuation =
          std::function<void(Expected<AsyncLookupResult> LR)>;

      using JITLinkAsyncLookupFunction =
          std::function<void(const DenseSet<StringRef> &Symbols,
                             JITLinkAsyncLookupContinuation LookupContinuation)>;

      using FinalizeContinuation = std::function<void(Error)>;

      virtual void finalizeAsync(FinalizeContinuation OnFinalize);

    In addition to its headline features, JITLink also makes other improvements:

      - Dead stripping support: symbols that are not used (e.g. redundant ODR
        definitions) are discarded, and take up no memory in the target process
        (In contrast, RuntimeDyld supported pointer equality for weak definitions,
        but the redundant definitions stayed resident in memory).

      - Improved exception handling support. JITLink provides a much more extensive
        eh-frame parser than RuntimeDyld, and is able to correctly fix up many
        eh-frame sections that RuntimeDyld currently (silently) fails on.

      - More extensive validation and error handling throughout.

    This initial patch supports linking MachO/x86-64 only. Work on support for
    other architectures and formats will happen in-tree.

    Differential Revision: https://reviews.llvm.org/D58704 (detail)
    by lhames
  357. [X86] Disable argument copy elision for arguments passed via pointers

    Summary:
    If you pass two 1024 bit vectors in IR with AVX2 on Windows 64. Both vectors will be split in four 256 bit pieces. The four pieces of the first argument will be passed indirectly using 4 gprs. The second argument will get passed via pointers in memory.

    The PartOffsets stored for the second argument are all in terms of its original 1024 bit size. So the PartOffsets for each piece are 32 bytes apart. So if we consider it for copy elision we'll only load an 8 byte pointer, but we'll move the address 32 bytes. The stack object size we create for the first part is probably wrong too.

    This issue was encountered by ISPC. I'm working on getting a reduce test case, but wanted to go ahead and get feedback on the fix.

    Reviewers: rnk

    Reviewed By: rnk

    Subscribers: dbabokin, llvm-commits, hiraditya

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60801 (detail)
    by ctopper
  358. [CorrelatedValuePropagation] Mark subs that we know not to wrap with nuw/nsw.

    Summary:
    Teach CorrelatedValuePropagation to also handle sub instructions in addition to add. Relatively simple since makeGuaranteedNoWrapRegion already understood sub instructions. Only subtle change is which range is passed as "Other" to that function, since sub isn't commutative.

    Note that CorrelatedValuePropagation::processAddSub is still hidden behind a default-off flag as IndVarSimplify hasn't yet been fixed to strip the added nsw/nuw flags and causes a miscompile. (PR31181)

    Reviewers: sanjoy, apilipenko, nikic

    Reviewed By: nikic

    Subscribers: hiraditya, jfb, jdoerfert, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60036 (detail)
    by luqmana
  359. [ExecutionDomainFix] Optimize a binary search insertion (detail)
    by maskray
  360. [llvm-symbolizer] Fix section index at the end of a section

    This is very minor issue. The returned section index is only used by
    DWARFDebugLine as an llvm::upper_bound input and the use case shouldn't
    cause any behavioral change. (detail)
    by maskray
  361. [IndVarSimplify] Generate full checks for some LFTR tests; NFC (detail)
    by nikic
  362. [IndVarSimplify] Add tests for PR31181; NFC (detail)
    by nikic
  363. [ADT] Avoid warning in bsearch testcase (detail)
    by sammccall
  364. [llvm-objdump] Fix End in disassemblyObject after rL358806 (detail)
    by maskray
  365. [CVP] Add tests for sub nowrap inference; NFC

    These are baseline tests for D60036.

    Patch by Luqman Aden. (detail)
    by nikic
  366. [X86] Fix stack probing on x32 (PR41477)

    Fix for https://bugs.llvm.org/show_bug.cgi?id=41477. On the x32 ABI
    with stack probing a dynamic alloca will result in a WIN_ALLOCA_32
    with a 32-bit size. The current implementation tries to copy it into
    RAX, resulting in a physreg copy error. Fix this by copying to EAX
    instead. Also fix incorrect opcodes or registers used in subs. (detail)
    by nikic
  367. [llvm-objdump] Don't disassemble symbols before SectionAddr

    This was caught by UBSAN

    tools/llvm-objdump/X86/macho-disassembly-g-dsym.test
    tools/llvm-objdump/X86/hex-displacement.test (detail)
    by maskray
  368. [X86] Don't turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the original AND can represented by MOVZX.

    The MOVZX doesn't require an immediate to be encoded at all. Though it does use
    a 2 byte opcode so its the same size as a 1 byte immediate. But it has a
    separate source and dest register so can help avoid copies. (detail)
    by ctopper
  369. [X86] Turn (and (anyextend (shl X, C1), C2)) into (shl (and (anyextend X), (C1 >> C2), C2) if the AND could match a movzx.

    There's one slight regression in here because we don't check that the immediate
    already allowed movzx before the shift. I'll fix that next. (detail)
    by ctopper
  370. [llvm-objdump] Simplify --{start,stop}-address (detail)
    by maskray
  371. [WebAssembly] Object: Improve error messages on invalid section

    Also add a test.

    Differential Revision: https://reviews.llvm.org/D60836 (detail)
    by sbc
  372. Revert "Revert "[GlobalISel] Add legalization support for non-power-2 loads and stores""

    We were shifting the wrong component of a split load when trying to combine them
    back into a single value. (detail)
    by aemerson
  373. [GlobalISel][AArch64] Legalize + select G_FRINT

    Exactly the same as G_FCEIL, G_FABS, etc.

    Add tests for the fp16/nofp16 behaviour, update arm64-vfloatintrinsics, etc.

    Differential Revision: https://reviews.llvm.org/D60895 (detail)
    by paquette
  374. [WebAssembly] FastISel: Don't fallback to SelectionDAG after BuildMI in selectCall

    My understanding is that once BuildMI has been called we can't fallback
    to SelectionDAG.

    This change moves the fallback for when getRegForValue() fails for
    that target of an indirect call.  This was failing in -fPIC mode when
    the callee is GlobalValue.

    Add a test case that tickles this.

    Differential Revision: https://reviews.llvm.org/D60908 (detail)
    by sbc
  375. [GVN+LICM] Use line 0 locations for better crash attribution

    This is a follow-up to r291037+r291258, which used null debug locations
    to prevent jumpy line tables.

    Using line 0 locations achieves the same effect, but works better for
    crash attribution because it preserves the right inline scope.

    Differential Revision: https://reviews.llvm.org/D60913 (detail)
    by vedantk
  376. Update GN files to build with r358103 (detail)
    by vitalybuka
  377. Remove the EnableEarlyCSEMemSSA set of options from the legacy
    and new pass managers. They were default to true and not being
    used.

    Differential Revision: https://reviews.llvm.org/D60747 (detail)
    by echristo
  378. [AArch64] Fix checks for AArch64MCExpr::VK_SABS flag.

    VK_SABS is part of the SymLoc bitfield in the variant kind which should
    be compared for equality, not by checking the VK_SABS bit.

    As far as I know, the existing code happened to produce the correct
    results in all cases, so this is just a cleanup.

    Patch by Stephen Crane.

    Differential Revision: https://reviews.llvm.org/D60596 (detail)
    by efriedma
  379. [GlobalISel] Add IRTranslator support for G_FRINT

    Add it as a simple intrinsic, update arm64-irtranslator.ll.

    Differential Revision: https://reviews.llvm.org/D60893 (detail)
    by paquette
  380. Attempt to fix buildbot failure in commit 1bb57bac959ac163fd7d8a76d734ca3e0ecee6ab. (detail)
    by akhuang
  381. [GlobalISel] Add a G_FRINT opcode

    Equivalent to SelectionDAG's frint node.

    Differential Revision: https://reviews.llvm.org/D60891 (detail)
    by paquette
  382. [X86] Add test case for D60801. NFC (detail)
    by ctopper
  383. [MS] Emit S_HEAPALLOCSITE debug info

    Summary:
    This emits labels around heapallocsite calls and S_HEAPALLOCSITE debug
    info in codeview. Currently only changes FastISel, so emitting labels still
    needs to be implemented in SelectionDAG.

    Reviewers: hans, rnk

    Subscribers: aprantl, hiraditya, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D60800 (detail)
    by akhuang
  384. [CMake] Pass monorepo build settings in cross compile

    This allows the cross compiled build targets to configure the LLVM tools and sub-projects that are part of the main build.

    This is needed for generating native non llvm *-tablegen tools when cross compiling clang in the monorepo build environment. (detail)
    by cbieneman
  385. [gn] Support dots in CMake paths in the sync script

    Some file paths use dots to pick up sources from parent directories.

    Differential Revision: https://reviews.llvm.org/D60734 (detail)
    by phosek
  386. [LICM & MemorySSA] Make limit flags pass tuning options.

    Summary:
    Make the flags in LICM + MemorySSA tuning options in the old and new
    pass managers.

    Subscribers: mehdi_amini, jlebar, Prazek, george.burgess.iv, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60490 (detail)
    by asbirlea
  387. Revert "[GlobalISel] Add legalization support for non-power-2 loads and stores"

    This introduces some runtime failures which I'll need to investigate further. (detail)
    by aemerson
  388. [GlobalISel][AArch64] Legalize vector G_FPOW

    This instruction is legalized in the same way as G_FSIN, G_FCOS, G_FLOG10, etc.

    Update legalize-pow.mir and arm64-vfloatintrinsics.ll to reflect the change.

    Differential Revision: https://reviews.llvm.org/D60218 (detail)
    by paquette
  389. [NewPassManager] Adding pass tuning options: loop vectorize.

    Summary:
    Trying to add the plumbing necessary to add tuning options to the new pass manager.
    Testing with the flags for loop vectorize.

    Reviewers: chandlerc

    Subscribers: sanjoy, mehdi_amini, jlebar, steven_wu, dexonsmith, dang, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D59723 (detail)
    by asbirlea
  390. [dsymutil] DwarfLinker: delete unused parameter (detail)
    by maskray
  391. [SelectionDAG] soften splat mask assert/unreachable (PR41535)

    These are general queries, so they should not die when given
    a degenerate input like an all undef mask. Callers should be
    able to deal with an op that will eventually be simplified away. (detail)
    by spatel
  392. llvm-undname: Attempt to fix leak-on-invalid found by oss-fuzz (detail)
    by nico
  393. gn build: Merge r358722 (detail)
    by nico
  394. gn build: Merge r358691 (detail)
    by nico
  395. [LTO] Add plumbing to save stats during LTO on Darwin.

    Gold and ld on Linux already support saving stats, but the
    infrastructure is missing on Darwin. Unfortunately it seems like the
    configuration from lib/LTO/LTO.cpp is not used.

    This patch adds a new LTOStatsFile option and adds plumbing in Clang to
    use it on Darwin, similar to the way remarks are handled.

    Currnetly the handling of LTO flags seems quite spread out, with a bunch
    of duplication. But I am not sure if there is an easy way to improve
    that?

    Reviewers: anemet, tejohnson, thegameg, steven_wu

    Reviewed By: steven_wu

    Differential Revision: https://reviews.llvm.org/D60516 (detail)
    by fhahn
  396. Change \r\n -> \n for llvm-symbolizer/help.test after rL358749 (detail)
    by maskray
  397. [llvm-symbolizer] Add llvm-addr2line

    This adds an alias for llvm-symbolizer with different defaults so that
    it can be used as a drop-in replacement for GNU's addr2line.

    If a substring "addr2line" is found in the tool's name:
      * it defaults "-i", "-f" and "-C" to OFF;
      * it uses "--output-style=GNU" by default.

    Differential Revision: https://reviews.llvm.org/D60067 (detail)
    by ikudrin
  398. [llvm-symbolizer] Unhide and document the "-output-style" option

    With the latest changes, the option gets useful for users of
    llvm-symbolizer, not only for the upcoming llvm-addr2line.

    Differential Revision: https://reviews.llvm.org/D60816 (detail)
    by ikudrin
  399. [llvm-symbolizer] Make the output with -output-style=GNU closer to addr2line's

    This patch addresses two differences in the output of llvm-symbolizer
    and GNU's addr2line:

    * llvm-symbolizer prints an empty line after the report for an address.

    * With "-f -i=0", llvm-symbolizer replaces the name of an inlined
      function with the name from the symbol table, i. e., the top caller
      function in the inlining chain. addr2line preserves the name of the
      inlined function.

    Differential Revision: https://reviews.llvm.org/D60770 (detail)
    by ikudrin
  400. [AMDGPU] Regenerate extractelt->truncate test.

    Prep work for D60462 (detail)
    by rksimon
  401. [CodeGen] Add "const" to MachineInstr::mayAlias

    Summary:
    The basic idea here is to make it possible to use
    MachineInstr::mayAlias also when the MachineInstr
    is const (or the "Other" MachineInstr is const).

    The addition of const in MachineInstr::mayAlias
    then rippled down to the need for adding const
    in several other places, such as
    TargetTransformInfo::getMemOperandWithOffset.

    Reviewers: hfinkel

    Reviewed By: hfinkel

    Subscribers: hfinkel, MatzeB, arsenm, jvesely, nhaehnle, hiraditya, javed.absar, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60856 (detail)
    by bjope
  402. [PATCH] [MachineScheduler] Check pending instructions when an instruction is scheduled

    Pending instructions that may have been blocked from being available by the HazardRecognizer may no longer may not be blocked any more when an instruction is scheduled; pending instructions should be re-checked in this case.

    This is primarily aimed at VLIW targets with large parallelism and esoteric constraints.

    No testcase as no in-tree targets have this behavior.

    Differential revision: https://reviews.llvm.org/D60861 (detail)
    by jamesm
  403. [MergeFunc] Delete unused FunctionNode::release() (detail)
    by maskray
  404. [MergeFunc] removeUsers: call remove() only on direct users

    removeUsers uses a work list to collect indirect users and call remove()
    on those functions. However it has a bug (`if (!Visited.insert(UU).second)`).

    Actually, we don't have to collect indirect users.
    After the merge of F and G, G's callers will be considered (added to
    Deferred). If G's callers can be merged, G's callers' callers will be
    considered.

    Update the test unnamed-addr-reprocessing.ll to make it clear we can
    still merge indirect callers. (detail)
    by maskray
  405. [AMDGPU] Ignore non-SUnits edges

    Summary:
    Ignore edges to non-SUnits (e.g. ExitSU) when checking
    for low latency instructions.

    When calling the function isLowLatencyInstruction(),
    an ExitSU could be on the list of successors, not necessarily
    a regular SU. In other places in the code there is a check
    "Succ->NodeNum >= DAGSize" to prevent further processing of
    ExitSU as "Succ->getInstr()" is NULL in such a case.
    Also, 8 out of 9 cases of "SUnit *Succ = SuccDep.getSUnit())"
    has the guard, so it is clearly an omission here.

    Change-Id: Ica86f0327c7b2e6bcb56958e804ea6c71084663b

    Reviewers: nhaehnle

    Reviewed By: nhaehnle

    Subscribers: MatzeB, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60864 (detail)
    by piotr
  406. [CallSite removal]  Move the legacy PM, call graph, and some inliner
    code to `CallBase`.

    This patch focuses on the legacy PM, call graph, and some of inliner and legacy
    passes interacting with those APIs from `CallSite` to the new `CallBase` class.
    No interesting changes.

    Differential Revision: https://reviews.llvm.org/D60412 (detail)
    by chandlerc
  407. [MergeFunc] Use less_first() as the comparator of Schwartzian transform (detail)
    by maskray
  408. [X86] Turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the AND could match a movzx.

    Could get further improvements by recognizing (i64 and (anyext (i32 shl))). (detail)
    by ctopper
  409. [X86] Add test cases for turning (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) when the AND could match to a movzx.

    We already reorder when C1 >> C2 would allow a smaller immediate encoding. (detail)
    by ctopper
  410. [X86] Make sure we copy the HandleSDNode back to N before executing the default code after the switch in matchAddressRecursively

    Summary:
    There are two places where we create a HandleSDNode in address matching in order to handle the case where N is changed by CSE. But if we end up not matching, we fall back to code at the bottom of the switch that really would like N to point to something that wasn't CSEd away. So we should make sure we copy the handle back to N on any paths that can reach that code.

    This appears to be the true reason we needed to check DELETED_NODE in the negation matching. In pr32329.ll we had two subtracts back to back. We recursed through the first subtract, and onto the second subtract. The second subtract called matchAddressRecursively on its LHS which caused that subtract to CSE. We ultimately failed the match and ended up in the default code. But N was pointing at the old node that had been deleted, but the default code didn't know that and took it as the base register. Then we unwound back to the first subtract and tried to access this bogus base reg requiring the check for deleted node. With this patch we now use the CSE result as the base reg instead.

    matchAdd has been broken since sometime in 2015 when it was pulled out of the switch into a helper function. The assignment to N at the end was still there, but N was passed by value and not by reference so the update didn't go anywhere.

    Reviewers: niravd, spatel, RKSimon, bkramer

    Reviewed By: niravd

    Subscribers: llvm-commits, hiraditya

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60843 (detail)
    by ctopper
  411. [DWARF] Use hasFileAtIndex to properly verify DWARF 5 after rL358732 (detail)
    by maskray
  412. [llvm] Prevent duplicate files in debug line header in dwarf 5: another attempt

    Another attempt to land the changes in debug line header to prevent duplicate
    files in Dwarf 5. I rolled back my previous commit because of a mistake in
    generating the object file in a test. Meanwhile, I addressed some offline
    comments and changed the implementation; the largest difference is that
    MCDwarfLineTableHeader does not keep DwarfVersion but gets it as a parameter. I
    also merged the patch to fix two lld tests that will strt to fail into this
    patch.

    Original Commit:

    https://reviews.llvm.org/D59515

    Original Message:
    Motivation: In previous dwarf versions, file name indexes started from 1, and
    the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
    the primary source file to be explicitly given an entry with an index number 0.

    The current implementation honors the specification by just duplicating the
    main source file, once with index number 0, and later maybe with another
    index number. While this is compliant with the letter of the standard, the
    duplication causes problems for consumers of this information such as lldb.
    (Some files are duplicated, where only some of them have a line table although
    all refer to the same file)

    With this change, dwarf 5 debug line section files always start from 0, and
    the zeroth entry is not duplicated whenever possible. This requires different
    handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
    an index zero for a file name, it signals an error in dwarf 4, but not in dwarf
    5) However, I think the minor complication is worth it, because it enables all
    consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
    file name list homogenously. (detail)
    by tamur
  413. [APInt] Optimize umul_ov

    Change two costly udiv() calls to lshr(1)*RHS + left-shift + plus

    On one 64-bit umul_ov benchmark, I measured an obvious improvement: 12.8129s -> 3.6257s

    Note, there may be some value to special case 64-bit (the most common
    case) with __builtin_umulll_overflow().

    Differential Revision: https://reviews.llvm.org/D60669 (detail)
    by maskray
  414. MergeFunc: preserve COMDAT information when creating a thunk

    We would previously drop the COMDAT on the thunk we generated when replacing a
    function body with the forwarding thunk. This would result in a function that
    may have been multiply emitted and multiply merged to be emitted with the same
    name without the COMDAT. This is a hard error with PE/COFF where the COMDAT is
    used for the deduplication of Value Witness functions for Swift. (detail)
    by compnerd
  415. [LoopUnroll] Move list of params into a struct [NFCI].

    Summary: Cleanup suggested in review of r358304.

    Reviewers: sanjoy, efriedma

    Subscribers: jlebar, zzheng, dmgreen, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60638 (detail)
    by asbirlea
  416. [AArch64] add tests for mul-by-element; NFC (detail)
    by spatel
  417. Implement sys::fs::copy_file using the macOS copyfile(3) API
    to support APFS clones.

    This patch adds a Darwin-specific implementation of
    llvm::sys::fs::copy_file() that uses the macOS copyfile(3) API to
    support APFS copy-on-write clones, which should be faster and much
    more space efficient.

    https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/APFS_Guide/ToolsandAPIs/ToolsandAPIs.html

    Differential Revision: https://reviews.llvm.org/D60802

    This reapplies 358628 with an additional bugfix handling the case
    where the destination file already exists. (Caught by the clang testsuite). (detail)
    by adrian
  418. [GlobalISel][AArch64] Legalize/select G_(S/Z/ANY)_EXT for v8s8s

    This adds legalization for G_SEXT, G_ZEXT, and G_ANYEXT for v8s8s.

    We were falling back on G_ZEXT in arm64-vabs.ll before, preventing us from
    selecting the @llvm.aarch64.neon.sabd.v8i8 intrinsic.

    This adds legalizer support for those 3, which gives us selection via the
    importer. Update the relevant tests (legalize-ext.mir, select-int-ext.mir) and
    add a GISel line to arm64-vabs.ll.

    Differential Revision: https://reviews.llvm.org/D60881 (detail)
    by paquette
  419. [GlobalISel][AArch64] Legalize v8s8 loads

    Add legalizer support for loads of v8s8 and update legalize-load-store.mir.

    Differential Revision: https://reviews.llvm.org/D60877 (detail)
    by paquette
  420. llvm-undname: Fix two more asserts-on-invalid, found by oss-fuzz (detail)
    by nico
  421. llvm-undname: Fix two asserts-on-invalid (detail)
    by nico
  422. [GuardWidening] Wire up a NPM version of the LoopGuardWidening pass (detail)
    by reames
  423. [NFC] FMF propagation for GlobalIsel (detail)
    by mcberg2017
  424. [BlockExtractor] Extend the file format to support the grouping of basic blocks

    Prior to this patch, each basic block listed in the extrack-blocks-file
    would be extracted to a different function.

    This patch adds the support for comma separated list of basic blocks
    to form group.

    When the region formed by a group is not extractable, e.g., not single
    entry, all the blocks of that group are left untouched.

    Let us see this new format in action (comments are not part of the
    file format):
    ;; funcName bbName[,bbName...]
       foo      bb1        ;; Extract bb1 in its own function
       foo      bb2,bb3    ;; Extract bb2,bb3 in their own function
       bar      bb1,bb4    ;; Extract bb1,bb4 in their own function
       bar      bb2        ;; Extract bb2 in its own function

    Assuming all regions are extractable, this will create one function and
    thus one call per region.

    Differential Revision: https://reviews.llvm.org/D60746 (detail)
    by qcolombet
  425. [PowerPC] Add some PPC vec cost tests to prep for D60160 NFC (detail)
    by froese
  426. [X86] combineVectorTruncationWithPACKUS - remove split/concatenation of mask

    combineVectorTruncationWithPACKUS is currently splitting the upper bit bit masking into 128-bit subregs and then concatenating them back together.

    This was originally done to avoid regressions that caused existing subregs to be concatenated to the larger type just for the AND masking before being extracted again. This was fixed by @spatel (notably rL303997 and rL347356).

    This also lets SimplifyDemandedBits do some further improvements before it hits the recursive depth limit.

    My only annoyance with this is that we were broadcasting some xmm masks but we seem to have lost them by moving to ymm - but that's a known issue as the logic in lowerBuildVectorAsBroadcast isn't great.

    Differential Revision: https://reviews.llvm.org/D60375#inline-539623 (detail)
    by rksimon
  427. [LoopPred] Fix a blatantly obvious bug in r358684

    The bug is that I didn't check whether the operand of the invariant_loads were themselves invariant.  I don't know how this got missed in the patch and review.  I even had an unreduced test case locally, and I remember handling this case, but I must have lost it in one of the rebases.  Oops. (detail)
    by reames
  428. [x86] add tests for improved insertelement to index 0 (PR41512); NFC

    Patch proposal in D60852. (detail)
    by spatel
  429. [CMake] Allow custom extensions for externalized debug info

    Summary:
    Extra flexibility for emitting debug info to external files (remains Darwin only for now).
    LLDB needs this functionality to emit a LLDB.framework.dSYM instead of LLDB.dSYM when building the framework, because the latter could conflict with the driver's lldb.dSYM when emitted in the same directory on case-insensitive file systems.

    Reviewers: friss, bogner, beanz

    Subscribers: mgorny, aprantl, llvm-commits, #lldb

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60862 (detail)
    by stefan.graenitz
  430. [LoopPredication] Allow predication of loop invariant computations (within the loop)

    The purpose of this patch is to eliminate a pass ordering dependence between LoopPredication and LICM. To understand the purpose, consider the following snippet of code inside some loop 'L' with IV 'i'
    A = _a.length;
    guard (i < A)
    a = _a[i]
    B = _b.length;
    guard (i < B);
    b = _b[i];
    ...
    Z = _z.length;
    guard (i < Z)
    z = _z[i]
    accum += a + b + ... + z;

    Today, we need LICM to hoist the length loads, LoopPredication to make the guards loop invariant, and TrivialUnswitch to eliminate the loop invariant guard to establish must execute for the next length load. Today, if we can't prove speculation safety, we'd have to iterate these three passes 26 times to reduce this example down to the minimal form.

    Using the fact that the array lengths are known to be invariant, we can short circuit this iteration. By forming the loop invariant form of all the guards at once, we remove the need for LoopPredication from the iterative cycle. At the moment, we'd still have to iterate LICM and TrivialUnswitch; we'll leave that part for later.

    As a secondary benefit, this allows LoopPred to expose peeling oppurtunities in a much more obvious manner.  See the udiv test changes as an example.  If the udiv was not hoistable (i.e. we couldn't prove speculation safety) this would be an example where peeling becomes obviously profitable whereas it wasn't before.

    A couple of subtleties in the implementation:
    - SCEV's isSafeToExpand guarantees speculation safety (i.e. let's us expand at a new point).  It is not a precondition for expansion if we know the SCEV corresponds to a Value which dominates the requested expansion point.
    - SCEV's isLoopInvariant returns true for expressions which compute the same value across all iterations executed, regardless of where the original Value is located.  (i.e. it can be in the loop)  This implies we have a speculation burden to prove before expanding them outside loops.
    - invariant_loads and AA->pointsToConstantMemory are two cases that SCEV currently does not handle, but meets the SCEV definition of invariance.  I plan to sink this part into SCEV once this has baked for a bit.

    Differential Revision: https://reviews.llvm.org/D60093 (detail)
    by reames
  431. [SDA] Bug fix: Use IPD outside the loop as divergence bound

    Summary:
    The immediate post dominator of the loop header may be part of the divergent loop.
    Since this /was/ the divergence propagation bound the SDA would not detect joins of divergent paths outside the loop.

    Reviewers: nhaehnle

    Reviewed By: nhaehnle

    Subscribers: mmasten, arsenm, jvesely, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D59042 (detail)
    by nha
  432. Fix a bug in SCEV's isSafeToExpand around speculation safety

    isSafeToExpand was making a common, but dangerously wrong, mistake in assuming that if any instruction within a basic block executes, that all instructions within that block must execute.  This can be trivially shown to be false by considering the following small example:
    bb:
      add x, y  <-- InsertionPoint
      call @throws()
      udiv x, y <-- SCEV* S
      br ...

    It's clearly not legal to expand S above the throwing call, but the previous logic would do so since S dominates (but not properlyDominates) the block containing the InsertionPoint.

    Since iterating instructions w/in a block is expensive, this change special cases two cases: 1) S is an operand of InsertionPoint, and 2) InsertionPoint is the terminator of it's block.  These two together are enough to keep all current optimizations triggering while fixing the latent correctness issue.

    As best I can tell, this is a silent bug in current ToT.  Given that, there's no tests with this change.  It was noticed in an upcoming optimization change (D60093), and was reviewed as part of that.  That change will include the test which caused me to notice the issue.  I'm submitting this seperately so that anyone bisecting a problem gets a clear explanation. (detail)
    by reames
  433. MinidumpYAML: Fix ambiguity between std::make_unique and llvm::make_unique (detail)
    by d0k
  434. MinidumpYAML: Add support for ModuleList stream

    Summary:
    This patch adds support for yaml (de)serialization of the minidump
    ModuleList stream. It's a fairly straight forward-application of the
    existing patterns to the ModuleList structures defined in previous
    patches.

    One thing, which may be interesting to call out explicitly is the
    addition of "new" allocation functions to the helper BlobAllocator
    class. The reason for this was, that there was an emerging pattern of a
    need to allocate space for entities, which do not have a suitable
    lifetime for use with the existing allocation functions. A typical
    example of that was the "size" of various lists, which is only available
    as a temporary returned by the .size() method of some container. For
    these cases, one can use the new set of allocation functions, which
    will take a temporary object, and store it in an allocator-managed
    buffer until it is written to disk.

    Reviewers: amccarth, jhenderson, clayborg, zturner

    Subscribers: lldb-commits, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60405 (detail)
    by labath
  435. gn build: Merge r358607 (detail)
    by nico
  436. gn build: Merge r358633 (detail)
    by nico
  437. gn build: Merge r358620 (detail)
    by nico
  438. [llvm-objcopy] Add -B mips (detail)
    by rupprecht
  439. [yaml2elf/obj2yaml] - Allow normal parsing/dumping of the .rela.dyn section

    .rela.dyn is a section that has sh_info normally
    set to zero. And Info is an optional field in the description
    of the relocation section in YAML.

    But currently, yaml2obj would fail to produce the object when
    Info is not explicitly listed.

    The patch fixes the issue.

    Differential revision: https://reviews.llvm.org/D60820 (detail)
    by grimar
  440. [X86][SSE] Lower ICMP EQ(AND(X,C),C) -> SRA(SHL(X,LOG2(C)),BW-1) iff C is power-of-2.

    This replaces the MOVMSK combine introduced at D52121/rL342326

    (movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C))

    with the more general icmp lowering so it can pick up more cases through bitcasts - notably vXi8 cases which use vXi16 shifts+masks, this patch can remove the mask and use pcmpgtb(0,x) for the sra.

    Differential Revision: https://reviews.llvm.org/D60625 (detail)
    by rksimon
  441. [llvm-objcopy][llvm-strip] Add switch to allow removing referenced sections

    llvm-objcopy currently emits an error if a section to be removed is
    referenced by another section. This is a reasonable thing to do, but is
    different to GNU objcopy. We should allow users who know what they are
    doing to have a way to produce the invalid ELF. This change adds a new
    switch --allow-broken-links to both llvm-strip and llvm-objcopy to do
    precisely that. The corresponding sh_link field is then set to 0 instead
    of an error being emitted.

    I cannot use llvm-readelf/readobj to test the link fields because they
    emit an error if any sections, like the .dynsym, cannot be properly
    loaded.

    Reviewed by: rupprecht, grimar

    Differential Revision: https://reviews.llvm.org/D60324 (detail)
    by jhenderson
  442. Test commit access [NFC]

    Remove a trailing space (detail)
    by c-rhodes
  443. [NewPM] Add Option handling for LoopVectorize

    This patch enables passing options to LoopVectorizePass via the passes pipeline.

    Reviewers: chandlerc, fedor.sergeev, leonardchan, philip.pfaffe
    Reviewed By: fedor.sergeev
    Subscribers: llvm-commits
    Differential Revision: https://reviews.llvm.org/D60681 (detail)
    by skatkov
  444. [PowerPC] Fix wrong ElemSIze when calling isConsecutiveLS()

    Summary:
    This issue from the bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41177

    When the two operands for BUILD_VECTOR are same, we will get assert error.
    llvm::SDValue combineBVOfConsecutiveLoads(llvm::SDNode*, llvm::SelectionDAG&):
    Assertion `!(InputsAreConsecutiveLoads && InputsAreReverseConsecutive) &&
    "The loads cannot be both consecutive and reverse consecutive."' failed.

    This error caused by the wrong ElemSIze when calling isConsecutiveLS(). We
    should use `getScalarType().getStoreSize();` to get the ElemSize instread of
    `getScalarSizeInBits() / 8`.

    Reviewed By: jsji

    Differential Revision: https://reviews.llvm.org/D60811 (detail)
    by zhangkang
  445. [llvm-profdata] Fix one bad format in llvm-profdata CommandGuide doc. NFC (detail)
    by xur
  446. Elaborate why we have an option on by default for enabling chr. (detail)
    by echristo
  447. [AMDGPU] Avoid DAG combining assert with fneg(fadd(A,0))

    fneg combining attempts to turn it into fadd(fneg(A), fneg(0)), but
    creating the new fadd folds to just fneg(A). When A has multiple uses,
    this confuses it and you get an assert. Fixed.

    Differential Revision: https://reviews.llvm.org/D60633

    Change-Id: I0ddc9b7286abe78edc0cd8d734fdeb05ff09821c (detail)
    by tpr
  448. Fix a typo in comments. [NFC] (detail)
    by tamur
  449. [GISel]:IRTranslator: Prefer a buidInstr form that allows CSE of cast instructions

    https://reviews.llvm.org/D60844

    Use the style of buildInstr that allows CSEing. (detail)
    by aditya_nandakumar
  450. Fix bad compare function over FusionCandidate.

    Reverse the checking of the domiance order so that when a self compare happens,
    it returns false.  This makes compare function have strict weak ordering. (detail)
    by rtrieu
  451. Revert Implement sys::fs::copy_file using the macOS copyfile(3) API to support APFS clones.

    This reverts r358628 (git commit 91a06bee788262a294527b815354f380d99dfa9b)
    while investigating a crash reproducer bot failure. (detail)
    by adrian
  452. Implement sys::fs::copy_file using the macOS copyfile(3) API
    to support APFS clones.

    This patch adds a Darwin-specific implementation of
    llvm::sys::fs::copy_file() that uses the macOS copyfile(3) API to
    support APFS copy-on-write clones, which should be faster and much
    more space efficient.

    https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/APFS_Guide/ToolsandAPIs/ToolsandAPIs.html

    Differential Revision: https://reviews.llvm.org/D60802 (detail)
    by adrian
  453. Fix formatting. NFC (detail)
    by ahatanak
  454. [x86] try to widen 'shl' as part of LEA formation

    The test file has pairs of tests that are logically equivalent:
    https://rise4fun.com/Alive/2zQ

    %t4 = and i8 %t1, 8
    %t5 = zext i8 %t4 to i16
    %sh = shl i16 %t5, 2
    %t6 = add i16 %sh, %t0
    =>
    %t4 = and i8 %t1, 8
    %sh2 = shl i8 %t4, 2
    %z5 = zext i8 %sh2 to i16
    %t6 = add i16 %z5, %t0

    ...so if we can fold the shift op into LEA in the 1st pattern, then we
    should be able to do the same in the 2nd pattern (unnecessary 'movzbl'
    is a separate bug I think).

    We don't want to do this any sooner though because that would conflict
    with generic transforms that try to narrow the width of the shift.

    Differential Revision: https://reviews.llvm.org/D60789 (detail)
    by spatel
  455. Test commit by Denis Bakhvalov

    Change-Id: I4d85123a157d957434902fb14ba50926b2d56212 (detail)
    by dendibakh
  456. [AsmPrinter] hoist %a output template to base class for ARM+Aarch64

    Summary:
    X86 is quite complicated; so I intend to leave it as is. ARM+Aarch64 do
    basically the same thing (Aarch64 did not correctly handle immediates,
    ARM has a test llvm/test/CodeGen/ARM/2009-04-06-AsmModifier.ll that uses
    %a with an immediate) for a flag that should be target independent
    anyways.

    Reviewers: echristo, peter.smith

    Reviewed By: echristo

    Subscribers: javed.absar, eraman, kristof.beyls, hiraditya, llvm-commits, srhines

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60841 (detail)
    by nickdesaulniers
  457. Add a getSizeInBits() accessor to MachineMemOperand. NFC.

    Cleans up a bunch of places where we do getSize() * 8.

    Differential Revision: https://reviews.llvm.org/D60799 (detail)
    by aemerson
  458. [GlobalISel] Add legalization support for non-power-2 loads and stores

    Legalize things like i24 load/store by splitting them into smaller power of 2 operations.

    This matches how SelectionDAG handles these operations.

    Differential Revision: https://reviews.llvm.org/D59971 (detail)
    by aemerson
  459. Add basic loop fusion pass.

    This patch adds a basic loop fusion pass. It will fuse loops that conform to the
    following 4 conditions:
      1. Adjacent (no code between them)
      2. Control flow equivalent (if one loop executes, the other loop executes)
      3. Identical bounds (both loops iterate the same number of iterations)
      4. No negative distance dependencies between the loop bodies.

    The pass does not make any changes to the IR to create opportunities for fusion.
    Instead, it checks if the necessary conditions are met and if so it fuses two
    loops together.

    The pass has not been added to the pass pipeline yet, and thus is not enabled by
    default. It can be run stand alone using the -loop-fusion option.

    Differential Revision: https://reviews.llvm.org/D55851 (detail)
    by kbarton
  460. [AsmPrinter] defer %c to base class for ARM, PPC, and Hexagon. NFC

    Summary:
    None of these derived classes do anything that the base class cannot.
    If we remove these case statements, then the base class can handle them
    just fine.

    Reviewers: peter.smith, echristo

    Reviewed By: echristo

    Subscribers: nemanjai, javed.absar, eraman, kristof.beyls, hiraditya, kbarton, jsji, llvm-commits, srhines

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60803 (detail)
    by nickdesaulniers
  461. [ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbols

    Summary:
    Reapply r357931 with fixes to ThinLTO testcases and llvm-lto tool.

    ThinLTOCodeGenerator currently does not preserve llvm.used symbols and
    it can internalize them. In order to pass the necessary information to the
    legacy ThinLTOCodeGenerator, the input to the code generator is
    rewritten to be based on lto::InputFile.

    Now ThinLTO using the legacy LTO API will requires data layout in
    Module.

    "internalize" thinlto action in llvm-lto is updated to run both
    "promote" and "internalize" with the same configuration as
    ThinLTOCodeGenerator. The old "promote" + "internalize" option does not
    produce the same output as ThinLTOCodeGenerator.

    This fixes: PR41236
    rdar://problem/49293439

    Reviewers: tejohnson, pcc, kromanova, dexonsmith

    Reviewed By: tejohnson

    Subscribers: ormris, bd1976llvm, mehdi_amini, inglorion, eraman, hiraditya, jkorous, dexonsmith, arphaman, dang, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60421 (detail)
    by steven_wu
  462. [InstCombine] Factor out unreachable inst idiom creation [NFC]

    In InstCombine, we use an idiom of "store i1 true, i1 undef" to indicate we've found a path which we've proven unreachable.  We can't actually insert the unreachable instruction since that would require changing the CFG.  We leave that to simplifycfg later.

    This just factors out that idiom creation so we don't duplicate the same mostly undocument idiom creation in multiple places. (detail)
    by reames
  463. [LVI][CVP] Constrain values in with.overflow branches

    If a branch is conditional on extractvalue(op.with.overflow(%x, C), 1)
    then we can constrain the value of %x inside the branch based on
    makeGuaranteedNoWrapRegion(). We do this by extending the edge-value
    handling in LVI. This allows CVP to then fold comparisons against %x,
    as illustrated in the tests.

    Differential Revision: https://reviews.llvm.org/D60650 (detail)
    by nikic
  464. [AMDGPU][MC] Corrected handling of "-" before expressions

    See bug 41156: https://bugs.llvm.org/show_bug.cgi?id=41156

    Reviewers: artem.tamazov, arsenm

    Differential Revision: https://reviews.llvm.org/D60622 (detail)
    by dpreobra
  465. [ARM] tighten test checks; NFC (detail)
    by spatel
  466. AMDGPU: Force skip over SMRD, VMEM and s_waitcnt instructions

    Summary: This fixes a large Dawn of War 3 performance regression with RADV from Mesa 19.0 to master which was caused by creating less code in some branches.

    Reviewers: arsen, nhaehnle

    Reviewed By: nhaehnle

    Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60824 (detail)
    by pendingchaos
  467. [ARM] make test checks more thorough; NFC

    This will change with the proposal in D60214.
    Unfortunately, the triple is not supported for auto-generation
    via script, and the multiple RUN lines have diffs on this test,
    but I can't tell exactly what is required by this test.
    PR7162 was an assert/crash, so hopefully, this is good enough. (detail)
    by spatel
  468. [LoopUnroll] Allow unrolling if the unrolled size does not exceed loop size.

    Summary:
    In the following cases, unrolling can be beneficial, even when
    optimizing for code size:
    1) very low trip counts
    2) potential to constant fold most instructions after fully unrolling.

    We can unroll in those cases, by setting the unrolling threshold to the
    loop size. This might highlight some cost modeling issues and fixing
    them will have a positive impact in general.

    Reviewers: vsk, efriedma, dmgreen, paquette

    Reviewed By: paquette

    Differential Revision: https://reviews.llvm.org/D60265 (detail)
    by fhahn
  469. [DAGCombine] Add SimplifyDemandedBits helper that handles demanded elts mask as well

    The other SimplifyDemandedBits helpers become wrappers to this new demanded elts variant. (detail)
    by rksimon
  470. [Support] Add LEB128 support to BinaryStreamReader/Writer.

    Summary:
    This patch adds support for ULEB128 and SLEB128 encoding and decoding to
    BinaryStreamWriter and BinaryStreamReader respectively.

    Support for ULEB128/SLEB128 will be used for eh-frame parsing in the JITLink
    library currently under development (see https://reviews.llvm.org/D58704).

    Reviewers: zturner, dblaikie

    Subscribers: kristina, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60810 (detail)
    by lhames
  471. [ScheduleDAGRRList] Recompute topological ordering on demand.

    Currently there is a single point in ScheduleDAGRRList, where we
    actually query the topological order (besides init code). Currently we
    are recomputing the order after adding a node (which does not have
    predecessors) and then we add predecessors edge-by-edge.

    We can avoid adding edges one-by-one after we added a new node. In that case, we can
    just rebuild the order from scratch after adding the edges to the DAG
    and avoid all the updates to the ordering.

    Also, we can delay updating the DAG until we query the DAG, if we keep a
    list of added edges. Depending on the number of updates, we can either
    apply them when needed or recompute the order from scratch.

    This brings down the geomean compile time for of CTMark with -O1 down 0.3% on X86,
    with no regressions.

    Reviewers: MatzeB, atrick, efriedma, niravd, paquette

    Reviewed By: efriedma

    Differential Revision: https://reviews.llvm.org/D60125 (detail)
    by fhahn
  472. [AMDGPU][MC] Corrected parsing of registers

    See bug 41280: https://bugs.llvm.org/show_bug.cgi?id=41280

    Reviewers: artem.tamazov, arsenm

    Differential Revision: https://reviews.llvm.org/D60621 (detail)
    by dpreobra
  473. [AMDGPU] Flag new raw/struct atomic ops as source of divergence

    Differential Revision: https://reviews.llvm.org/D60731

    Change-Id: I821d93dec8b9cdd247b8172d92fb5e15340a9e7d (detail)
    by tpr
  474. gn build: Merge r358554 (detail)
    by nico
  475. [LLVM-C] Add DIFile Field Accesssors

    Summary:
    Add accessors for the file, directory, source file name (curiously, an `Optional` value?), of a DIFile.

    This is intended to replace the LLVMValueRef-based accessors used in D52239

    Reviewers: whitequark, jberdine, deadalnix

    Reviewed By: whitequark, jberdine

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60489 (detail)
    by codafi
  476. [CostModel][X86] Add bool anyof/allof reduction costs

    On pre-AVX512 targets we can use MOVMSK to extract reduced boolean results. This is properly optimized, annoyingly AVX512 isn't and produces code that is almost as bad as the (unchanged) costs suggest......

    Differential Revision: https://reviews.llvm.org/D60403 (detail)
    by rksimon
  477. [DWARF] llvm::Error -> Error. NFC

    The unqualified name is more common and is used in the file as well. (detail)
    by maskray
  478. Change some llvm::{lower,upper}_bound to llvm::bsearch. NFC (detail)
    by maskray
  479. [llvm-objcopy] Support full list of bfd targets that lld uses.

    Summary:
    This change takes the full list of bfd targets that lld supports (see `ScriptParser.cpp`), including generic handling for `*-freebsd` targets (which uses the same settings but with a FreeBSD OSABI). In particular this adds mips support for `--output-target` (but not yet via `--binary-architecture`).

    lld and llvm-objcopy use their own different custom data structures, so I'd prefer to check this in as-is (add support directly in llvm-objcopy, including all the test coverage) and do a separate NFC patch(s) that consolidate the two by putting this mapping into libobject.

    See [[ https://bugs.llvm.org/show_bug.cgi?id=41462 | PR41462 ]].

    Reviewers: jhenderson, jakehehrlich, espindola, alexshap, arichardson

    Reviewed By: arichardson

    Subscribers: fedor.sergeev, emaste, sdardis, krytarowski, atanasyan, llvm-commits, MaskRay, arichardson

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60773 (detail)
    by rupprecht
  480. [CVP] processOverflowIntrinsic(): don't crash if constant-holding happened

    As reported by Mikael Holmén in post-commit review in
    https://reviews.llvm.org/D60791#1469765 (detail)
    by lebedevri
  481. [DWARF] Pass ReferenceToDIEOffsets elements by reference (detail)
    by maskray
  482. Fixed error message printing in write_cmake_config.py

    Summary:
    Previously, write_cmake_config.py would raise an error while printing
    the error, because `leftovers` in "'\n'.join(leftovers)" is a tuple.

    Subscribers: mgorny, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60766 (detail)
    by gribozavr
  483. [X86] Autogenerate complete checks. NFC (detail)
    by ctopper
  484. [X86] In CopyToFromAsymmetricReg, use VR128 instead of FR32 instructions for GR32<->XMM register copies.

    We have two versions of some instructions, VR128 versions and FR32 versions that
    are marked as CodeGenOnly.

    This change switches to using the VR128 versions for these copies. It's after
    register allocation so the class size no longer matters. This matches how GR64
    works. (detail)
    by ctopper
  485. [MCA] Moved the bottleneck analysis to its own file. NFCI (detail)
    by adibiagio
  486. Revert "Add basic loop fusion pass." Per request.

    This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. (detail)
    by echristo
  487. Revert "Temporarily Revert "Add basic loop fusion pass.""

    The reversion apparently deleted the test/Transforms directory.

    Will be re-reverting again. (detail)
    by echristo
  488. Remove the run-slp-after-loop-vectorization option.

    It's been on by default for 4 years and cleans up the pass
    hierarchy. (detail)
    by echristo
  489. Temporarily Revert "Add basic loop fusion pass."
    As it's causing some bot failures (and per request from kbarton).

    This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. (detail)
    by echristo
  490. Add basic loop fusion pass.

    This patch adds a basic loop fusion pass. It will fuse loops that conform to the
    following 4 conditions:
      1. Adjacent (no code between them)
      2. Control flow equivalent (if one loop executes, the other loop executes)
      3. Identical bounds (both loops iterate the same number of iterations)
      4. No negative distance dependencies between the loop bodies.

    The pass does not make any changes to the IR to create opportunities for fusion.
    Instead, it checks if the necessary conditions are met and if so it fuses two
    loops together.

    The pass has not been added to the pass pipeline yet, and thus is not enabled by
    default. It can be run stand alone using the -loop-fusion option.

    Phabricator: https://reviews.llvm.org/D55851 (detail)
    by kbarton
  491. [ADT] llvm::bsearch, binary search for mere mortals

    Summary:
    Add to STLExtras a binary search function with a simple mental model:
    You provide a range and a predicate which is true above a certain point.
    bsearch() tells you that point.
    Overloads are provided for integers, iterators, and containers.

    This is more suitable than std:: alternatives in many cases:
    - std::binary_search only indicates presence/absence
    - upper_bound/lower_bound give you the opportunity to pick the wrong one
    - all of the options have confusing names and definitions when your predicate
       doesn't have simple "less than" semantics
    - all of the options require iterators
    - we plumb around a useless `value` parameter that should be a lambda capture

    The API is inspired by Go's standard library, but we add an extra parameter as
    well as some overloads and templates to show how clever C++ is.

    Reviewers: ilya-biryukov, gribozavr

    Subscribers: dexonsmith, kristina, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60779 (detail)
    by sammccall
  492. [x86] adjust LEA tests for better coverage; NFC

    The scale can 1, 2, or 3. (detail)
    by spatel
  493. [LLVM-C] Add Accessors For Global Variable Metadata Properties

    Summary: Metadata for a global variable is really a  (GlobalVariable, Expression) tuple.  Allow access to these, then allow retrieving the file, scope, and line for a DIVariable, whether global or local.  This should be the last of the accessors required for uniform access to location and file information metadata.

    Reviewers: jberdine, whitequark, deadalnix

    Reviewed By: jberdine, whitequark

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60725 (detail)
    by codafi
  494. Fix a typo in comments. [NFC] (detail)
    by tamur
  495. [NVPTXAsmPrinter] clean up dead code. NFC

    Summary:
    The printOperand function takes a default parameter, for which there are
    zero call sites that explicitly pass such a parameter.  As such, there
    is no case to support. This means that the method
    printVecModifiedImmediate is purly dead code, and can be removed.

    The eventual goal for some of these AsmPrinter refactoring is to have
    printOperand be a virtual method; making it easier to print operands
    from the base class for more generic Asm printing. It will help if all
    printOperand methods have the same function signature (ie. no Modifier
    argument when not needed).

    Reviewers: echristo, tra

    Reviewed By: echristo

    Subscribers: jholewinski, hiraditya, llvm-commits, craig.topper, srhines

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60727 (detail)
    by nickdesaulniers
  496. [TargetLowering] Rename preferShiftsToClearExtremeBits and shouldFoldShiftPairToMask (PR41359)

    As discussed on PR41359, this patch renames the pair of shift-mask target feature functions to make their purposes more obvious.

    shouldFoldShiftPairToMask -> shouldFoldConstantShiftPairToMask

    preferShiftsToClearExtremeBits -> shouldFoldMaskToVariableShiftPair (detail)
    by rksimon
  497. [EarlyCSE] detect equivalence of selects with inverse conditions and commuted operands (PR41101)

    This is 1 of the problems discussed in the post-commit thread for:
    rL355741 / http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190311/635516.html
    and filed as:
    https://bugs.llvm.org/show_bug.cgi?id=41101

    Instcombine tries to canonicalize some of these cases (and there's room for improvement
    there independently of this patch), but it can't always do that because of extra uses.
    So we need to recognize these commuted operand patterns here in EarlyCSE. This is similar
    to how we detect commuted compares and commuted min/max/abs.

    Differential Revision: https://reviews.llvm.org/D60723 (detail)
    by spatel
  498. Time profiler: optimize json output time

    Summary:
    Use llvm::json::Array.reserve() to optimize json output time. Here is motivation:
    https://reviews.llvm.org/D60609#1468941. In short: for the json array
    with ~32K entries, pushing back each entry takes ~4% of whole time compared
    to the method of preliminary memory reservation: (3995-3845)/3995 = 3.75%.

    Reviewers: lebedev.ri

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60792 (detail)
    by anton-afanasyev
  499. [CVP] Simplify umulo and smulo that cannot overflow

    If a umul.with.overflow or smul.with.overflow operation cannot
    overflow, simplify it to a simple mul nuw / mul nsw. After the
    refactoring in D60668 this is just a matter of removing an
    explicit check against multiplications.

    Differential Revision: https://reviews.llvm.org/D60791 (detail)
    by nikic
  500. [Support][JSON] Add reserve() to json Array

    Summary:
    Space reservation increases json lib performance for the arrays with large number of entries.
    Here is the example and discussion: https://reviews.llvm.org/D60609#1468941

    Reviewers: lebedev.ri, sammccall

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60788 (detail)
    by anton-afanasyev
  501. [SLP] Refactoring of the operand reordering code.

    This is a refactoring patch which should have all the functionality of the current code. Its goal is twofold:
    i. Cleanup and simplify the reordering code, and
    ii. Generalize reordering so that it will work for an arbitrary number of operands, not just 2.

    This is the second patch in a series of patches that will enable operand reordering across chains of operations. An example of this was presented in EuroLLVM'18 https://www.youtube.com/watch?v=gIEn34LvyNo .

    Committed on behalf of @vporpo (Vasileios Porpodas)

    Differential Revision: https://reviews.llvm.org/D59973 (detail)
    by rksimon
  502. [CVP] Add tests for non-overflowing mulo; NFC

    Should be simplified to simple mul. (detail)
    by nikic
  503. [X86][AVX] X86ISD::PERMV/PERMV3 node types can never fold index ops

    Improves codegen demonstrated by D60512 - instructions represented by X86ISD::PERMV/PERMV3 can never memory fold the operand used for their index register.

    This patch updates the 'isUseOfShuffle' helper into the more capable 'isFoldableUseOfShuffle' that recognises that the op is used for a X86ISD::PERMV/PERMV3 index mask and can't be folded - allowing us to use broadcast/subvector-broadcast ops to reduce the size of the mask constant pool data.

    Differential Revision: https://reviews.llvm.org/D60562 (detail)
    by rksimon
  504. [InstCombine] Prune fshl/fshr with masked operands

    If a constant shift amount is used, then only some of the LHS/RHS
    operand bits are demanded and we may be able to simplify based on
    that. InstCombineSimplifyDemanded already had the necessary support
    for that, we just weren't calling it with fshl/fshr as root.

    In particular, this allows us to relax some masked funnel shifts
    into simple shifts, as shown in the tests.

    Patch by Shawn Landden.

    Differential Revision: https://reviews.llvm.org/D60660 (detail)
    by nikic
  505. [InstCombine] Add tests for fshl/fshr with masked operands; NFC

    Baseline tests for D60660.

    Patch by Shawn Landden.

    Differential Revision: https://reviews.llvm.org/D60688 (detail)
    by nikic
  506. [x86] add more tests for LEA formation; NFC

    Promoting the shift to the wider type should allow LEA. (detail)
    by spatel
  507. [IR] Add WithOverflowInst class

    This adds a WithOverflowInst class with a few helper methods to get
    the underlying binop, signedness and nowrap type and makes use of it
    where sensible. There will be two more uses in D60650/D60656.

    The refactorings are all NFC, though I left some TODOs where things
    could be improved. In particular we have two places where add/sub are
    handled but mul isn't.

    Differential Revision: https://reviews.llvm.org/D60668 (detail)
    by nikic
  508. [Tests] Add branch_weights to latches so that test is not effected by future profitability patch to LoopPredication (detail)
    by reames
  509. [Hexagon] Remove indeterministic traversal order

    Patch by Sergei Larin. (detail)
    by kparzysz
  510. [llvm-objdump] Test tabs in disassemble-align.s with a more visible character

    Summary: Apply rupprecht's suggestion in D60376

    Reviewers: rupprecht

    Reviewed By: rupprecht

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60777 (detail)
    by maskray
  511. [DAGCombiner] Add missing flag to addressing mode check

    The checks in `canFoldInAddressingMode` tested for addressing modes that have a
    base register but didn't set the `HasBaseReg` flag to true (it's false by
    default). This patch fixes that. Although the omission of the flag was
    technically incorrect it had no known observable impact, so no tests were
    changed by this patch.

    Differential Revision:  https://reviews.llvm.org/D60314 (detail)
    by luismarques
  512. [OCaml] Update api to account for FNeg and CallBr instructions

    Summary:
    This diff adds minimal support for the recent FNeg and CallBr
    instructions to the OCaml bindings.

    Reviewers: whitequark

    Reviewed By: whitequark

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60680 (detail)
    by whitequark
  513. [RISCV] Custom lower SHL_PARTS, SRA_PARTS, SRL_PARTS

    When not optimizing for minimum size (-Oz) we custom lower wide shifts
    (SHL_PARTS, SRA_PARTS, SRL_PARTS) instead of expanding to a libcall.

    Differential Revision: https://reviews.llvm.org/D59477 (detail)
    by luismarques
  514. [SystemZ] Add missing intrinsics to intrinsics-immarg.ll

    As of r356091, support for the ImmArg intrinsics was added,
    including a SystemZ test case.  However, that test case doesn't
    actually verify all SystemZ intrinsics with immediate arguments,
    only a subset.  The rest of them actually works correctly, there's
    just no test for them.  This patch add all missing intrinsics. (detail)
    by uweigand
  515. [llvm][Support] Provide interface to set thread priorities

    Summary:
    We have a multi-platform thread priority setting function(last piece
    landed with D58683), I wanted to make this available to all llvm community,
    there seem to be other users of such functionality with portability fixmes:
    lib/Support/CrashRecoveryContext.cpp
    tools/clang/tools/libclang/CIndex.cpp

    Reviewers: gribozavr, ioeric

    Subscribers: krytarowski, jfb, kristina, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D59130 (detail)
    by kadircet
  516. llvm-undname: Consistently use "return nullptr" in functions returning pointers (detail)
    by nico
  517. llvm-undname: Fix nullptr deref on invalid structor names in template args

    Similar to r358421: A StructorIndentifierNode has a Class field which
    is read when printing it, but if the StructorIndentifierNode appears in
    a template argument then demangleFullyQualifiedSymbolName() which sets
    Class isn't called. Since StructorIndentifierNodes are always leaf
    names, we can just reject them as well.

    Found by oss-fuzz. (detail)
    by nico
  518. llvm-undname: Tweak arena allocator

    - Make `allocUnalignedBuffer` look more like `allocArray` and `alloc`.
      No behavior change.
    - Change `Head->Used < Head->Capacity` to `Head->Used <= Head->Capacity`
      in `allocArray` and `alloc`. No intended behavior change, might be a
      minuscule memory usage improvement. Noticed this since it was the logic
      used in `allocUnalignedBuffer`.
    - Don't let `allocArray` alloc too small buffers for names that have
      more than 512 levels of nesting (in 64-bit builds). Fixes a heap
      buffer overflow found by oss-fuzz.

    Differential Revision: https://reviews.llvm.org/D60774 (detail)
    by nico
  519. llvm-undname: add a missing CHECK: to a passing test (detail)
    by nico
  520. Fix llvm-undname tests after r358485 (detail)
    by nico
  521. gn build: Merge r358422 (detail)
    by nico
  522. llvm-undname: Add a -raw-file flag to pass a raw buffer to microsoftDemangle

    The default handling splits input into lines. Since
    llvm-microsoft-demangle-fuzzer doesn't do this, oss-fuzz produces inputs
    that only trigger crashes if the input isn't split into lines. This adds
    a hidden flag -raw-file which passes file contents to microsoftDemangle() in
    the same way the fuzzer does, for reproducing oss-fuzz reports.

    Also change llvm-undname to have a non-0 exit code for invalid symbols.

    Differential Revision: https://reviews.llvm.org/D60771 (detail)
    by nico
  523. Re-commit r357452: SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)

    The original commit caused false positives from AddressSanitizer's
    use-after-scope checks, which have now been fixed in r358478.

    > The code was previously checking that candidates for sinking had exactly
    > one use or were a store instruction (which can't have uses). This meant
    > we could sink call instructions only if they had a use.
    >
    > That limitation seemed a bit arbitrary, so this patch changes it to
    > "instruction has zero or one use" which seems more natural and removes
    > the need to special-case stores.
    >
    > Differential revision: https://reviews.llvm.org/D59936 (detail)
    by hans
  524. Removed CMake cache upgrade code from 2011

    Summary:
    This code was added in r141266 to make a breaking change to CMake, but
    still be compatible with existing cache files.  The cache files from
    2011 are irrelevant today in 2019.

    Subscribers: mgorny, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60711 (detail)
    by gribozavr
  525. Asan use-after-scope: don't poison allocas if there were untraced lifetime intrinsics in the function (PR41481)

    If there are any intrinsics that cannot be traced back to an alloca, we
    might have missed the start of a variable's scope, leading to false
    error reports if the variable is poisoned at function entry. Instead, if
    there are some intrinsics that can't be traced, fail safe and don't
    poison the variables in that function.

    Differential revision: https://reviews.llvm.org/D60686 (detail)
    by hans
  526. Use native llvm JSON library for time profiler output

    Summary: Replace plain json text output with llvm JSON library wrapper using.

    Reviewers: takuto.ikuta, lebedev.ri

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60609 (detail)
    by anton-afanasyev
  527. [llvm-objdump] Align instructions to a tab stop in disassembly output

    This relands D60376/rL358405, with the difference: sed 'y/\t/ /' -> tr '\t' ' '
    BSD sed doesn't support escape characters for the 'y' command.
    I didn't use it in rL358405 because it was not listed at
    https://llvm.org/docs/GettingStarted.html#software but it
    should be available.

    Original description:

    In GNU objdump, -w/--wide aligns instructions in the disassembly output.
    This patch does the same to llvm-objdump. However, we always use the
    wide format (-w/--wide is ignored), because the narrow format
    (instructions are misaligned) is probably not very useful.

    In llvm-readobj, we made a similar decision: always use the wide format,
    accept but ignore -W/--wide.

    To save some columns, we change the tab before hex bytes (controlled by
    --[no-]show-raw-insn) to a space. (detail)
    by maskray
  528. [llvm-objdump] Simplify PrintHelpMessage() logic

    This relands rL358418. It missed one test that should also use -macho
    Note, all the other -private-header -exports-trie tests are used
    together with -macho. (detail)
    by maskray
  529. [CodeExtractor] Add a few debug lines to understand why a region is not extracted

    The CodeExtractor is not smart enough to compute which basic block is
    the entry of a region. Instead it relies on the order of the list
    of basic blocks that is handed to it and assumes that the entry
    is the first block in the list.

    Without the additional debug information, it is hard to understand
    why a valid region does not get extracted, because we would miss
    that the order of in the list just doesn't match what the CodeExtractor
    wants.

    NFC (detail)
    by qcolombet
  530. Remove some more unused headers from MachineFunction.h and friends.

    Most of these headers are still included via transitive includes and
    so won't likely show any problems or improvements in incremental
    rebuild time.

    Differential Revision: https://reviews.llvm.org/D60741 (detail)
    by echristo
  531. Reapply [Support] Fix recursive response file expansion guard

    The test in the dependent revision has been fixed for Windows.

    Original commit message:

    Response file expansion limits the amount of expansion to prevent
    potential infinite recursion. However, the current logic assumes that
    any argument beginning with @ is a response file, which is not true for
    e.g. `-Xlinker -rpath -Xlinker @executable_path/../lib` on Darwin.
    Having too many of these non-response file arguments beginning with @
    prevents actual response files from being expanded. Instead, limit based
    on the number of successful response file expansions, which should still
    prevent infinite recursion but also avoid false positives.

    Differential Revision: https://reviews.llvm.org/D60631

    llvm-svn: 358452 (detail)
    by smeenai
  532. Reapply [Support] Add a test for recursive response file expansion

    Use the appropriate tokenizer to fix the test on Windows.

    Original commit message:

    I'm going to be modifying the logic to avoid infinitely recursing on
    self-referential response files, so add a unit test to verify the
    expected behavior.

    Differential Revision: https://reviews.llvm.org/D60630

    llvm-svn: 358451 (detail)
    by smeenai
  533. Revert [Support] Add a test for recursive response file expansion

    This reverts r358451 (git commit c8497467edc5766ae81ffbde58159f8c6af50803)

    The test breaks a Windows buildbot:
    http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17016/steps/test-check-all/logs/stdio (detail)
    by smeenai
  534. Revert [Support] Fix recursive response file expansion guard

    This reverts r358452 (git commit c8df4fb9c3865eac52a99602c26bbc070098c3d4)

    A dependent commit breaks the Windows buildbots. (detail)
    by smeenai
  535. Revert r358405: "[llvm-objdump] Align instructions to a tab stop in disassembly output"

    The test fails on darwin due to a sed error:

    sed: 1: "y/\t/ /": transform strings are not the same length (detail)
    by arphaman
  536. [AArch64][GlobalISel] Don't do extending loads combine for non-pow-2 types.

    Since non-pow-2 types are going to get split up into multiple loads anyway,
    don't do the [SZ]EXTLOAD combine for those and save us trouble later in
    legalization. (detail)
    by aemerson
  537. [LSR] Rewrite misses some fixup locations if it splits critical edge

    If LSR split critical edge during rewriting phi operands and
    phi node has other pending fixup operands, we need to
    update those pending fixups. Otherwise formulae will not be
    implemented completely and some instructions will not be eliminated.

    llvm.org/PR41445

    Differential Revision: https://reviews.llvm.org/D60645

    Patch by: Denis Bakhvalov <denis.bakhvalov@intel.com> (detail)
    by qcolombet
  538. Only use argv[0] as the main executable name if it exists.

    Under some environments, argv[0] doesn't hold a valid file name, but
    sys::fs::getMainExecutable will find the main executable properly.

    This patch tweaks the logic to fall back to sys::fs::getMainExecutable
    in more situations.

    Differential Revision: https://reviews.llvm.org/D60730 (detail)
    by silvas
  539. [EarlyCSE] add more tests for double-negated select condition; NFC (detail)
    by spatel
  540. [Support] Fix recursive response file expansion guard

    Response file expansion limits the amount of expansion to prevent
    potential infinite recursion. However, the current logic assumes that
    any argument beginning with @ is a response file, which is not true for
    e.g. `-Xlinker -rpath -Xlinker @executable_path/../lib` on Darwin.
    Having too many of these non-response file arguments beginning with @
    prevents actual response files from being expanded. Instead, limit based
    on the number of successful response file expansions, which should still
    prevent infinite recursion but also avoid false positives.

    Differential Revision: https://reviews.llvm.org/D60631 (detail)
    by smeenai
  541. [Support] Add a test for recursive response file expansion

    I'm going to be modifying the logic to avoid infinitely recursing on
    self-referential response files, so add a unit test to verify the
    expected behavior.

    Differential Revision: https://reviews.llvm.org/D60630 (detail)
    by smeenai
  542. [X86] Limit the 'x' inline assembly constraint to zmm0-15 when used for a 512 type.

    The 'v' constraint is used to select zmm0-31. This makes 512 bit consistent with 128/256-bit.a (detail)
    by ctopper
  543. [X86] Fix a stack folding test to have a full xmm2-31 clobber list instead of stopping at xmm15. Add an additional dependency to keep instruction below inline asm block. (detail)
    by ctopper
  544. Time profiler: small fixes and optimizations

    Summary: Fixes from Roman's review here: https://reviews.llvm.org/D58675#1465336

    Reviewers: lebedev.ri

    Subscribers: hiraditya, mgrang, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D60663 (detail)
    by anton-afanasyev
  545. AMDGPU: Fix unreachable when counting register usage of SGPR96 (detail)
    by arsenm
  546. AMDGPU: Fix printed format of SReg_96

    These are artificial, so I think this should only come up with inline
    asm comments. (detail)
    by arsenm
  547. [EarlyCSE] add test for select condition double-negation; NFC (detail)
    by spatel
  548. Revert r358418: "[llvm-objdump] Simplify PrintHelpMessage() logic"

    This reverts commit r358418 as it broke `test/Object/objdump-export-list`
    on Darwin. (detail)
    by arphaman
  549. [Tests] Add a few more tests for LoopPredication w/invariant loads

    Making sure to cover an important legality cornercase. (detail)
    by reames
  550. [X86] Block i32/i64 for 'k' and 'Yk' in getRegForInlineAsmConstraint without avx512bw.

    32 and 64 bit k-registers require avx512bw. If we don't block this properly, it leads to a crash. (detail)
    by ctopper
  551. [LoopPred] Stop passing around builders [NFC]

    This is a preparatory patch for D60093. This patch itself is NFC, but while preparing this I noticed and committed a small hoisting change in rL358419.

    The basic structure of the new scheme is that we pass around the guard ("the using instruction"), and select an optimal insert point by examining operands at each construction point. This seems conceptually a bit cleaner to start with as it isolates the knowledge about insertion safety at the actual insertion point.

    Note that the non-hoisting path is not actually used at the moment. That's not exercised until D60093 is rebased on this one.

    Differential Revision: https://reviews.llvm.org/D60718 (detail)
    by reames
  552. [x86] update test checks; NFC (detail)
    by spatel
  553. [DEBUGINFO] Prevent Instcombine from dropping debuginfo when removing zexts

    Zexts can be treated like no-op casts when it comes to assessing whether their
    removal affects debug info.

    Reviewer: aprantl

    Differential Revision: https://reviews.llvm.org/D60641 (detail)
    by wolfgangp
  554. Add explicit dependency to MCDwarf.h in ARC backend. (detail)
    by petecoup
  555. Fix header guard typo and build error. (detail)
    by yamauchi
  556. [CommandLineParser] Add DefaultOption flag

    Summary: Add DefaultOption flag to CommandLineParser which provides a
    default option or alias, but allows users to override it for some
    other purpose as needed.

    Also, add `-h` as a default alias to `-help`, which can be seamlessly
    overridden by applications like llvm-objdump and llvm-readobj which
    use `-h` as an alias for other options.

    (relanding after revert, r358414)
    Added DefaultOptions.clear() to reset().

    Reviewers: alexfh, klimek

    Reviewed By: klimek

    Subscribers: kristina, MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D59746 (detail)
    by dhinton
  557. [X86] Restore the pavg intrinsics.

    The pattern we replaced these with may be too hard to match as demonstrated by
    PR41496 and PR41316.

    This patch restores the intrinsics and then we can start focusing
    on the optimizing the intrinsics.

    I've mostly reverted the original patch that removed them. Though I modified
    the avx512 intrinsics to not have masking built in.

    Differential Revision: https://reviews.llvm.org/D60674 (detail)
    by ctopper
  558. Add slbfee instruction. (detail)
    by sfertile
  559. [PGO] Profile guided code size optimization.

    Summary:
    Enable some of the existing size optimizations for cold code under PGO.

    A ~5% code size saving in big internal app under PGO.

    The way it gets BFI/PSI is discussed in the RFC thread

    http://lists.llvm.org/pipermail/llvm-dev/2019-March/130894.html

    Note it doesn't currently touch loop passes.

    Reviewers: davidxl, eraman

    Reviewed By: eraman

    Subscribers: mgorny, javed.absar, smeenai, mehdi_amini, eraman, zzheng, steven_wu, dexonsmith, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D59514 (detail)
    by yamauchi
  560. llvm-undname: Fix nullptr deref on invalid conversion operator names in template args

    A ConversionOperatorIdentifierNode has a TargetType which is read when
    printing it, but if the ConversionOperatorIdentifierNode appears in a
    template argument there's nothing that can provide the TargetType.
    Normally the COIN is a symbol (leaf) name and takes its TargetType from the
    symbol's type, but in a template argument context the COIN can only be
    either a non-leaf name piece or a type, and must hence be invalid.

    Similar to the COIN check in demangleDeclarator().

    Found by oss-fuzz. (detail)
    by nico
  561. [EarlyCSE] add tests for selects with commuted operands (PR41101); NFC (detail)
    by spatel
  562. [LoopPred] Hoist and of predicated checks where legal

    If we have multiple range checks which can be predicated, hoist the and of the results outside the loop.  This minorly cleans up the resulting IR, but the main motivation is as a building block for D60093. (detail)
    by reames
  563. [llvm-objdump] Simplify PrintHelpMessage() logic (detail)
    by maskray
  564. [llvm-objdump] Wrap things in namespace llvm (detail)
    by maskray
  565. [llvm-objdump] Delete unused forward declarations (detail)
    by maskray
  566. [llvm-objdump] Reorganize cl::opt variables and move Mach-O specifics to MachODump.cpp (detail)
    by maskray
  567. Revert r358337: "[CommandLineParser] Add DefaultOption flag"

    The change causes test failures under asan. Reverting to unbreak our
    integrate. (detail)
    by ibiryukov
  568. [EarlyCSE] regenerate test checks; NFC (detail)
    by spatel
  569. [llvm-objdump] Align instructions to a tab stop in disassembly output

    Summary:
    In GNU objdump, -w/--wide aligns instructions in the disassembly output.
    This patch does the same to llvm-objdump. However, we always use the
    wide format (-w/--wide is ignored), because the narrow format
    (instructions are misaligned) is probably not very useful.

    In llvm-readobj, we made a similar decision: always use the wide format,
    accept but ignore -W/--wide.

    To save some columns, we change the tab before hex bytes (controlled by
    --[no-]show-raw-insn) to a space.

    Reviewers: rupprecht, jhenderson, grimar

    Reviewed By: jhenderson

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60376 (detail)
    by maskray
  570. [InstCombine] canonicalize fdiv after fmul if reassociation is allowed

      (X / Y) * Z --> (X * Z) / Y

    This can allow other optimizations/reassociations as shown in the test diffs. (detail)
    by spatel
  571. DAG: propagate ConsecutiveRegs flags to returns too.

    Arguments already have a flag to inform backends when they have been split up.
    The AArch64 arm64_32 ABI makes use of these on return types too, so that code
    emitted for armv7k can be ABI-compliant.

    There should be no CodeGen changes yet, just making more information available. (detail)
    by tnorthover
  572. DAG: propagate whether an arg is a pointer for CallingConv decisions.

    The arm64_32 ABI specifies that pointers (despite being 32-bits) should be
    zero-extended to 64-bits when passed in registers for efficiency reasons. This
    means that the SelectionDAG needs to be able to tell the backend that an
    argument was originally a pointer, which is implmented here.

    Additionally, some memory intrinsics need to be declared as taking an i8*
    instead of an iPTR.

    There should be no CodeGen change yet, but it will be triggered when AArch64
    backend support for ILP32 is added. (detail)
    by tnorthover
  573. gn build: Merge r358390 (detail)
    by nico
  574. [llvm-readelf] Correctly dump symbols whose section id is SHN_XINDEX

    Differential revision: https://reviews.llvm.org/D60614 (detail)
    by evgeny777
  575. [llvm-readobj] Reapply: Improve error message for --string-dump

    This is a resubmission of a previous patch that caused test failures,
    with the fixes for the relevant tests included.

    Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630

    This patch changes the error message when the section specified by
    --string-dump cannot be found by including the name of the section in
    the error message and changing the prefix text to not imply that the
    file itself was invalid. As part of this change some uses of
    std::error_code have been replaced with the llvm Error class to better
    encapsulate the error info (rather than passing File strings around),
    and the WithColor class replaces string literal error prefixes. (detail)
    by stozer
  576. [AMDGPU] Fixed incorrect test in vcnd/vcmp optimization

    This fixes a test I introduced in change D59191 (that added src0 and
    src1 modifiers to the v_cndmask instruction for disassembly purposes).

    Spotted by David Binderman in bug 41488.

    Differential Revision: https://reviews.llvm.org/D60652

    Change-Id: I6ac95e66cd84e812ed3359ad57bcd0e13198ba0c (detail)
    by tpr
  577. [Docs] Switch a code block from LLVM to text

    While I can't replicate this locally, it looks like the buildbots don't
    recognize the IR block in r358385 l764 as IR. Downgrade it to being just
    text while I look into it.

    http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30132 (detail)
    by jmorse
  578. FileCheck [1/12]: Move variable table in new object

    Summary:
    This patch is part of a patch series to add support for FileCheck
    numeric expressions. This specific patch adds a new class to hold
    pattern matching global state.

    The table holding the values of FileCheck variable constitutes some sort
    of global state for the matching phase, yet is passed as parameters of
    all functions using it. This commit create a new FileCheckPatternContext
    class pointed at from FileCheckPattern. While it increases the line
    count, it separates local data from global state. Later commits build
    on that to add numeric expression global state to that class.

    Copyright:
        - Linaro (changes up to diff 183612 of revision D55940)
        - GraphCore (changes in later versions of revision D55940 and
                     in new revision created off D55940)

    Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

    Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60381 (detail)
    by thopre
  579. [TableGen] Include schedule model name in diagnostic.

    If you have more than one schedule model in your TableGen target
    definitions, then the diagnostic "No schedule information for
    instruction 'foo'" is rather unhelpful, because it doesn't tell you
    _which_ schedule model is missing the necessary information (or, as it
    might be, missing the UnsupportedFeatures definition that would stop
    it thinking it needed it).

    Extended the message to include the name of the schedule model that
    it's complaining about.

    Reviewers: nhaehnle, hfinkel, javedabsar, efriedma, javed.absar

    Reviewed By: javed.absar

    Subscribers: javed.absar, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60559 (detail)
    by statham
  580. [Docs] Correct some indentation muppetry that trips buildbots (detail)
    by jmorse
  581. [DWARF] Fix DWARFVerifier::DieRangeInfo::contains

    It didn't handle empty LHS correctly. If two ranges of LHS were
    contiguous and jointly contained one range of RHS, it could also be incorrect.

    DWARFAddressRange::contains can be removed and its tests can be merged into DWARFVerifier::DieRangeInfo::contains (detail)
    by maskray
  582. [DebugInfo][Docs] Document variable location metadata transformations

    This patch adds documentation explaining how variable location information is
    compiled from the IR representation down to the end of the codegen pipeline,
    but avoiding discussion of file formats and encoding.

    This should make it clearer how the dbg.value / dbg.declare etc intrinsics
    are transformed and arranged into DBG_VALUE instructions, and their meaning.

    Differential Revision: https://reviews.llvm.org/D59790 (detail)
    by jmorse
  583. Codegen: Fixed perf branch_weights in couple of tests. NFC.

    This is need to pass future checks of perf branch_weights metadata. (detail)
    by yrouban
  584. Revert "[DWARF] Delete redundant check in DWARFAddressRange::intersects"

    This reverts rL358377. It isn't redundant, though the semantic seems weird. (detail)
    by maskray
  585. [Transforms][ASan] Move findAllocaForValue() to Utils/Local.cpp. NFC

    Summary:
    Factor out findAllocaForValue() from ASan so that we can use it in
    MSan to handle lifetime intrinsics.

    Reviewers: eugenis, pcc

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60615 (detail)
    by glider
  586. [NewPM] Add Option handling for SimplifyCFG

    This patch enables passing options to SimplifyCFGPass via the passes pipeline.

    Reviewers: chandlerc, fedor.sergeev, leonardchan, philip.pfaffe
    Reviewed By: fedor.sergeev
    Subscribers: llvm-commits
    Differential Revision: https://reviews.llvm.org/D60675 (detail)
    by skatkov
  587. [DWARF] Delete redundant check in DWARFAddressRange::intersects (detail)
    by maskray
  588. [DWARF] Fix DWARFVerifier::DieRangeInfo::intersects

    It was incorrect if RHS had more than 1 ranges and one of the ranges interacted with *this (detail)
    by maskray
  589. [DWARF] Make DWARFDebugLine::ParsingState::RowNumber a local variable (detail)
    by maskray
  590. [SelectionDAG] Use KnownBits::computeForAddSub/computeForAddCarry

    Summary:
    Use KnownBits::computeForAddSub/computeForAddCarry
    in SelectionDAG::computeKnownBits when doing value
    tracking for addition/subtraction.

    This should improve the precision of the known bits,
    as we only used to make a simple estimate of known
    zeroes. The KnownBits support functions are also
    able to deduce bits that are known to be one in the
    result.

    Reviewers: spatel, RKSimon, nikic, lebedev.ri

    Reviewed By: nikic

    Subscribers: nikic, javed.absar, lebedev.ri, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60460 (detail)
    by bjope
  591. [X86] Regenerate checks for domain-reassignment.mir

    Apparently there are some stray IMPLICIT_DEF operations that weren't in the
    checks. Not sure if they've always been there or something changed at some
    point. (detail)
    by ctopper
  592. [Sparc] Fix typo. NFC. (detail)
    by jimlin
  593. [GlobalISel] Enable CSE in the IRTranslator & legalizer for -O0 with constants only.

    Other opcodes shouldn't be CSE'd until we can be sure debug info quality won't
    be degraded.

    This change also improves the IRTranslator so that in most places, but not all,
    it creates constants using the MIRBuilder directly instead of first creating a
    new destination vreg and then creating a constant. By doing this, the
    buildConstant() method can just return the vreg of an existing G_CONSTANT
    instead of having to create a COPY from it.

    I measured a 0.2% improvement in compile time and a 0.9% improvement in code
    size at -O0 ARM64.

    Compile time:
    Program                                        base   cse    diff
    test-suite...ark/tramp3d-v4/tramp3d-v4.test     9.04   9.12  0.8%
    test-suite...Mark/mafft/pairlocalalign.test     2.68   2.66 -0.7%
    test-suite...-typeset/consumer-typeset.test     5.53   5.51 -0.4%
    test-suite :: CTMark/lencod/lencod.test         5.30   5.28 -0.3%
    test-suite :: CTMark/Bullet/bullet.test        25.82  25.76 -0.2%
    test-suite...:: CTMark/ClamAV/clamscan.test     6.92   6.90 -0.2%
    test-suite...TMark/7zip/7zip-benchmark.test    34.24  34.17 -0.2%
    test-suite :: CTMark/SPASS/SPASS.test           6.25   6.24 -0.1%
    test-suite...:: CTMark/sqlite3/sqlite3.test     1.66   1.66 -0.1%
    test-suite :: CTMark/kimwitu++/kc.test         13.61  13.60 -0.0%
    Geomean difference                                          -0.2%

    Code size:
    Program                                        base     cse      diff
    test-suite...-typeset/consumer-typeset.test    1315632  1266480 -3.7%
    test-suite...:: CTMark/ClamAV/clamscan.test    1313892  1297508 -1.2%
    test-suite :: CTMark/lencod/lencod.test        1439504  1423112 -1.1%
    test-suite...TMark/7zip/7zip-benchmark.test    2936980  2904172 -1.1%
    test-suite :: CTMark/Bullet/bullet.test        3478276  3445460 -0.9%
    test-suite...ark/tramp3d-v4/tramp3d-v4.test    8082868  8033492 -0.6%
    test-suite :: CTMark/kimwitu++/kc.test         3870380  3853972 -0.4%
    test-suite :: CTMark/SPASS/SPASS.test          1434904  1434896 -0.0%
    test-suite...Mark/mafft/pairlocalalign.test    764528   764528   0.0%
    test-suite...:: CTMark/sqlite3/sqlite3.test    782092   782092   0.0%
    Geomean difference                                              -0.9%

    Differential Revision: https://reviews.llvm.org/D60580 (detail)
    by aemerson
  594. [GlobalISel] Introduce a CSEConfigBase class to allow targets to define their own CSE configs.

    Because CodeGen can't depend on GlobalISel, we need a way to encapsulate the CSE
    configs that can be passed between TargetPassConfig and the targets' custom
    pass configs. This CSEConfigBase allows targets to create custom CSE configs
    which is then used by the GISel passes for the CSEMIRBuilder.

    This support will be used in a follow up commit to allow constant-only CSE for
    -O0 compiles in D60580. (detail)
    by aemerson
  595. llvm-undname: Fix oss-fuzz-foudn crash-on-invalid with incomplete special table nodes (detail)
    by nico
  596. gn build: Merge r358297 (detail)
    by nico
  597. gn build: Merge r358243 (detail)
    by nico
  598. gn build: Merge r358272 (detail)
    by nico
Revision: 358206
Changes
  1. [LibTooling] Fix unneeded use of unique_ptr where shared_ptr is expected.

    Summary: This fixes a few places in the Stencil implementation where a unique_ptr is created at a callsite that expects shared_ptr. Since the former implicitly converts to the latter, the code compiles and runs correctly as is.  But, there's no reason to involve unique_ptr -- the current code was leftover from a previous version in which unique_ptr was the expected type.

    Reviewers: sbenza

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D61005 (detail)
    by ymandel
  2. [OPENMP]Fix PR41617: crash on template instantiation.

    Fixed the crash on the template instantiation when trying to check the
    data locality in the current instantiation scope. (detail)
    by abataev
  3. [libclang] Add missing export for clang_Cursor_isAnonymousRecordDecl

    Follow up for D61232 to fix build. (detail)
    by yvvan
  4. [libclang] Restore old clang_Cursor_isAnonymous behaviour

    D54996 Changed the behaviour of clang_Cursor_isAnonymous, but there is no alternative available to get the old behaviour in some cases, which is essential for determining if a record is syntactically accessible, e.g.

    struct {
      int x;
      int y;
    } foo;

    struct {
      struct {
        int x;
        int y;
      };
    } bar;

    void fun(struct { int x; int y; } *param);
    The only 'anonymous' struct here is the one nested in bar, since there is
    no way to reference the struct itself, only the fields within. Though the
    anonymity applies to the instance itself, not the type.

    To avoid confusion, I have added a new function called clang_Cursor_isAnonymousRecordDecl
    which has the old behaviour of clang_Cursor_isAnonymous (and updated the doc
    for the latter as well, which was seemingly forgotten).

    Patch by Jorn Vernee.

    Differential Revision: https://reviews.llvm.org/D61232 (detail)
    by yvvan
  5. [PowerPC][Clang] Add tests for PowerPC MMX intrinsics

    Add the rest of test cases covering functions defined in mmintrin.h on PowerPC.

    Reviewed By: Jinsong Ji (detail)
    by chaofan
  6. Reinstate r359059, reverted in r359361, with a fix to properly prevent
    us emitting the operand of __builtin_constant_p if it has side-effects.

    Original commit message:

    Fix interactions between __builtin_constant_p and constexpr to match
    current trunk GCC.

    GCC permits information from outside the operand of
    __builtin_constant_p (but in the same constant evaluation context) to be
    used within that operand; clang now does so too. A few other minor
    deviations from GCC's behavior showed up in my testing and are also
    fixed (matching GCC):
      * Clang now supports nullptr_t as the argument type for
        __builtin_constant_p
        * Clang now returns true from __builtin_constant_p if called with a
        null pointer
        * Clang now returns true from __builtin_constant_p if called with an
        integer cast to pointer type (detail)
    by rsmith
  7. [AArch64] Initialize HasMTE (detail)
    by vitalybuka
  8. Revert Fix interactions between __builtin_constant_p and constexpr to match current trunk GCC.

    This reverts r359059 (git commit 0b098754b73f3b96d00ecb1c7605760b11c90298) (detail)
    by jgorbe
  9. [Fuchsia] Support multilib for -fsanitize=address and -fno-exceptions

    This introduces a support for multilibs to Fuchsia driver. Unlike the
    existing multilibs that are used primarily for handling different
    architecture variants, we use multilibs to handle different variants
    of Clang runtime libraries: -fsanitize=address and -fno-exceptions
    are the two we support initially. This replaces the existing support
    for sanitized runtimes libraries that was only used by Fuchsia driver
    and it also refactors some of the logic to allow sharing between GNU
    and Fuchsia drivers.

    Differential Revision: https://reviews.llvm.org/D61040 (detail)
    by phosek
  10. [Driver] Support priority for multilibs

    When more than one multilib flag matches, try to select the best
    possible match based on priority. When two different multilibs with
    the same same priority match, we still throw an error matching the
    existing behavior.

    Differential Revision: https://reviews.llvm.org/D60990 (detail)
    by phosek
  11. [clang][driver] Weaken the test from 359353 to appease Windows bots (detail)
    by arphaman
  12. [driver][macOS] Link libarclite from the default toolchain when clang
    is running in a toolchain outside of xcode

    'libarclite' usually lives in the same toolchain as 'clang'. However, the
    Swift open source toolchains for macOS distribute Clang without 'libarclite'.
    In that case, to allow the linker to find 'libarclite', we point to the
    'libarclite' that should be in the XcodeDefault toolchain instead. The
    path to the toolchain is inferred from the SDK path if it's specified.

    https://bugs.swift.org/browse/SR-9972
    rdar://49947573 (detail)
    by arphaman
  13. Add to the release notes the fact that UninitializedObject checker is now
    considered as stable (detail)
    by sylvestre
  14. [AArch64] Add support for MTE intrinsics
    This provides intrinsics support for Memory Tagging Extension (MTE),
    which was introduced with the Armv8.5-a architecture.
    These intrinsics are available when __ARM_FEATURE_MEMORY_TAGGING is defined.
    Each intrinsic is described in detail in the ACLE Q1 2019 documentation:
    https://developer.arm.com/docs/101028/latest
    Reviewed By: Tim Nortover, David Spickett
    Differential Revision: https://reviews.llvm.org/D60485 (detail)
    by javed.absar
  15. [MinGW] Always emit local typeinfo

    This makes sure that code built with headers for a statically linked
    libc++ also works when linking to the DLL version, when the DLL
    hasn't been built with --export-all-symbols.

    This matches what GCC for MinGW does for this test case.

    Differential Revision: https://reviews.llvm.org/D61177 (detail)
    by mstorsjo
  16. [HIP] Fix visibility of `__constant__` variables.

    Summary:
    - `__constant__` variables should not be `hidden` as the linker may turn
      them into `LOCAL` symbols.

    Reviewers: yaxunl

    Subscribers: jvesely, nhaehnle, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D61194 (detail)
    by hliao
  17. [MinGW] Do dllexport inline methods in template instantiation

    Normally, in MinGW mode, inline methods aren't dllexported.

    However, in the case of a dllimported template instantiation,
    the inline methods aren't instantiated locally, but referenced
    from the instantiation. Therefore, those methods also need to
    be dllexported, in the case of an instantiation.

    GCC suffers from the same issue, reported at [1], but the issue
    is still unresolved there.

    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89088

    Differential Revision: https://reviews.llvm.org/D61176 (detail)
    by mstorsjo
  18. [MinGW] Don't let template instantiation declarations cover nested classes

    An explicit template instantiation declaration used to let
    callers assume both outer and nested classes instantiations were
    defined in a different translation unit.

    If the instantiation is marked dllexport, only the outer class
    is exported, but the caller will try to reference the instantiation
    of both outer and inner classes.

    This makes MinGW mode match both MSVC and Windows Itanium, by
    having instantations only cover the outer class, and locally emitting
    definitions of the nested classes. Windows Itanium was changed to
    use this behavious in SVN r300804.

    This deviates from what GCC does, but should be safe (and only
    inflate the object file size a bit, but MSVC and Windows Itanium
    modes do the same), and fixes cases where inner classes aren't
    dllexported.

    This fixes missing references in combination with dllexported/imported
    template intantiations.

    GCC suffers from the same issue, reported at [1], but the issue
    is still unresolved there. The issue can probably be solved either
    by making dllexport cover all nested classes as well, or this
    way (matching MSVC).

    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89087

    Differential Revision: https://reviews.llvm.org/D61175 (detail)
    by mstorsjo
  19. [OPENMP]Added check for non-random access types for the dependent loop
    counters.

    According to the OpenMP 5.0, For any associated loop where the b or lb
    expression is not loop invariant with respect to the outermost loop, the
    var-outer that appears in the expression may not have a random access
    iterator type. (detail)
    by abataev
  20. [ASTImporter] Copy Argument Passing Restrictions setting when importing a CXXRecordDecl definition

    Summary:
    For a CXXRecordDecl the RecordDeclBits are stored in the DeclContext. Currently when we import the definition of a CXXRecordDecl via the ASTImporter we do not copy over this data.
    This change will add support for copying the ArgPassingRestrictions from RecordDeclBits to fix an LLDB expression parsing bug where we would set it to not pass in registers.
    Note, we did not copy over any other of the RecordDeclBits since we don't have tests for those. We know that copying over LoadedFieldsFromExternalStorage would be a error and that may be the case for others as well.

    The companion LLDB review: https://reviews.llvm.org/D61146

    Differential Review: https://reviews.llvm.org/D61140 (detail)
    by shafik
  21. [BPF] do not generate predefined macro bpf

    "DefineStd(Builder, "bpf", Opts)" generates the following three
    macros:
      bpf
      __bpf
      __bpf__
    and the macro "bpf" is due to the fact that the target language
    is C which allows GNU extensions.

    The name "bpf" could be easily used as variable name or type
    field name. For example, in current linux kernel, there are
    four places where bpf is used as a field name. If the corresponding
    types are included in bpf program, the compilation error will
    occur.

    This patch removed predefined macro "bpf" as well as "__bpf" which
    is rarely used if used at all.

    Signed-off-by: Yonghong Song <yhs@fb.com>

    Differential Revision: https://reviews.llvm.org/D61173 (detail)
    by yhs
  22. [MinGW] Fix dllexport of explicit template instantiation

    Contrary to MSVC, GCC/MinGW needs to have the dllexport attribute
    on the template instantiation declaration, not on the definition.

    Previously clang never marked explicit template instantiations as
    dllexport in MinGW mode, if the instantiation had a previous
    declaration, regardless of where the attribute was placed. This
    makes Clang behave like GCC in this regard, and allows using the
    same attribute form for both MinGW compilers.

    This fixes PR40256.

    Differential Revision: https://reviews.llvm.org/D61118 (detail)
    by mstorsjo
  23. [Analyzer] Iterator Checkers - Do an early return after handling calls

    This patch is more of a fix than a real improvement: in checkPostCall()
    we should return immediately after finding the right call and handling
    it. This both saves unnecessary processing and double-handling calls by
    mistake.

    Differential Revision: https://reviews.llvm.org/D61134 (detail)
    by baloghadamsoftware
  24. [clang-format] Fix documentation for FixNamespaceComments

    Fixes PR40409

    Differential Revision: https://reviews.llvm.org/D61174 (detail)
    by owenpan
  25. PR41607: Don't forget to substitute outer template arguments into a
    class-scope explicit specialization of a class template. (detail)
    by rsmith
  26. [analyzer] RetainCount: Add a suppression for "the Matching rule".

    In the OSObject universe there appears to be another slightly popular contract,
    apart from "create" and "get", which is "matching". It optionally consumes
    a "table" parameter and if a table is passed, it fills in the table and
    returns it at +0; otherwise, it creates a new table, fills it in and
    returns it at +1.

    For now suppress false positives by doing a conservative escape on all functions
    that end with "Matching", which is the naming convention that seems to be
    followed by all such methods.

    Differential Revision: https://reviews.llvm.org/D61161 (detail)
    by dergachev
  27. [analyzer] RetainCount: Allow offsets in return values.

    Because RetainCountChecker has custom "local" reasoning about escapes,
    it has a separate facility to deal with tracked symbols at end of analysis
    and check them for leaks regardless of whether they're dead or not.
    This facility iterates over the list of tracked symbols and reports
    them as leaks, but it needs to treat the return value specially.

    Some custom allocators tend to return the value with an offset, storing
    extra metadata at the beginning of the buffer. In this case the return value
    would be a non-base region. In order to avoid false positives, we still need to
    find the original symbol within the return value, otherwise it'll be unable
    to match it to the item in the list of tracked symbols.

    Differential Revision: https://reviews.llvm.org/D60991 (detail)
    by dergachev
  28. [analyzer] Fix crash when returning C++ objects from ObjC messages-to-nil.

    the assertion is in fact incorrect: there is a cornercase in Objective-C++
    in which a C++ object is not constructed with a constructor, but merely
    zero-initialized. Namely, this happens when an Objective-C message is sent
    to a nil and it is supposed to return a C++ object.

    Differential Revision: https://reviews.llvm.org/D60988 (detail)
    by dergachev
  29. [www] Rebuild cxx_dr_status. (detail)
    by rsmith
  30. C++ DR2387: a variable template declared wtih (or instantiated with) a
    const-qualified type is not implicitly given internal linkage. But a
    variable template declared 'static' is.

    This reinstates part of r359048, reverted in r359076. (detail)
    by rsmith
  31. Add missing diagnostic for explicit instantiation declarations naming
    internal linkage entities.

    Such constructs are ill-formed by [temp.explicit]p13. We make a special
    exception to permit an invalid construct used by libc++ in some build
    modes: its <valarray> header declares some functions with the
    internal_linkage attribute and then (meaninglessly) provides explicit
    instantiation declarations for them. Luckily, Clang happens to
    effectively ignore the explicit instantiation declaration when
    generating code in this case, and this change codifies that behavior.

    This reinstates part of r359048, reverted in r359076. (The libc++ issue
    triggering the rollback has been addressed.) (detail)
    by rsmith
  32. Revert lib/Header: Fix Visual Studio builds

    This reverts r359257 (git commit 00d9789509a4c573a48f60893b95314a119edd42)

    This broke check-clang. (detail)
    by tstellar
  33. lib/Header: Fix Visual Studio builds

    Summary:
    This is a follow up to r355253, which inadvertently broke Visual
    Studio builds by trying to copy files from CMAKE_CFG_INTDIR.

    See https://reviews.llvm.org/D58537#inline-532492

    Reviewers: smeenai, vzakhari, phosek

    Reviewed By: smeenai

    Subscribers: mgorny, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D61054 (detail)
    by tstellar
  34. Revert [COFF] Statically link certain runtime library functions

    This reverts r359250 (git commit 4730604bd3a361c68b92b18bf73a5daa15afe9f4)

    The newly added test should use -cc1 and -emit-llvm and there are other
    test failures that need fixing. (detail)
    by rnk
  35. [COFF] Statically link certain runtime library functions

    Statically link certain runtime library functions for MSVC/GNU Windows
    environments. This is consistent with MSVC behavior.

    Fixes LNK4286 and LNK4217 warnings from link.exe when linking the static
    CRT:
      LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cc.x86_64-calls.o'
      LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_test_main.cc.x86_64-calls.o'
      LINK : warning LNK4217: symbol '_CxxThrowException' defined in 'libvcruntime.lib(throw.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.x86_64-calls.o' in function '"int `public: static class UnitTest::GetInstance * __cdecl testing::UnitTest::GetInstance(void)'::`1'::dtor$5" (?dtor$5@?0??GetInstance@UnitTest@testing@@SAPEAV12@XZ@4HA)'

    Reviewers: mstorsjo, efriedma, TomTan, compnerd, smeenai, mgrang

    Subscribers: abdulras, theraven, smeenai, pcc, mehdi_amini, javed.absar, inglorion, kristof.beyls, dexonsmith, cfe-commits

    Differential Revision: https://reviews.llvm.org/D55229 (detail)
    by rnk
  36. [CUDA] Implemented _[bi]mma* builtins.

    These builtins provide access to the new integer and
    sub-integer variants of MMA (matrix multiply-accumulate) instructions
    provided by CUDA-10.x on sm_75 (AKA Turing) GPUs.

    Also added a feature for PTX 6.4. While Clang/LLVM does not generate
    any PTX instructions that need it, we still need to pass it through to
    ptxas in order to be able to compile code that uses the new 'mma'
    instruction as inline assembly (e.g used by NVIDIA's CUTLASS library
    https://github.com/NVIDIA/cutlass/blob/master/cutlass/arch/mma.h#L101)

    Differential Revision: https://reviews.llvm.org/D60279 (detail)
    by tra
  37. [PGO] Fix buildbot failure in 359215

    Revert the part of changes in r359215 that failing in some platforms.
    I will re-enable them later. (detail)
    by xur
  38. [analyzer] Add FIXMEs for alpha.unix.cstring.OutOfBounds false positives.

    Caused by incorrect strlcat() modeling in r332303,
    cf. https://bugs.llvm.org/show_bug.cgi?id=37687#c8 (detail)
    by dergachev
  39. Skip type units/type uniquing when we know we're only emitting the type once (vtable-based emission when triggered by a strong vtable, with -fno-standalone-debug)

    (this would regress size without a corresponding LLVM change that avoids
    putting other user defined types inside type units when they aren't in
    their own type units - instead emitting declarations inside the type
    unit and a definition in the primary CU)

    Reviewers: aprantl

    Differential Revision: https://reviews.llvm.org/D61079 (detail)
    by dblaikie
  40. [Windows] Separate elements in -print-search-dirs with semicolons

    Path lists on windows should always be separated by semicolons, not
    colons. Reuse llvm::sys::EnvPathSeparator for this purpose (as that's
    also a path list that is separated in the same way).

    Alternatively, this could just be a local ifdef _WIN32 in this function,
    or generalizing the existing EnvPathSeparator to e.g. a
    llvm::sys::path::PathListSeparator?

    Differential Revision: https://reviews.llvm.org/D61121 (detail)
    by mstorsjo
  41. [analyzer][UninitializedObjectChecker] PR41590: Regard _Atomic types as primitive

    https://bugs.llvm.org/show_bug.cgi?id=41590

    For the following code snippet, UninitializedObjectChecker crashed:

    struct MyAtomicInt {
      _Atomic(int) x;
      MyAtomicInt() {}
    };

    void entry() {
      MyAtomicInt b;
    }

    The problem was that _Atomic types were not regular records, unions,
    dereferencable or primitive, making the checker hit the llvm_unreachable at
    lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:347.
    The solution is to regard these types as primitive as well. The test case shows
    that with this addition, not only are we able to get rid of the crash, but we
    can identify x as uninitialized.

    Differential Revision: https://reviews.llvm.org/D61106 (detail)
    by szelethus
  42. DebugInfo: Fix bitrotted test case

    This test was updated with some CHECK suffix variants, but dropped
    checking for the unsuffixed 'CHECK' (detail)
    by dblaikie
  43. creduce-clang-crash: add -F flag to grep to avoid interpreting string as regex (detail)
    by akhuang
  44. [PGO] Enable InstrProf lowering for Clang PGO instrumentation in the new pass manager
    Currently InstrProf lowering is not enabled for Clang PGO instrumentation in
    the new pass manager. The following command
    "-fprofile-instr-generate -fexperimental-new-pass-manager ..." is broken.

    This CL enables InstrProf lowering pass for Clang PGO instrumentation in the
    new pass manager.

    Differential Revision: https://reviews.llvm.org/D61138 (detail)
    by xur
  45. Fix bug 37903:MS ABI: handle inline static data member and inline variable as template static data member (detail)
    by jyu2
  46. [OPENMP] Improved check for the linear dependency in the non-rectangular
    loop nests.

    Added a checks that the initializer/condition expressions depend only
    only of the single previous loop iteration variable. (detail)
    by abataev
  47. [OPENMP][AARCH64]Fix the test for declare simd, NFC.

    Renamed function a01 in the test to fix possible problems with the git
    hash match during testing. (detail)
    by abataev
  48. [Testing] Move clangd::Annotations to llvm testing support

    Summary:
    Annotations allow writing nice-looking unit test code when one needs
    access to locations from the source code, e.g. running code completion
    at particular offsets in a file. See comments in Annotations.cpp for
    more details on the API.

    Also got rid of a duplicate annotations parsing code in clang's code
    complete tests.

    Reviewers: gribozavr, sammccall

    Reviewed By: gribozavr

    Subscribers: mgorny, hiraditya, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D59814 (detail)
    by ibiryukov
  49. [NFC] test commit removing excess line (detail)
    by nik
  50. [PowerPC][NFC]Update licence to Apache 2 (detail)
    by jsji
  51. Fix typo in comment in r312851.

    Thanks to Nico Weber for pointing this out! (detail)
    by rsmith
  52. PR41427: This has apparently been fixed already, just add a regression
    test. (detail)
    by rsmith
  53. [codeview] Fix symbol names for dynamic initializers and atexit stubs

    Summary:
    Add a new variant to GlobalDecl for these so that we can detect them
    more easily during debug info emission and handle them appropriately.

    Reviewers: rsmith, rjmccall, jyu2

    Subscribers: aprantl, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60930 (detail)
    by rnk
  54. [OPENMP]Initial support for non-rectangular loop nest.

    Added basic semantic analysis for the non-rectangular loop nests for
    OpenMP 5.0 support. (detail)
    by abataev
  55. clang-cl: List valid values for /std: in /? output

    Differential Revision: https://reviews.llvm.org/D61029 (detail)
    by nico
  56. Use llvm::stable_sort (detail)
    by maskray
  57. Add 'REQUIRES: shell' to verbose-output-quoting.c

    The lit shell couldn't handle these run lines. (detail)
    by hans
  58. [clang][HeaderSuggestion] Handle the case of dotdot with an absolute path

    Summary:
    Include insertion in clangd was inserting absolute paths when the
    include directory was an absolute path with a double dot. This patch makes sure
    double dots are handled both with absolute and relative paths.

    Reviewers: sammccall

    Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60873 (detail)
    by kadircet
  59. Fix unquoted spaces in args in clang --verbose output

    The behaviour of not quoting spaces appears to have been introduced by
    mistake in r190620.

    Patch by Brad Moody!

    Differential revision: https://reviews.llvm.org/D60997 (detail)
    by hans
  60. Revert r359048: C++ DR2387: a variable template declared wthi

    The change breaks libc++ with the follwing error:

    In file included from valarray:4:
    .../include/c++/v1/valarray:1062:60: error: explicit instantiation declaration of 'valarray<_Tp>' with internal linkage
    _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::valarray(size_t))
                                                               ^
    .../include/c++/v1/valarray:1063:60: error: explicit instantiation declaration of '~valarray<_Tp>' with internal linkage
    _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::~valarray()) (detail)
    by ibiryukov
  61. [clang][HeaderSearch] Make sure there are no backslashes in suggestedPath

    Reviewers: sammccall

    Differential Revision: https://reviews.llvm.org/D60995 (detail)
    by kadircet
  62. [Builtins] Implement __builtin_is_constant_evaluated for use in C++2a

    Summary:
    This patch implements `__builtin_is_constant_evaluated` as specifier by [P0595R2](https://wg21.link/p0595r2). It is built on the back of Bill Wendling's work for `__builtin_constant_p()`.

    More tests to come, but early feedback is appreciated.

    I plan to implement warnings for common mis-usages like those belowe in a following patch:
    ```
    void foo(int x) {
      if constexpr (std::is_constant_evaluated())) { // condition is always `true`. Should use plain `if` instead.
       foo_constexpr(x);
      } else {
        foo_runtime(x);
      }
    }
    ```



    Reviewers: rsmith, MaskRay, bruno, void

    Reviewed By: rsmith

    Subscribers: dexonsmith, zoecarver, fdeazeve, kristina, cfe-commits

    Differential Revision: https://reviews.llvm.org/D55500 (detail)
    by ericwf
  63. Revert r350917 "[Sema] If CheckPlaceholderExpr rewrites the initializer
    of an auto"

    This commit changed the initializer expression passed into
    initialization (stripping off an enclosing pair of parentheses or
    braces) and subtly changing the meaning of programs, typically by
    inserting bogus calls to copy constructors.

    See the added testcase in test/SemaCXX/cxx1y-init-captures.cpp for an
    example of the breakage. (detail)
    by rsmith
  64. Fix interactions between __builtin_constant_p and constexpr to match
    current trunk GCC.

    GCC permits information from outside the operand of
    __builtin_constant_p (but in the same constant evaluation context) to be
    used within that operand; clang now does so too. A few other minor
    deviations from GCC's behavior showed up in my testing and are also
    fixed (matching GCC):
    * Clang now supports nullptr_t as the argument type for
       __builtin_constant_p
    * Clang now returns true from __builtin_constant_p if called with a
       null pointer
    * Clang now returns true from __builtin_constant_p if called with an
       integer cast to pointer type (detail)
    by rsmith
  65. Fix test after r359009 on platforms where %ms_abi_triple is 32-bit (detail)
    by nico
  66. Fixes in creduce-clang-crash.py for clang crash message parsing and reading the command from the repro script. (detail)
    by akhuang
  67. Add missing diagnostic for anonymous struct/union definitions that don't
    introduce any names. (detail)
    by rsmith
  68. Improve -Wuninitialized warning under ARC for block variables that are
    recursively captured.

    Under ARC, a block variable is zero-initialized when it is recursively
    captured by the block literal initializer.

    rdar://problem/11022762 (detail)
    by ahatanak
  69. C++ DR2387: a variable template declared wtih (or instantiated with) a
    const-qualified type is not implicitly given internal linkage. But a
    variable template declared 'static' is. (detail)
    by rsmith
  70. Move setTargetAttributes after setGVProperties in SetFunctionAttributes

    AMDGPU currently relies on global properties being set before
    setTargetProperties is called. Existing targets like MIPS which rely on
    setTargetProperties do not rely on the current behavior, so this patch
    moves the call later in SetFunctionAttributes.

    Differential Revision: https://reviews.llvm.org/D60967 (detail)
    by scott.linder
  71. [analyzer] Fix macro names in diagnostics within bigger macros.

    If macro "CHECK_X(x)" expands to something like "if (x != NULL) ...",
    the "Assuming..." note no longer says "Assuming 'x' is equal to CHECK_X".

    Differential Revision: https://reviews.llvm.org/D59121 (detail)
    by dergachev
  72. Re-apply r357823 "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."

    It now comes with a follow-up fix for the clients of this API
    in clangd and clang-tidy.

    Differential Revision: https://reviews.llvm.org/D59977 (detail)
    by dergachev
  73. Revert "[MS] Emit S_HEAPALLOCSITE debug info" because of ToTWin64(db)
    buildbot failure.

    This reverts commit d07d6d617713bececf57f3547434dd52f0f13f9e and
    c774f687b6880484a126ed3e3d737e74c926f0ae. (detail)
    by akhuang
  74. [clang-format] Fix bug in reflow of block comments containing CR/LF

    Fix PR36119

    Differential Revision: https://reviews.llvm.org/D60996 (detail)
    by owenpan
  75. [ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PM

    Summary:
    The opt level was not being passed down to the ThinLTO backend when
    invoked via clang (for distributed ThinLTO).

    This exposed an issue where the new PM was asserting if the Thin or
    regular LTO backend pipelines were invoked with -O0 (not a new issue,
    could be provoked by invoking in-process *LTO backends via linker using
    new PM and -O0). Fix this similar to the old PM where -O0 only does the
    necessary lowering of type metadata (WPD and LowerTypeTest passes) and
    then quits, rather than asserting.

    Reviewers: xur

    Subscribers: mehdi_amini, inglorion, eraman, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits, pcc

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D61022 (detail)
    by tejohnson
  76. [APSInt][OpenMP] Fix isNegative, etc. for unsigned types

    Without this patch, APSInt inherits APInt::isNegative, which merely
    checks the sign bit without regard to whether the type is actually
    signed.  isNonNegative and isStrictlyPositive call isNegative and so
    are also affected.

    This patch adjusts APSInt to override isNegative, isNonNegative, and
    isStrictlyPositive with implementations that consider whether the type
    is signed.

    A large set of Clang OpenMP tests are affected.  Without this patch,
    these tests assume that `true` is not a valid argument for clauses
    like `collapse`.  Indeed, `true` fails APInt::isStrictlyPositive but
    not APSInt::isStrictlyPositive.  This patch adjusts those tests to
    assume `true` should be accepted.

    This patch also adds tests revealing various other similar fixes due
    to APSInt::isNegative calls in Clang's ExprConstant.cpp and
    SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object
    size based on `alloc_size`, `<<` and `>>` shift count validation, and
    OpenMP array section validation.

    Reviewed By: lebedev.ri, ABataev, hfinkel

    Differential Revision: https://reviews.llvm.org/D59712 (detail)
    by jdenny
  77. MS ABI: Support mangling op<=> now that MSVC 2019 has a mangling (detail)
    by nico
  78. Fix "-Wimplicit-fallthrough" warning. NFCI. (detail)
    by rksimon
  79. [Analyzer] Second fix for last commit for IteratorChecker

    A variable was redeclared instead of assigned in an internal
    block, leaving the original uninitialized. This is fixed now. (detail)
    by baloghadamsoftware
  80. [analyzer][CrossTU] Extend CTU to VarDecls with initializer

    Summary:
    The existing CTU mechanism imports `FunctionDecl`s where the definition is available in another TU. This patch extends that to VarDecls, to bind more constants.

    - Add VarDecl importing functionality to CrossTranslationUnitContext
    - Import Decls while traversing them in AnalysisConsumer
    - Add VarDecls to CTU external mappings generator
    - Name changes from "external function map" to "external definition map"

    Reviewers: NoQ, dcoughlin, xazax.hun, george.karpenkov, martong

    Reviewed By: xazax.hun

    Subscribers: Charusso, baloghadamsoftware, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, george.karpenkov, mgorny, whisperity, szepet, rnkovacs, a.sidorin, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D46421 (detail)
    by r.stahl
  81. [Analyzer] Fix for previous commit

    A compilation warning was in my previous commit which broke the buildbot
    because it is using `-Werror` for compilation. This patch fixes this
    issue. (detail)
    by baloghadamsoftware
  82. [PowerPC] Fix test with -fno-discard-value-names after rC358949

    For the clang driver, -DLLVM_ENABLE_ASSERTIONS=off builds default to discard value names. (detail)
    by maskray
  83. [Analyzer] Instead of recording comparisons in interator checkers do an eager state split

    Currently iterator checkers record comparison of iterator positions
    and process them for keeping track the distance between them (e.g.
    whether a position is the same as the end position). However this
    makes some processing unnecessarily complex and it is not needed at
    all: we only need to keep track between the abstract symbols stored
    in these iterator positions. This patch changes this and opens the
    path to comparisons to the begin() and end() symbols between the
    container (e.g. size, emptiness) which are stored as symbols, not
    iterator positions. The functionality of the checker is unchanged.

    Differential Revision: https://reviews.llvm.org/D53701 (detail)
    by baloghadamsoftware
  84. [PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power

    Port mmintrin.h which include x86 MMX intrinsics implementation to PowerPC platform (using Altivec).

    To make the include process correct, PowerPC's toolchain class is overrided to insert new headers directory (named ppc_wrappers) into the path. Basic test cases for several intrinsic functions are added.

    The header is mainly developed by Steven Munroe, with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu.

    Reviewed By: Jinsong Ji

    Differential Revision: https://reviews.llvm.org/D59924 (detail)
    by chaofan
  85. [analyzer] Unbreak body farms in presence of multiple declarations.

    When growing a body on a body farm, it's essential to use the same redeclaration
    of the function that's going to be used during analysis. Otherwise our
    ParmVarDecls won't match the ones that are used to identify argument regions.

    This boils down to trusting the reasoning in AnalysisDeclContext. We shouldn't
    canonicalize the declaration before farming the body because it makes us not
    obey the sophisticated decision-making process of AnalysisDeclContext.

    Differential Revision: https://reviews.llvm.org/D60899 (detail)
    by dergachev
  86. [analyzer] PR41335: Fix crash when no-store event is in a body-farmed function.

    Stuffing invalid source locations (such as those in functions produced by
    body farms) into path diagnostics causes crashes.

    Fix a typo in a nearby function name.

    Differential Revision: https://reviews.llvm.org/D60808 (detail)
    by dergachev
  87. [analyzer] PR41269: Add a bit of C++ smart pointer modeling.

    Implement cplusplus.SmartPtrModeling, a new checker that doesn't
    emit any warnings but models methods of smart pointers more precisely.

    For now the only thing it does is make `(bool) P` return false when `P`
    is a freshly moved pointer. This addresses a false positive in the
    use-after-move-checker.

    Differential Revision: https://reviews.llvm.org/D60796 (detail)
    by dergachev
  88. [CMake] Replace the sanitizer support in runtimes build with multilib

    This is a more generic solution; while the sanitizer support can be used
    only for sanitizer instrumented builds, the multilib support can be used
    to build other variants such as noexcept which is what we would like to use
    in Fuchsia.

    The name CMake target name uses the target name, same as for the regular
    runtimes build and the name of the multilib, concatenated with '+'. The
    libraries are installed in a subdirectory named after the multilib.

    Differential Revision: https://reviews.llvm.org/D60926 (detail)
    by phosek
  89. [c++2a] Implement semantic restrictions for 'export' declarations. (detail)
    by rsmith
  90. [VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen

    Previously, it was only documented by `-cc1 -help`, so people weren't
    aware of it, as discussed in D60732.

    Reviewed By: Charusso, NoQ

    Differential Revision: https://reviews.llvm.org/D60845 (detail)
    by jdenny
  91. [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, `isClassMethod`, and `isInstanceMethod`

    Summary:
    isClassMessage is an equivalent to isInstanceMessage for ObjCMessageExpr, but matches message expressions to classes.

    isClassMethod and isInstanceMethod check whether a method declaration (or definition) is for a class method or instance method (respectively).

    Contributed by @mywman!

    Reviewers: benhamilton, klimek, mwyman

    Reviewed By: benhamilton, mwyman

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60920 (detail)
    by benhamilton
  92. [sema][objc] Minor refactor to OverrideSearch. NFCI.

    Summary:
    * Removed a member that was only used during construction.
    * Use range-based for iteration when accessing the result of the search.
    * Require an `ObjCMethodDecl` reference upon construction of an
    * Constify.

    Reviewers: rjmccall

    Reviewed By: rjmccall

    Subscribers: llvm-commits

    Differential Revision: https://reviews.llvm.org/D60850 (detail)
    by mattd
  93. [Sema] ADL: Associated namespaces for class types and enumeration types (CWG 1691)

    CWG 1691 changed the definition of the namespaces associated with a class
    type or enumeration type.

    For a class type, the associated namespaces are the innermost enclosing
    namespaces of the associated classes. For an enumeration type, the associated
    namespace is the innermost enclosing namespace of its declaration.

    This also fixes CWG 1690 and CWG 1692.

    Differential Revision: https://reviews.llvm.org/D60573

    Reviewed By: rjmccall, rsmith (detail)
    by brunoricci
  94. [Sema][NFC] Add more tests for the behavior of argument-dependent name lookup

    The goal here is to exercise each rule in [basic.lookup.argdep] at least once.
    These new tests expose what I believe are 2 issues:

    1. CWG 1691 needs to be implemented (p2:  [...] Its associated namespaces are
       the innermost enclosing namespaces of its associated classes [...]) The
       corresponding tests are adl_class_type::X2 and adl_class_type::X5.

    2. The end of paragraph 2 ([...] Additionally, if the aforementioned set of
       overloaded functions is named with a template-id, its associated classes
       and namespaces also include those of its type template-arguments and its
       template template-arguments.) is not implemented. Closely related, the
       restriction on non-dependent parameter types in this same paragraph needs
       to be removed. The corresponding tests are in adl_overload_set (both issues
       are from CWG 997).

    Differential Revision: https://reviews.llvm.org/D60570

    Reviewed By: riccibruno, Quuxplusone (detail)
    by brunoricci
  95. [analyzer][www] Moving MoveChecker out of alpha is no longer an open project. (detail)
    by szelethus
  96. Attempt to fix LLVM_ENABLE_THREADS=OFF build after r358665 (detail)
    by nico
  97. [Sema][MSVC] Fix bogus microsoft-pure-definition warning on member function of class template

    Clang emits a warning when using a pure specifier =0 in a function definition
    at class scope (a MS-specific construct), when using -fms-extensions.
    However, to detect this, it was using FD->isCanonicalDecl() on function
    declaration, which was also detecting out-of-class definition of member
    functions of class templates. Fix this by using !FD->isOutOfLine() instead.

    Fixes PR21334.

    Differential Revision: https://reviews.llvm.org/D29707

    Reviewed By: riccibruno

    Reviewers: rnk, riccibruno

    Patch By: Rudy Pons (detail)
    by brunoricci
  98. [analyzer] Move UninitializedObjectChecker out of alpha

    Moved UninitializedObjectChecker from the 'alpha.cplusplus' to the
    'optin.cplusplus' package.

    Differential Revision: https://reviews.llvm.org/D58573 (detail)
    by szelethus
  99. Modules: Adopt template parameters for variable templates to set their decl context correctly

    Exposed by a related bug about visibility of default arguments of nested
    templates - without the correct decl context, default template
    parameters of variable templates nested in classes would have incorrect
    visibility computed. (detail)
    by dblaikie
  100. Modules: Search for a visible definition of the decl context when computing visibility of a default template parameter

    The code is/was already correct for the case where a parameter is a
    parameter of its enclosing lexical DeclContext (functions and classes).
    But for other templates (alias and variable templates) they don't create
    their own scope to be members of - in those cases, they parameter should
    be considered visible if any definition of the lexical decl context is
    visible.

    [this should cleanup the failure on the libstdc++ modules buildbot]
    [this doesn't actually fix the variable template case for a
    secondary/compounding reason (its lexical decl context is incorrectly
    considered to be the translation unit)]

    Test covers all 4 kinds of templates with default args, including a
    regression test for the still broken variable template case.

    Reviewers: rsmith

    Differential Revision: https://reviews.llvm.org/D60892 (detail)
    by dblaikie
  101. [MS] Emit S_HEAPALLOCSITE debug info

    Summary:
    This emits labels around heapallocsite calls and S_HEAPALLOCSITE debug
    info in codeview. Currently only changes FastISel, so emitting labels still
    needs to be implemented in SelectionDAG.

    Reviewers: hans, rnk

    Subscribers: aprantl, hiraditya, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D60800 (detail)
    by akhuang
  102. Reapply "[analyzer] Introduce a simplified API for adding custom path notes."

    This reapplies commit r357323, fixing memory leak found by LSan.

    Differential Revision: https://reviews.llvm.org/D58367 (detail)
    by dergachev
  103. [MSVC] If unable to find link.exe from a MSVC installation, look for link.exe next to cl.exe

    Previously, if the MSVC installation isn't detected properly, clang
    will later just fail to execute link.exe.

    This improves using clang in msvc mode on linux, where one intentionally
    might not want to point clang to the MSVC installation itself (which
    isn't executable as such), but where a link.exe named wine wrapper is
    available in the path next to a cl.exe named wine wrapper.

    Differential Revision: https://reviews.llvm.org/D60094 (detail)
    by mstorsjo
  104. Enable frame pointer elimination for OpenBSD on powerpc. (detail)
    by brad
  105. [OPENMP][NVPTX] target [teams distribute] simd maybe run without
    runtime.

    target [teams distribute] simd costructs do not require full runtime for
    the correct execution, we can run them without full runtime. (detail)
    by abataev
  106. Update to use PipelineTuningOptions. Corresponds to llvm change: D59723. (detail)
    by asbirlea
  107. Debian: Add two missing version code in sid (detail)
    by sylvestre
  108. Add support of the future Debian (Debian 11 - Bullseye)
    https://wiki.debian.org/DebianBullseye (detail)
    by sylvestre
  109. Add support of the next Ubuntu (Ubuntu 19.10 - Eoan EANIMAL) (detail)
    by sylvestre
  110. [LTO] Add plumbing to save stats during LTO on Darwin.

    Gold and ld on Linux already support saving stats, but the
    infrastructure is missing on Darwin. Unfortunately it seems like the
    configuration from lib/LTO/LTO.cpp is not used.

    This patch adds a new LTOStatsFile option and adds plumbing in Clang to
    use it on Darwin, similar to the way remarks are handled.

    Currnetly the handling of LTO flags seems quite spread out, with a bunch
    of duplication. But I am not sure if there is an easy way to improve
    that?

    Reviewers: anemet, tejohnson, thegameg, steven_wu

    Reviewed By: steven_wu

    Differential Revision: https://reviews.llvm.org/D60516 (detail)
    by fhahn
  111. [analyzer][NFC] Reimplement checker options

    TL;DR:

    * Add checker and package options to the TableGen files
    * Added a new class called CmdLineOption, and both Package and Checker recieved
       a list<CmdLineOption> field.
    * Added every existing checker and package option to Checkers.td.
    * The CheckerRegistry class
      * Received some comments to most of it's inline classes
      * Received the CmdLineOption and PackageInfo inline classes, a list of
         CmdLineOption was added to CheckerInfo and PackageInfo
      * Added addCheckerOption and addPackageOption
      * Added a new field called Packages, used in addPackageOptions, filled up in
         addPackage

    Detailed description:

    In the last couple months, a lot of effort was put into tightening the
    analyzer's command line interface. The main issue is that it's spectacularly
    easy to mess up a lenghty enough invocation of the analyzer, and the user was
    given no warnings or errors at all in that case.

    We can divide the effort of resolving this into several chapters:

    * Non-checker analyzer configurations:
        Gather every analyzer configuration into a dedicated file. Emit errors for
        non-existent configurations or incorrect values. Be able to list these
        configurations. Tighten AnalyzerOptions interface to disallow making such
        a mistake in the future.

    * Fix the "Checker Naming Bug" by reimplementing checker dependencies:
        When cplusplus.InnerPointer was enabled, it implicitly registered
        unix.Malloc, which implicitly registered some sort of a modeling checker
        from the CStringChecker family. This resulted in all of these checker
        objects recieving the name "cplusplus.InnerPointer", making AnalyzerOptions
        asking for the wrong checker options from the command line:
          cplusplus.InnerPointer:Optimisic
        istead of
          unix.Malloc:Optimistic.
        This was resolved by making CheckerRegistry responsible for checker
        dependency handling, instead of checkers themselves.

    * Checker options: (this patch included!)
        Same as the first item, but for checkers.

    (+ minor fixes here and there, and everything else that is yet to come)

    There were several issues regarding checker options, that non-checker
    configurations didn't suffer from: checker plugins are loaded runtime, and they
    could add new checkers and new options, meaning that unlike for non-checker
    configurations, we can't collect every checker option purely by generating code.
    Also, as seen from the "Checker Naming Bug" issue raised above, they are very
    rarely used in practice, and all sorts of skeletons fell out of the closet while
    working on this project.

    They were extremely problematic for users as well, purely because of how long
    they were. Consider the following monster of a checker option:

      alpha.cplusplus.UninitializedObject:CheckPointeeInitialization=false

    While we were able to verify whether the checker itself (the part before the
    colon) existed, any errors past that point were unreported, easily resulting
    in 7+ hours of analyses going to waste.

    This patch, similarly to how dependencies were reimplemented, uses TableGen to
    register checker options into Checkers.td, so that Checkers.inc now contains
    entries for both checker and package options. Using the preprocessor,
    Checkers.inc is converted into code in CheckerRegistry, adding every builtin
    (checkers and packages that have an entry in the Checkers.td file) checker and
    package option to the registry. The new addPackageOption and addCheckerOption
    functions expose the same functionality to statically-linked non-builtin and
    plugin checkers and packages as well.

    Emitting errors for incorrect user input, being able to list these options, and
    some other functionalies will land in later patches.

    Differential Revision: https://reviews.llvm.org/D57855 (detail)
    by szelethus
  112. [analyzer] Fix an assertion failure if plugins added dependencies

    Ideally, there is no reason behind not being able to depend on checkers that
    come from a different plugin (or on builtin checkers) -- however, this is only
    possible if all checkers are added to the registry before resolving checker
    dependencies. Since I used a binary search in my addDependency method, this also
    resulted in an assertion failure (due to CheckerRegistry::Checkers not being
    sorted), since the function used by plugins to register their checkers
    (clang_registerCheckers) calls addDependency.

    This patch resolves this issue by only noting which dependencies have to
    established when addDependency is called, and resolves them at a later stage
    when no more checkers are added to the registry, by which point
    CheckerRegistry::Checkers is already sorted.

    Differential Revision: https://reviews.llvm.org/D59461 (detail)
    by szelethus
  113. [LibTooling] Fix -Wsign-compare after r358697 (detail)
    by bjope
  114. Fix overly-long line after r358731. (detail)
    by rsmith
  115. Fix typo in function name [NFC] (detail)
    by tamur
  116. [analyzer] Fix -Wunused-local-typedef after rC358695 (detail)
    by maskray
  117. Add header guard to Reusables.h [NFC] (detail)
    by tamur
  118. [analyzer] Make default bindings to variables actually work.

    Default RegionStore bindings represent values that can be obtained by loading
    from anywhere within the region, not just the specific offset within the region
    that they are said to be bound to. For example, default-binding a character \0
    to an int (eg., via memset()) means that the whole int is 0, not just
    that its lower byte is 0.

    Even though memset and bzero were modeled this way, it didn't work correctly
    when applied to simple variables. Eg., in

      int x;
      memset(x, 0, sizeof(x));

    we did produce a default binding, but were unable to read it later, and 'x'
    was perceived as an uninitialized variable even after memset.

    At the same time, if we replace 'x' with a variable of a structure or array
    type, accessing fields or elements of such variable was working correctly,
    which was enough for most cases. So this was only a problem for variables of
    simple integer/enumeration/floating-point/pointer types.

    Fix loading default bindings from RegionStore for regions of simple variables.

    Add a unit test to document the API contract as well.

    Differential Revision: https://reviews.llvm.org/D60742 (detail)
    by dergachev
  119. [analyzer] NFC: Make reusable unittest mocks reusable.

    Put them in a header for other Analyzer unittests to include.

    Differential Revision: https://reviews.llvm.org/D60739 (detail)
    by dergachev
  120. [analyzer] NFC: MoveChecker: Refactor tests to use -verify=prefix.

    This -verify=prefix feature is quite underrated.

    Differential Revision: https://reviews.llvm.org/D60732 (detail)
    by dergachev
  121. [c++2a] Add semantic support for private module fragments. (detail)
    by rsmith
  122. [OpenMP][NFC] Fix requires target test.

    Summary:
    Fix requires target test.


    Reviewers: ABataev

    Subscribers: guansong, jdoerfert, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60886 (detail)
    by gbercea
  123. [clang-format] Fix incorrect formatting of keyword macro definition

    See PR39719

    Differential Revision: https://reviews.llvm.org/D60853 (detail)
    by owenpan
  124. [OpenMP] Add checks for requires and target directives.

    Summary: The requires directive containing target related clauses must appear before any target region in the compilation unit.

    Reviewers: ABataev, AlexEichenberger, caomhin

    Reviewed By: ABataev

    Subscribers: guansong, jfb, jdoerfert, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60875 (detail)
    by gbercea
  125. [LibTooling] Fix build breakage from commit 7b7ce6683ee.

    On configurations with -Werror,-Wmissing-field-initializers, the commit does not compile. This commit fixes the offending line.

    Original Differential Revision: https://reviews.llvm.org/D60408 (detail)
    by ymandel
  126. [LibTooling] Extend Transformer to support multiple simultaneous changes.

    Summary: This revision allows users to specify independent changes to multiple (related) sections of the input.  Previously, only a single section of input could be selected for replacement.

    Reviewers: ilya-biryukov

    Reviewed By: ilya-biryukov

    Subscribers: jfb, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60408 (detail)
    by ymandel
  127. [CodeComplete] Remove obsolete isOutputBinary().

    Summary:
    It's never set to true. Its only effect would be to set stdout to binary mode.
    Hopefully we have better ways of doing this by now :-)

    Reviewers: hokein

    Subscribers: jkorous, arphaman, kadircet, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60871 (detail)
    by sammccall
  128. [analyzer][NFC] Prefer binary searches in CheckerRegistry

    Differential Revision: https://reviews.llvm.org/D59459 (detail)
    by szelethus
  129. [analyzer][NFC] Clang-format CheckerRegistry

    Differential Revision: https://reviews.llvm.org/D59458 (detail)
    by szelethus
  130. [LibTooling] Add Stencil library for format-string style codegen.

    Summary:
    This file defines the *Stencil* abstraction: a code-generating object, parameterized by named references to (bound) AST nodes.  Given a match result, a stencil can be evaluated to a string of source code.

    A stencil is similar in spirit to a format string: it is composed of a series of raw text strings, references to nodes (the parameters) and helper code-generation operations.

    See thread on cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling" for background.

    Reviewers: sbenza

    Reviewed By: sbenza

    Subscribers: ilya-biryukov, mgorny, jfb, jdoerfert, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D59371 (detail)
    by ymandel
  131. [clang-format] Fix indent of trailing raw string param after newline

    Summary:
    Currently clang-format uses ContinuationIndent to indent the contents of a raw
    string literal that is the last parameter of the function call. This is to
    achieve formatting similar to trailing:
    ```
    f(1, 2, R"pb(
        x: y)pb");
    ```
    However this had the unfortunate consequence of producing format like this:
    ```
    fffffff(1, 2,
            R"pb(
        a: b
            )pb");
    ```

    This patch makes clang-format consider indenting a trailing raw string param
    after a newline based off the start of the format delimiter, producing:
    ```
    fffffff(1, 2,
            R"pb(
              a: b
            )pb");
    ```

    Reviewers: djasper

    Reviewed By: djasper

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60558 (detail)
    by krasimir
  132. [Sema][NFC] Mark DR1563 as done (List-initialization and overloaded function disambiguation)

    It has been supported since at least clang 3.1 so just mark it as done. (detail)
    by brunoricci
  133. [Sema][NFC] Mark DR705 (Suppressing argument-dependent lookup via parentheses) as done

    It was supported since at least clang 3 so just mark it as done. (detail)
    by brunoricci
  134. [analyzer][NFC] Use capital variable names, move methods out-of-line, rename some in CheckerRegistry

    There are barely any lines I haven't changed in these files, so I think I could
    might as well leave it in an LLVM coding style conforming state. I also renamed
    2 functions and moved addDependency out of line to ease on followup patches.

    Differential Revision: https://reviews.llvm.org/D59457 (detail)
    by szelethus
  135. [Serialization] Stable serialization order for OpenCLTypeExtMap and OpenCLDeclExtMap

    Sort the elements of Sema::OpenCLTypeExtMap and Sema::OpenCLDeclExtMap
    by TypeIDs and DeclIDs to guarantee a stable serialization order.

    Differential Revision: https://reviews.llvm.org/D60835

    Reviewed By: Anastasia

    Reviewers: Anastasia, lebedev.ri (detail)
    by brunoricci
  136. [clang-tidy] Address post-commit comments

    Summary:
    Also add a test to verify clang-tidy only apply the first alternative
    fix.

    Reviewers: alexfh

    Subscribers: xazax.hun, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60857 (detail)
    by hokein
  137. [clang][CIndex] Use llvm::set_thread_priority

    Reviewers: jkorous, gribozavr

    Subscribers: dexonsmith, arphaman, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60867 (detail)
    by kadircet
  138. [MSVC] Use the correct casing of HostX64/HostX86

    If accessing the MSVC installation root directly on a case sensitive
    filesystem, these details matter.

    Differential Revision: https://reviews.llvm.org/D60627 (detail)
    by mstorsjo
  139. [Sema] Delete unused parameters/variables (detail)
    by maskray
  140. [CUDA][Windows] Restrict long double device functions declarations to Windows

    As agreed in D60220, make long double declarations unobservable on non-windows platforms.

    [Testing]
    {Windows 10, Ubuntu 16.04.5}/{Visual C++ 2017 15.9.11 & 2019 16.0.1, gcc+ 5.4.0}/CUDA {8.0, 9.0, 9.1, 9.2, 10.0, 10.1}

    Reviewed by: Artem Belevich

    Differential Revision: https://reviews.llvm.org/D60818 (detail)
    by emankov
  141. Split out modules-specific declaration handling from SemaDecl.cpp into a
    new SemaModule.cpp. (detail)
    by rsmith
  142. Add '#pragma clang __debug module_map module.name' to dump the module
    map being used for the module 'module.name'. (detail)
    by rsmith
  143. [c++2a] Improve diagnostic for use of declaration from another TU's
    global module fragment.

    We know that the declaration in question should have been introduced by
    a '#include', so try to figure out which one and suggest it. Don't
    suggest importing the global module fragment itself! (detail)
    by rsmith
  144. [clang-format] Remove unused Environment constructor. (detail)
    by alexfh
  145. Move the implementation of getInnermostBlockDecl to the .cpp file to fix
    failing bots. (detail)
    by ahatanak
  146. Fix test on PS4 which defaults to gnu99 which does not emit the expected warnings. (detail)
    by dyung
  147. [Sema][ObjC] Don't warn about an implicitly retained self if the
    retaining block and all of the enclosing blocks are non-escaping.

    If the block implicitly retaining self doesn't escape, there is no risk
    of creating retain cycles, so clang shouldn't diagnose it and force
    users to add self-> to silence the diagnostic.

    Also, fix a bug where clang was failing to diagnose an implicitly
    retained self inside a c++ lambda nested inside a block.

    rdar://problem/25059955

    Differential Revision: https://reviews.llvm.org/D60736 (detail)
    by ahatanak
  148. [analyzer] PR41185: Fix regression where __builtin_* functions weren't recognized

    For the following code snippet:

    void builtin_function_call_crash_fixes(char *c) {
      __builtin_strncpy(c, "", 6);
      __builtin_memset(c, '\0', (0));
      __builtin_memcpy(c, c, 0);
    }
    security.insecureAPI.DeprecatedOrUnsafeBufferHandling caused a regression, as it
    didn't recognize functions starting with __builtin_. Fixed exactly that.

    I wanted to modify an existing test file, but the two I found didn't seem like
    perfect candidates. While I was there, I prettified their RUN: lines.

    Differential Revision: https://reviews.llvm.org/D59812 (detail)
    by szelethus
  149. [OPENMP][NVPTX]Run combined constructs with if clause in SPMD mode.

    All target-parallel-based constructs can be run in SPMD mode from now
    on. Even if num_threads clauses or if clauses are used, such constructs
    can be executed in SPMD mode. (detail)
    by abataev
  150. Remove --show-includes flag in crash reduce script (detail)
    by akhuang
  151. Explicitly say we don't define new/delete in libc++ during Apple stage1 bootstrap

    This is not necessary in stage2 because we don't even build libc++.dylib
    there. (detail)
    by ldionne
  152. [clang-tidy] Add fix descriptions to clang-tidy checks.

    Summary:
    Motivation/Context: in the code review system integrating with clang-tidy,
    clang-tidy doesn't provide a human-readable description of the fix. Usually
    developers have to preview a code diff (before vs after apply the fix) to
    understand what the fix does before applying a fix.

    This patch proposes that each clang-tidy check provides a short and
    actional fix description that can be shown in the UI, so that users can know
    what the fix does without previewing diff.

    This patch extends clang-tidy framework to support fix descriptions (will add implementations for
    existing checks in the future). Fix descriptions and fixes are emitted via diagnostic::Note (rather than
    attaching the main warning diagnostic).

    Before this patch:

    ```
    void MyCheck::check(...) {
       ...
       diag(loc, "my check warning") <<  FixtItHint::CreateReplacement(...);
    }
    ```

    After:

    ```
    void MyCheck::check(...) {
       ...
       diag(loc, "my check warning"); // Emit a check warning
       diag(loc, "fix description", DiagnosticIDs::Note) << FixtItHint::CreateReplacement(...); // Emit a diagnostic note and a fix
    }
    ```

    Reviewers: sammccall, alexfh

    Reviewed By: alexfh

    Subscribers: MyDeveloperDay, Eugene.Zelenko, aaron.ballman, JonasToth, xazax.hun, jdoerfert, cfe-commits

    Tags: #clang-tools-extra, #clang

    Differential Revision: https://reviews.llvm.org/D59932 (detail)
    by hokein
  153. clang-cl: Parse /openmp:experimental

    It was added to the MS docs recently here:
    https://github.com/MicrosoftDocs/cpp-docs/commit/3951085ab722fbb488ca40864f4a0553f7b71855 (detail)
    by hans
  154. [libclang] Expose ext_vector_type

    Differential Revision: https://reviews.llvm.org/D60775 (detail)
    by svenvh
  155. [Driver] Simplify -g level computation and its interaction with -gsplit-dwarf

    Summary:
    When -gsplit-dwarf is used together with other -g options, in most cases
    the computed debug info level is decided by the last -g option, with one
    special case (see below). This patch drops that special case and thus
    makes it easy to reason about:

    // If a lower debug level -g comes after -gsplit-dwarf, in some cases
    // -gsplit-dwarf is cancelled.
    -gsplit-dwarf -g0 => 0
    -gsplit-dwarf -gline-directives-only => DebugDirectivesOnly
    -gsplit-dwarf -gmlt -fsplit-dwarf-inlining => 1
    -gsplit-dwarf -gmlt -fno-split-dwarf-inlining => 1 + split

    // If -gsplit-dwarf comes after -g options, with this patch, the net
    // effect is 2 + split for all combinations
    -g0 -gsplit-dwarf => 2 + split
    -gline-directives-only -gsplit-dwarf => 2 + split
    -gmlt -gsplit-dwarf -fsplit-dwarf-inlining => 2 + split
    -gmlt -gsplit-dwarf -fno-split-dwarf-inlining => 1 + split (before) 2 + split (after)

    The last case has been changed. In general, if the user intends to lower
    debug info level, place that -g option after -gsplit-dwarf.

    Some context:

    In gcc, the last of -gsplit-dwarf -g0 -g1 -g2 -g3 -ggdb[0-3] -gdwarf-*
    ... decides the debug info level (-gsplit-dwarf -gdwarf-* have level 2).
    It is a bit unfortunate that -gsplit-dwarf -gdwarf-* ... participate in
    the level computation but that is the status quo.

    Reviewers: dblaikie, echristo, probinson

    Reviewed By: dblaikie, probinson

    Subscribers: probinson, aprantl, jdoerfert, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D59923 (detail)
    by maskray
  156. [NFC] Remove unused function (Sema::pushExternalDeclIntoScope) (detail)
    by leonardchan
  157. Modify test to use -S instead of -c so that it works when an external assembler is used that is not present. (detail)
    by dyung
  158. [FileSystemStatCache] Update test for new FileSystemStatCache API

    Summary: Update this test to return std::error_code instead of LookupResult.

    Reviewers: arphaman

    Subscribers: dexonsmith, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60786 (detail)
    by harlanhaskins
  159. [FileSystemStatCache] Return std::error_code from stat cache methods

    Summary:
    Previously, we would return true/false signifying if the cache/lookup
    succeeded or failed. Instead, provide clients with the underlying error
    that was thrown while attempting to look up in the cache.

    Since clang::FileManager doesn't make use of this information, it discards the
    error that's received and casts away to bool.

    This change is NFC.

    Reviewers: benlangmuir, arphaman

    Subscribers: dexonsmith, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60735 (detail)
    by harlanhaskins
  160. [Test] Remove obsolete test.

    The FIXME of this test case has been addressed in r335084/r338800. Its
    execution still does not succeed because of multiple syntax errors.

    First, the "clang" namespace is missing on each of the 4 pragmas.
    Second, the pragma for defining the vector width is "vectorize_width(4)"
    instead of "vectorize(4)". Third, the pragma for defining the interleave
    factor is "interleave_count(8)" instead of "interleave(8)".

    The file was already using the wrong syntax when added in
    r210925 2014-06-13. The file ast-print-pragmas.cpp already checks for
    the correct pragma order, making this test redundant even if fixed.

    Differential Revision: https://reviews.llvm.org/D60749 (detail)
    by meinersbur
  161. [OPENMP][NVPTX]Run combined constructs with if clause in SPMD mode.

    Combined constructs with parallel and if clauses without modifiers may
    be executed in SPMD mode since if the condition is true for the target
    region, it is also true for parallel region and the threads must be run
    in parallel. (detail)
    by abataev
  162. [OPENMP]Require aarch arch for the tests, NFC. (detail)
    by abataev
  163. [AArch64] Implement Vector Funtion ABI name mangling.

    Summary:
    The name mangling scheme is defined in section 3.5 of the "Vector function application binary interface specification for AArch64" [1].

    [1] https://developer.arm.com/products/software-development-tools/hpc/arm-compiler-for-hpc/vector-function-abi

    Reviewers: rengolin, ABataev

    Reviewed By: ABataev

    Subscribers: sdesmalen, javed.absar, kristof.beyls, jdoerfert, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60583 (detail)
    by abataev
  164. Re-commit r357452: SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)

    The original commit caused false positives from AddressSanitizer's
    use-after-scope checks, which have now been fixed in r358478.

    > The code was previously checking that candidates for sinking had exactly
    > one use or were a store instruction (which can't have uses). This meant
    > we could sink call instructions only if they had a use.
    >
    > That limitation seemed a bit arbitrary, so this patch changes it to
    > "instruction has zero or one use" which seems more natural and removes
    > the need to special-case stores.
    >
    > Differential revision: https://reviews.llvm.org/D59936 (detail)
    by hans
  165. Tweak test to pass when using a non-integrated assembler. (detail)
    by rsmith
  166. PR41192: fix cases where "missing ';' after class" error would
    incorrectly fire. (detail)
    by rsmith
  167. DebugInfo: Default to standalone debug when tuning for LLDB

    LLDB can't currently handle Clang's default (limit/no-standalone) DWARF,
    so platforms that default to LLDB (Darwin) or anyone else manually
    requesting LLDB tuning, should also get standalone DWARF.

    That doesn't mean a user can't explicitly enable (because they have
    other reasons to prefer standalone DWARF (such as that they're only
    building half their application with debug info enabled, and half
    without - or because they're tuning for GDB, but want to be able to use
    it under LLDB too (this is the default on FreeBSD))) or disable (testing
    LLDB fixes/improvements that handle no-standalone mode, building C code,
    perhaps, which wouldn't have the LLDB<>no-standalone conflict, etc) the
    feature regardless of the tuning. (detail)
    by dblaikie
  168. Simplify diagnosis of misplaced attributes in module-declarations.

    No functional change intended. (detail)
    by rsmith
  169. Time profiler: small fixes and optimizations

    Summary: Fixes from Roman's review here: https://reviews.llvm.org/D58675#1465336

    Reviewers: lebedev.ri

    Subscribers: hiraditya, mgrang, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D60663 (detail)
    by anton-afanasyev
  170. [OPENMP][NVPTX]Run parallel regions with num_threads clauses in SPMD
    mode.

    After the previous patch with the more correct handling of the number of
    threads in parallel regions, the parallel regions with num_threads
    clauses can be executed in SPMD mode. (detail)
    by abataev
  171. [clang-format] Fix -Wconversion-null warning in GCC

    GCC -Wconversion-null warning appeared after 9a63380260860b657b72f07c4f0e61e382ab934a.
    There was a similar problem already in the past:
    http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20131230/096230.html

    Patch committed on behalf of @dendibakh

    Differential Revision: https://reviews.llvm.org/D60726 (detail)
    by reuk
  172. Revert "[clang] Aligned allocation is actually supported in macosx 10.13"

    This reverts r358409, which I think broke the bots in compiler-rt.
    Since I'm having trouble reproducing the failure, I'm reverting this
    until I can investigate locally. (detail)
    by ldionne
  173. [X86] Improve avx512-kconstraints-att_inline_asm.c to not be easily defeated by deadcode elimination. Improve CHECK lines to check IR types used. NFC

    I plan to use this as the basis for backend IR test cases. We currently crash hard for using 32 or 64 bit mask registers without avx512bw. (detail)
    by ctopper
  174. [CommandLineParser] Add DefaultOption flag

    Summary: Add DefaultOption flag to CommandLineParser which provides a
    default option or alias, but allows users to override it for some
    other purpose as needed.

    Also, add `-h` as a default alias to `-help`, which can be seamlessly
    overridden by applications like llvm-objdump and llvm-readobj which
    use `-h` as an alias for other options.

    (relanding after revert, r358414)
    Added DefaultOptions.clear() to reset().

    Reviewers: alexfh, klimek

    Reviewed By: klimek

    Subscribers: kristina, MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D59746 (detail)
    by dhinton
  175. [X86] Restore the pavg intrinsics.

    The pattern we replaced these with may be too hard to match as demonstrated by
    PR41496 and PR41316.

    This patch restores the intrinsics and then we can start focusing
    on the optimizing the intrinsics.

    I've mostly reverted the original patch that removed them. Though I modified
    the avx512 intrinsics to not have masking built in.

    Differential Revision: https://reviews.llvm.org/D60674 (detail)
    by ctopper
  176. Revert r358337: "[CommandLineParser] Add DefaultOption flag"

    The change causes test failures under asan. Reverting to unbreak our
    integrate. (detail)
    by ibiryukov
  177. [clang] Aligned allocation is actually supported in macosx 10.13

    Summary:
    In r350649, I changed aligned allocation from being available starting
    in macosx10.13 to macosx10.14. However, aligned allocation is indeed
    available starting with macosx10.13, my investigation had been based
    on the wrong libc++abi dylib.

    This means that Clang before the fix will be more stringent when it
    comes to aligned allocation -- it will not allow it when back-deploying
    to macosx 10.13, when it would actually be safe to do so.

    Note that a companion change will be coming to fix the libc++ tests.

    Reviewers: ahatanak

    Subscribers: jkorous, dexonsmith, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60626 (detail)
    by ldionne
  178. clang-format vs plugin: Visual Studio 2019 support (detail)
    by hans
  179. [MinGW] Remove some supefluous calls to MakeArgString. NFC. (detail)
    by mstorsjo
  180. [Lookup] Invisible decls should not be ambiguous when renaming.

    Summary:
    For example, a renamed type in a header file can conflict with declaration in
    a random file that includes the header, but we should not consider the decl ambiguous if
    it's not visible at the rename location. This improves consistency of generated replacements
    when header file is included in different TUs.

    Reviewers: hokein

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60257 (detail)
    by ioeric
  181. [clang-format] [PR41170] Break after return type ignored with certain comments positions

    Summary:
    Addresses https://bugs.llvm.org/show_bug.cgi?id=41170

    The AlwaysBreakAfterReturn type setting can go wrong if the line ends with a comment
    ```
    void foo() /* comment */
    ```
    or

    ```
    void foo() // comment
    ```

    It will incorrectly see such functions as Declarations and not Definitions

    The following code addresses this by looking for function which end with `; <comment>` rather than just `;` or `<comment>`

    Reviewers: klimek, djasper, reuk, russellmcc, owenpan, sammccall
    Reviewed By: owenpan
    Subscribers: lebedev.ri, cfe-commits, sammccall
    Tags: #clang
    Differential Revision: https://reviews.llvm.org/D60363 (detail)
    by paulhoad
Revision: 358206
Changes
  1. [clangd][xpc] Fix XPC unittests

    Fix build after recent changes in clangd tests & add xpc unittests to
    check-clangd target.

    Differential Revision: https://reviews.llvm.org/D61271 (detail)
    by jkorous
  2. [clangd] Fix serialization logic for Origin and Flags. (detail)
    by kadircet
  3. [clangd] Add separate unit tests for CanonicalIncludes. NFC (detail)
    by sammccall
  4. [clangd] Fix unittests CMake rules (detail)
    by sammccall
  5. [clangd] Fix windows buildbot, remove stray file after r359424. NFC (detail)
    by sammccall
  6. [clangd] Surface diagnostics from headers inside main file

    Reviewers: ioeric, ilya-biryukov

    Subscribers: MaskRay, jkorous, arphaman, jdoerfert, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D59302 (detail)
    by kadircet
  7. [clangd] Delete config.clangd_xpc_support from test/ to unbreak check-llvm-tools

    D61187 didn't delete config.clangd_xpc_support from test/
    CLANGD_BUILD_XPC is defined in clangd/CMakeLists.txt and not available in test/lit.site.cfg.py.in (detail)
    by maskray
  8. [clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.

    Summary:
    Motivation:
    - this layout is a pain to work with
    - without a common root, it's painful to express things like "disable clangd" (D61122)
    - CMake/lit configs are a maintenance hazard, and the more the one-off hacks
       for various tools are entangled, the more we see apathy and non-ownership.

    This attempts to use the bare-minimum configuration needed (while still
    supporting the difficult cases: windows, standalone clang build, dynamic libs).
    In particular the lit.cfg.py and lit.site.cfg.py.in are merged into lit.cfg.in.
    The logic in these files is now minimal.

    (Much of clang-tools-extra's lit configs can probably be cleaned up by reusing
    lit.llvm.llvm_config.use_clang(), and every llvm project does its own version of
    LDPATH mangling. I haven't attempted to fix any of those).

    Docs are still in clang-tools-extra/docs, I don't have any plans to touch those.

    Reviewers: gribozavr

    Subscribers: mgorny, javed.absar, MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits, ilya-biryukov, thakis

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D61187 (detail)
    by sammccall
  9. Fix typo in documentation. (detail)
    by nicholas
  10. [clangd] Remove unused ClangdServer::dynamicIndex(). NFC (detail)
    by ibiryukov
  11. filecheck etc are not clangd-specific deps. NFC (detail)
    by sammccall
  12. [clangd] Query index in code completion no-compile mode.

    Summary: We scrape the enclosing scopes from the source file, and use them in the query.

    Reviewers: kadircet

    Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D61077 (detail)
    by sammccall
  13. [clangd] Optimize "don't include me" check.

    Summary:
    llvm::Regex is really slow, and regex evaluation during preamble indexing was
    showing up as 25% on a profile of clangd in a codebase with large preambles.

    Reviewers: ilya-biryukov

    Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D61120 (detail)
    by sammccall
  14. [clangd] Use JSON streaming API for Trace rather than pasting strings. NFC (detail)
    by sammccall
  15. [Testing] Move clangd::Annotations to llvm testing support

    Summary:
    Annotations allow writing nice-looking unit test code when one needs
    access to locations from the source code, e.g. running code completion
    at particular offsets in a file. See comments in Annotations.cpp for
    more details on the API.

    Also got rid of a duplicate annotations parsing code in clang's code
    complete tests.

    Reviewers: gribozavr, sammccall

    Reviewed By: gribozavr

    Subscribers: mgorny, hiraditya, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D59814 (detail)
    by ibiryukov
  16. [clang-tidy] Add new checker: llvm-prefer-isa-or-dyn-cast-in-conditionals

    Summary:
    Looks at conditionals and finds cases of ``cast<>``, which will
    assert rather than return a null pointer, and ``dyn_cast<>`` where
    the return value is not captured. Additionally, finds cases that
    match the pattern ``var.foo() && isa<X>(var.foo())``, where the
    method is called twice and could be expensive.

    .. code-block:: c++

      // Finds cases like these:
      if (auto x = cast<X>(y)) <...>
      if (cast<X>(y)) <...>

      // But not cases like these:
      if (auto f = cast<Z>(y)->foo()) <...>
      if (cast<Z>(y)->foo()) <...>

    Reviewers: alexfh, rjmccall, hokein, aaron.ballman, JonasToth

    Reviewed By: aaron.ballman

    Subscribers: xbolva00, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits

    Tags: #clang-tools-extra, #clang

    Differential Revision: https://reviews.llvm.org/D59802 (detail)
    by dhinton
  17. [clangd] Fix broken helper deep in unit test. NFC (detail)
    by sammccall
  18. [clangd] Fix handling of include paths in windows tests (detail)
    by kadircet
  19. [clang][HeaderSuggestion] Handle the case of dotdot with an absolute path

    Summary:
    Include insertion in clangd was inserting absolute paths when the
    include directory was an absolute path with a double dot. This patch makes sure
    double dots are handled both with absolute and relative paths.

    Reviewers: sammccall

    Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60873 (detail)
    by kadircet
  20. Re-apply r357823 "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."

    It now comes with a follow-up fix for the clients of this API
    in clangd and clang-tidy.

    Differential Revision: https://reviews.llvm.org/D59977 (detail)
    by dergachev
  21. [clangd] Support dependent bases in type hierarchy

    Patch by Nathan Ridge!

    Dependent bases are handled heuristically, by replacing them with the
    class template that they are a specialization of, where possible. Care
    is taken to avoid infinite recursion.

    Differential Revision: https://reviews.llvm.org/D59756 (detail)
    by maskray
  22. [CodeComplete] Remove obsolete isOutputBinary().

    Summary:
    It's never set to true. Its only effect would be to set stdout to binary mode.
    Hopefully we have better ways of doing this by now :-)

    Reviewers: hokein

    Subscribers: jkorous, arphaman, kadircet, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D60871 (detail)
    by sammccall
  23. [clangd] Support relatedInformation in diagnostics.

    Summary: We already have the structure internally, we just need to expose it.

    Reviewers: ilya-biryukov

    Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60267 (detail)
    by sammccall
  24. [clang-tidy] Address post-commit comments

    Summary:
    Also add a test to verify clang-tidy only apply the first alternative
    fix.

    Reviewers: alexfh

    Subscribers: xazax.hun, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60857 (detail)
    by hokein
  25. [clangd] Use llvm::set_thread_priority in background-index

    Reviewers: gribozavr

    Subscribers: krytarowski, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60865 (detail)
    by kadircet
  26. [clangd] Emit better error messages when rename fails.

    Summary:
    Currently we emit an unfriendly "clang diagnostic" message when rename fails. This
    patch makes clangd to emit a detailed diagnostic message.

    Reviewers: sammccall

    Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60821 (detail)
    by hokein
  27. [clangd] Log verbosely (LSP bodies) in lit tests. NFC (detail)
    by sammccall
  28. [clang-tidy] Don't issue cppcoreguidelines-macro-usage on builtin macros

    Before the patch calling clang-tidy with -header-filter=.* -system-headers would
    result in a few hundred useless warnings:
      warning: macro '_GNU_SOURCE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      warning: macro '_LP64' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      warning: macro '__ATOMIC_ACQUIRE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      warning: macro '__ATOMIC_ACQ_REL' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      warning: macro '__ATOMIC_CONSUME' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      warning: macro '__ATOMIC_RELAXED' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      warning: macro '__ATOMIC_RELEASE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      warning: macro '__ATOMIC_SEQ_CST' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      warning: macro '__BIGGEST_ALIGNMENT__' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]
      ... and so on (detail)
    by alexfh
  29. [clang-tidy] Add a check for [super self] in initializers 🔍

    Summary:
    This check aims to address a relatively common benign error where
    Objective-C subclass initializers call -self on their superclass instead
    of invoking a superclass initializer, typically -init. The error is
    typically benign because libobjc recognizes that improper initializer
    chaining is common¹.

    One theory for the frequency of this error might be that -init and -self
    have the same return type which could potentially cause inappropriate
    autocompletion to -self instead of -init. The equal selector lengths and
    triviality of common initializer code probably contribute to errors like
    this slipping through code review undetected.

    This check aims to flag errors of this form in the interests of
    correctness and reduce incidence of initialization failing to chain to
    -[NSObject init].

    [1] "In practice, it will be hard to rely on this function.
         Many classes do not properly chain -init calls."
    From  _objc_rootInit in https://opensource.apple.com/source/objc4/objc4-750.1/runtime/NSObject.mm.auto.html.

    Test Notes:
    Verified via `make check-clang-tools`.

    Subscribers: mgorny, xazax.hun, jdoerfert, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D59806 (detail)
    by stephanemoore
  30. [clangd] Strip the ' [some-check-name]' suffix from clang-tidy diagnostics. The check name is reported in Diagnostic.code.

    Reviewers: kadircet

    Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60819 (detail)
    by sammccall
  31. [clangd] Use shorter, more recognizable codes for diagnostics.

    Summary:
    - for warnings, use the flag the warning is controlled by (-Wfoo)
    - for errors, keep using the internal name (there's nothing better) but
       drop the err_ prefix

    This comes at the cost of uniformity, it's no longer totally obvious
    exactly what the code field contains. But the -Wname flags are so much
    more useful to end-users than the internal warn_foo that this seems worth it.

    Reviewers: kadircet

    Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60822 (detail)
    by sammccall
  32. [clangd] Recognize "don't include me directly" pattern, and suppress include insertion.

    Summary:
    Typically used with umbrella headers, e.g. GTK:

    #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
    #error "Only <gtk/gtk.h> can be included directly."
    #endif

    Heuristic is fairly conservative, a quick code search over github showed
    a fair number of hits and few/no false positives. (Not all were umbrella
    headers, but I'd be happy avoiding include insertion for all of them).

    We may want to relax the heuristic later to catch more cases.

    Reviewers: ioeric

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60815 (detail)
    by sammccall
  33. [clang-tidy] Fix invalid location in readability-misleading-indentation diagnostic

    Before this patch readability-misleading-indentation could issue diagnostics
    with an invalid location, which would lead to an assertion failure in
    ClangTidyContext::diag() (detail)
    by alexfh
  34. [clang-tidy] Add fix descriptions to clang-tidy checks.

    Summary:
    Motivation/Context: in the code review system integrating with clang-tidy,
    clang-tidy doesn't provide a human-readable description of the fix. Usually
    developers have to preview a code diff (before vs after apply the fix) to
    understand what the fix does before applying a fix.

    This patch proposes that each clang-tidy check provides a short and
    actional fix description that can be shown in the UI, so that users can know
    what the fix does without previewing diff.

    This patch extends clang-tidy framework to support fix descriptions (will add implementations for
    existing checks in the future). Fix descriptions and fixes are emitted via diagnostic::Note (rather than
    attaching the main warning diagnostic).

    Before this patch:

    ```
    void MyCheck::check(...) {
       ...
       diag(loc, "my check warning") <<  FixtItHint::CreateReplacement(...);
    }
    ```

    After:

    ```
    void MyCheck::check(...) {
       ...
       diag(loc, "my check warning"); // Emit a check warning
       diag(loc, "fix description", DiagnosticIDs::Note) << FixtItHint::CreateReplacement(...); // Emit a diagnostic note and a fix
    }
    ```

    Reviewers: sammccall, alexfh

    Reviewed By: alexfh

    Subscribers: MyDeveloperDay, Eugene.Zelenko, aaron.ballman, JonasToth, xazax.hun, jdoerfert, cfe-commits

    Tags: #clang-tools-extra, #clang

    Differential Revision: https://reviews.llvm.org/D59932 (detail)
    by hokein
  35. [clangd] Include textual diagnostic ID as Diagnostic.code.

    Reviewers: kadircet

    Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jdoerfert, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D58291 (detail)
    by sammccall
  36. [clangd] Include insertion: require header guards, drop other heuristics, treat .def like .inc.

    Summary:
    We do have some reports of include insertion behaving badly in some
    codebases. Requiring header guards both makes sense in principle, and is
    likely to disable this "nice-to-have" feature in codebases where headers don't
    follow the expected pattern.

    With this we can drop some other heuristics, such as looking at file
    extensions to detect known non-headers - implementation files have no guards.

    One wrinkle here is #import - objc headers may not have guards because
    they're intended to be used via #import. If the header is the main file
    or is #included, we won't collect locations - merge should take care of
    this if we see the file #imported somewhere. Seems likely to be OK.

    Headers which have a canonicalization (stdlib, IWYU) are exempt from this check.
    *.inc files continue to be handled by looking up to the including file.
    This patch also adds *.def here - tablegen wants this pattern too.

    In terms of code structure, the division between SymbolCollector and
    CanonicalIncludes has shifted: SymbolCollector is responsible for more.
    This is because SymbolCollector has all the SourceManager/HeaderSearch access
    needed for checking for guards, and we interleave these checks with the *.def
    checks in a loop (potentially).
    We could hand all the info into CanonicalIncludes and put the logic there
    if that's preferable.

    Reviewers: ioeric

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60316 (detail)
    by sammccall
  37. [clangd] lower_bound -> bsearch, NFC (detail)
    by sammccall
  38. clangd: Change Windows.h to windows.h.

    This makes the file more cross compilation friendly. (detail)
    by pcc
  39. [clangd] Check file path of declaring header when deciding whether to insert include.

    Summary:
    Previously, we would use include spelling of the declaring header to check
    whether the inserted header is the same as the main file. This doesn't help because
    we only have file path of the main file.

    Reviewers: sammccall

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60687 (detail)
    by ioeric
  40. [clangd] Fallback to OrigD when SLoc is invalid

    Summary:
    Some implicit/built-in decls lack the source location
    information. Fallback to OrigD that we've seen in the source code
    instead of the canonical one in those cases.

    Reviewers: sammccall

    Subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60689 (detail)
    by kadircet
  41. [clangd] Wait for compile command in ASTWorker instead of ClangdServer

    Summary:
    This makes addDocument non-blocking and would also allow code completion
    (in fallback mode) to run when worker waits for the compile command.

    Reviewers: sammccall, ilya-biryukov

    Reviewed By: ilya-biryukov

    Subscribers: javed.absar, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D60607 (detail)
    by ioeric
  42. [clangd] Bump clangd-index version for TemplateArgument changes (detail)
    by kadircet
  43. [clangd] Reorder source files in CMakeLists (detail)
    by kadircet
Revision: 358206
Changes
  1. [Sanitizer] Cleanup {ASAN, MSAN}_INTERCEPT_FUNC[_VER] macro

    Note that this change is not strictly NFC since we add the
    `(&(name) != &WRAP(name)` part to the conditional for the `_VER` variant
    of the macro.

    Reviewers: vitalybuka

    Differential Revision: https://reviews.llvm.org/D61204 (detail)
    by yln
  2. [builtins] Use __APPLE__ instead of __MACH__ in check

    The latter doesn't seem to be working for all targets. This addresses
    the issue introduced in r359413. (detail)
    by phosek
  3. [builtins] Fix the missing assembly on Darwin

    This was introduced in r359413. (detail)
    by phosek
  4. [builtins] Fix the typo in the preprocessor check

    This was introduced in r359413. (detail)
    by phosek
  5. [builtins] Use aliases for function redirects

    Symbol aliases are supported by all platforms that compiler-rt builtins
    target, and we can use these instead of function redirects to avoid the
    extra indirection.

    This is part of the cleanup proposed in "[RFC] compiler-rt builtins
    cleanup and refactoring".

    Differential Revision: https://reviews.llvm.org/D60931 (detail)
    by phosek
  6. [builtins] Use single line C++/C99 comment style

    Use the uniform single line C++/99 style for code comments.

    This is part of the cleanup proposed in "[RFC] compiler-rt builtins
    cleanup and refactoring".

    Differential Revision: https://reviews.llvm.org/D60352 (detail)
    by phosek
  7. [builtins] Reformat builtins with clang-format

    Update formatting to use the LLVM style.

    This is part of the cleanup proposed in "[RFC] compiler-rt builtins
    cleanup and refactoring".

    Differential Revision: https://reviews.llvm.org/D60351 (detail)
    by phosek
  8. [CMake] Don't modify `FUZZER_SUPPORTED_ARCH` is place.

    On a Darwin host we were modifying the `FUZZER_SUPPORTED_ARCH` in place
    which would strip out non-x86 architectures. This unhelpful if we
    want to use `FUZZER_SUPPORTED_ARCH` later.

    To fix this we introduce `FUZZER_TEST_ARCH` which is similar to what we
    have for for the other sanitizers. For non-Darwin host platforms
    `FUZZER_TEST_ARCH` is the same as `FUZZER_SUPPORTED_ARCH` but for Darwin
    host platforms we use `darwin_filter_host_archs(...)` as the previous
    code did. (detail)
    by delcypher
  9. [sanitizer] Calculate SizeClassAllocator32::ByteMap type from Params::kSpaceSize and Params::kRegionSizeLog

    Reviewers: eugenis

    Subscribers: kubamracek, cryptoad, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D61206 (detail)
    by vitalybuka
  10. [sanitizer] NFC: add static_assert to confirm that we use reasonable ByteMap type

    Summary: If bots work we can replace #ifs with template specialization by TwoLevelByteMapSize1.

    There is known users of TwoLevelByteMap with TwoLevelByteMapSize1 equal 8,
    and users of FlatByteMap with TwoLevelByteMapSize1 equal 2.

    Reviewers: eugenis

    Subscribers: kubamracek, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D61200 (detail)
    by vitalybuka
  11. [NFC][Sanitizer] Remove GetRealFunctionAddress and replace usages

    Reviewers: vitalybuka

    Differential Revision: https://reviews.llvm.org/D61205 (detail)
    by yln
  12. Revert "[sanitizer] NFC: add static_assert to confirm that we use optimal ByteMap type"

    Fails on bots with:

    /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-expensive/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h:69:3: error: static_assert failed due to requirement 'TwoLevelByteMapSize1 > 128' "TwoLevelByteMap should be used"
      static_assert(TwoLevelByteMapSize1 > 128, "TwoLevelByteMap should be used");
      ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-expensive/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h:29:34: note: in instantiation of template class '__sanitizer::SizeClassAllocator32<__sanitizer::AP32>' requested here
                            typename PrimaryAllocator::AddressSpaceView>::value,
                                     ^

    http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/13960/console (detail)
    by jfb
  13. [Sanitizer][Windows] Speculative fix for broken build on Windows (detail)
    by yln
  14. [Sanitizer] Fix test

    I broke the build, panicked and applied the wrong fix in my previous
    commit. The ASSERT was obsolete, but not the call INTERCEPT_FUNCTION. (detail)
    by yln
  15. [Sanitizer] Fix compliation error in test

    Remove obsolete assert. I missed this in my previous patch:
    https://reviews.llvm.org/D61145 (detail)
    by yln
  16. Implement __sanitizer::conditional<B, T, F> (detail)
    by vitalybuka
  17. [sanitizer] NFC: add static_assert to confirm that we use optimal ByteMap type

    Summary: If bots work we can replace #ifs with template specialization by TwoLevelByteMapSize1.

    Reviewers: eugenis

    Subscribers: kubamracek, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D61200 (detail)
    by vitalybuka
  18. Revert "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple"

    This reverts commit 1bcdbd68616dc7f8debe126caafef7a7242a0e6b.

    It's been reported that some bots are failing with this change with CMake
    error like:

    ```
    CMake Error at /b/s/w/ir/k/llvm-project/compiler-rt/cmake/config-ix.cmake:177 (message):
      Unsupported architecture: arm64
    Call Stack (most recent call first):
      /b/s/w/ir/k/llvm-project/compiler-rt/cmake/config-ix.cmake:216 (get_target_flags_for_arch)
      /b/s/w/ir/k/llvm-project/compiler-rt/test/tsan/CMakeLists.txt:78 (get_test_cflags_for_apple_platform)
    ```

    I'm reverting the patch now to unbreak builds. I will investigate properly when time permits.

    rdar://problem/50124489 (detail)
    by delcypher
  19. [NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION to void

    This temporary change tells us about all the places where the return
    value of the INTERCEPT_FUNCTION macro is actually used. In the next
    patch I will cleanup the macro and remove GetRealFuncAddress.

    Reviewed By: vitalybuka

    Differential Revision: https://reviews.llvm.org/D61145 (detail)
    by yln
  20. [NFC] Remove ::kForTest from AP64, it does not use it. (detail)
    by vitalybuka
  21. [asan_symbolize] Teach `asan_symbolize.py` to symbolicate using a module map

    Summary:
    The use case here is to be able get the UUIDs of the modules that need
    to be symbolicated so that external plugins can see them. This
    information can be extracted from ASan reports if the `print_module_map`
    ASan option is enabled. Currently printing of the module map is only
    implemented on Darwin and so this is effectively a Darwin only feature
    right now.

    The module map hooks into symbolization using the new plugin
    infrastructure. A new hook in `AsanSymbolizerPlugInProxy` (and in
    `AsanSymbolizerPlugIn`) is also provided to allow external plugins to hook
    into the module look up process. This will allow external plugins to
    look up modules with knowledge of their UUID.

    The new plug-in is currently stored in the `asan_symbolize.py` script.
    We could potentially move this into a separate file in the future (to
    reduce clutter) if we can come up with a policy for where to search for
    plugins that should always get loaded.

    rdar://problem/49476995

    Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

    Subscribers: #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D60531 (detail)
    by delcypher
  22. [CMake] Fix the value of `config.target_cflags` for non-macOS Apple
    platforms.

    The main problem here is that `-*-version_min=` was not being passed to
    the compiler when building test cases. This can cause problems when
    testing on devices running older OSs because Clang would previously
    assume the minimum deployment target is the the latest OS in the SDK
    which could be much newer than what the device is running.

    Previously the generated value looked like this:

    `-arch arm64 -isysroot
    <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`

    With this change it now looks like:

    `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot
    <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`

    This mirrors the setting of `config.target_cflags` on macOS.

    This change is made for ASan, LibFuzzer, TSan, and UBSan.

    To implement this a new `get_test_cflags_for_apple_platform()` function
    has been added that when given an Apple platform name and architecture
    returns a string containing the C compiler flags to use when building
    tests. This also calls a new helper function `is_valid_apple_platform()`
    that validates Apple platform names.

    rdar://problem/50124489

    Differential Revision: https://reviews.llvm.org/D58578 (detail)
    by delcypher
  23. [lsan] Use SANITIZER_WORDSIZE when selecting ByteMap

    Originally this code was added for 64-bit platform and it was never update.
    Add static_assert to validate type of ByteMap. (detail)
    by vitalybuka
  24. Revert "[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap"

    New static_assert fails on a bot.

    This reverts commit r359269. (detail)
    by vitalybuka
  25. NFC: Clang-format msan_allocator.cc (detail)
    by vitalybuka
  26. [lsan] Use SANITIZER_WORDSIZE when selecting ByteMap

    Originally this code as added for 64-bit platform and was never changed.
    Add static_assert to make sure that we have correct map on all platforms. (detail)
    by vitalybuka
  27. [libFuzzer] Disable MSan interceptors in SIGINT handler.

    Summary:
    Avoids an MSan false positive if the SIGINT comes while the user
    callback is running.  The false positive happens when the interrupt
    handler calls opendir() to remove some temporary files, which is
    intercepted by MSan.

    Fixes https://github.com/google/oss-fuzz/issues/2332.

    Reviewers: kcc

    Reviewed By: kcc

    Subscribers: llvm-commits, Dor1s, metzman

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61163 (detail)
    by morehouse
  28. [libFuzzer] Require linux for libcxx.test (detail)
    by morehouse
  29. [compiler-rt] Build custom libc++abi without exceptions.

    Summary:
    Since neither compiler-rt nor the libc++ we build use exceptions, we
    don't need libc++abi to have them either.

    This resolves an issue where libFuzzer's private libc++ contains
    implementations for __cxa_throw and friends, causing fuzz targets built
    with their own C++ library to segfault during exception unwinding.

    See https://github.com/google/oss-fuzz/issues/2328.

    Reviewers: phosek, EricWF, kcc

    Reviewed By: phosek

    Subscribers: kcc, dberris, mgorny, christof, llvm-commits, metzman

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61053 (detail)
    by morehouse
  30. [NFC][Sanitizer] Extract GetFuncAddr from GetRealFunctionAddress

    Summary:
    Hopefully, this will enable cleanup/removal of GetRealFunctionAddress in
    follow-up commits.

    Subscribers: #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D61110 (detail)
    by yln
  31. [scudo][standalone] Introduce the SizeClassMap

    Summary:
    As with the sanitizer_common allocator, the SCM allows for efficient
    mapping between sizes and size-classes, table-free.

    It doesn't depart significantly from the original, except that we
    allow the use of size-class 0 for other purposes (as opposed to
    chunks of size 0). The Primary will use it to hold TransferBatches.

    Reviewers: vitalybuka, eugenis, hctim, morehouse

    Reviewed By: vitalybuka

    Subscribers: srhines, mgorny, delcypher, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D61088 (detail)
    by cryptoad
  32. [sanitizer_common] Remove some old commented-out printf statements, and fixed up the order of includes. (detail)
    by hctim
  33. [compiler-rt] NFC fixed [whitespace/braces] LINT warning (detail)
    by vitalybuka
  34. [fuzzer] Fix reload.test on Linux/aarch64

    The compiler generates a 'brk' instruction for __builtin_trap on aarch64
    and Linux kernel issues a SIGTRAP. It is different from x86, where
    compiler emits an 'ud2' and kernel issues a SIGILL.

    A straightforward is to use abort instead. (detail)
    by azanella
  35. [compiler-rt] Fix warning about virtual destructor in sanitizer_flag_parser.h (detail)
    by vitalybuka
  36. [llvm-symbolizer] Quick fix for broken sanitizer bot
    (sanitizer-x86_64-linux) until I can triage the issue properly. The
    build has been broken due to the symbolizer build checks failing.

    As the symbolizer build script relies on the old svn repo layout, it may
    take a little while longer to find the responsible patch for the
    breakage. This may be a completely valid fix, but I will need to confirm
    it. For now, it unbreaks the build.

    Tracking data:
    Build where the break first occurred: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/21211
    Changelist authors: @grimar, @maskray, @whitequark, @spatel, @dpreobra

    For the authors, no action needed (yet). Will follow up when I can
    identify the cause. (detail)
    by hctim
  37. [scudo][standalone] Introduce the Secondary allocator

    Summary:
    The Secondary allocator wraps the platform allocation primitives. It is
    meant to be used for larger sizes that the Primary can't fullfill, as
    it will be slower, and sizes are multiple of the system page size.

    This also changes some of the existing code, notably the opaque
    platform data being passed to the platform specific functions: we can
    shave a couple of syscalls on Fuchsia by storing additional data (this
    addresses a TODO).

    Reviewers: eugenis, vitalybuka, hctim, morehouse

    Reviewed By: morehouse

    Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D60787 (detail)
    by cryptoad
  38. The error message for mismatched value sites is very cryptic.
    Make it more readable for an average user.

    Differential Revision: https://reviews.llvm.org/D60896 (detail)
    by dmikulin
  39. [TSan] Support fiber API on macOS

    Committing on behalf of Yuri Per (yuri).

    Reviewers: dvyukov, kubamracek, yln

    Reviewed By: kubamracek

    Authored By: yuri

    Differential Revision: https://reviews.llvm.org/D58110 (detail)
    by yln
  40. [CMake] Add fuzzer as a component for runtime builds

    Calling `add_compiler_rt_component` sets up the component connection between runtime builds and the parent CMake configuration. Adding this call allows specifying `fuzzer` as a `LLVM_RUNTIME_DISTRIBUTION_COMPONENT`. (detail)
    by cbieneman
  41. [gn] Support dots in CMake paths in the sync script

    Some file paths use dots to pick up sources from parent directories.

    Differential Revision: https://reviews.llvm.org/D60734 (detail)
    by phosek
  42. Removed regiser dump checks from FP unit test. (detail)
    by hctim
  43. [HWASan] Added no-FP unit test for register dump.

    Summary: Unit test for D60798.

    Reviewers: eugenis

    Subscribers: kubamracek, #sanitizers, llvm-commits, pcc

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D60806 (detail)
    by hctim
  44. Updated test case. (detail)
    by hctim
  45. Added no-FP unit test for register dump. (detail)
    by hctim
  46. [libFuzzer] revert part of r358726 committed by mistake (oops) (detail)
    by kcc
  47. [libFuzzer] in fork mode, make sure the child stats are always collected. This should fix the flakiness in fork-ubsan.test (detail)
    by kcc
  48. [builtins] Build x86_64 with GENERIC_TF_SOURCES (detail)
    by kongyi
  49. Summary:
    Add close_fd_mask functionality to AFL driver.

    Summary:
    Add support for env var AFL_DRIVER_CLOSE_FD_MASK which behaves
    the same as libFuzzer's -close_fd_mask=1.

    Also add tests.

    Reviewers: kcc, vitalybuka, morehouse

    Reviewed By: morehouse

    Subscribers: #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D60334 (detail)
    by metzman
  50. [asan_symbolize] Workaround bug in old Python 2 versions.

    The change landed in r358657 broke some of the buildbots because they
    use an older version of Python 2 that raises this error.

    ```
    File "/Volumes/data/dev/llvm/upstream/master/src/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py", line 509
      exec(f.read(), globals_space, None)
    SyntaxError: unqualified exec is not allowed in function 'load_plugin_from_file' it contains a nested function with free variables
    ```

    I can reproduce this problem when using Python 2.7.6.

    To workaround this some indirection has been added to prevent the broken
    (the line at fault would never be executed) SyntaxError error in old
    Python versions from being raised.

    rdar://problem/49476995 (detail)
    by delcypher
  51. [asan_symbolize] Add a simple plugin architecture

    Summary:
    This change adds a simple plugin architecture to `asan_symbolize.py`.
    The motivation here is that sometimes it's necessary to perform extra
    work to figure out where binaries with debug symbols can actually be
    found. For example it might be the case that a remote service needs
    to be queried for binaries and then copied to the local system.

    This "extra work" can be extremely site-specific such that adding the
    code directly into the `asan_symbolize.py` would just clutter the code
    for a very niche use case. To avoid this, the `asan_symbolize.py` can
    now load external code via a new `--plugins` command line option.

    These plugins are loaded before main command line argument parsing so
    that they can add their own command line options.

    Right now the only hook into the behaviour of symbolization is the
    `filter_binary_path()` function which assumes a very similar role
    to the `binary_name_filter` function that was previously in the code.
    We can add more hooks as necessary.

    Code in the `asan_symbolize.py` script does not call plugin code
    directly. Instead it uses a `AsanSymbolizerPlugInProxy` object.
    This object

    * Loads plugins from files.
    * Manages the lifetime of the plugins.
    * Provides an interface for calling into plugin functions and handles
      calling into multiple plugins.

    To unify the way binary paths are filtered the old `sysroot_path_filter`
    function (and associated code) has been turned into a simple plugin
    (`SysRootFilterPlugIn`) that is always loaded. The plugin unloads
    itself if the `-s` option is not present on the command line. Users
    should not see any functional change relating to this command line
    option.

    Some simple tests are provided to illustrate what plugin code looks
    like and also to check the functionality continues to work.

    rdar://problem/49476995

    Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

    Subscribers: srhines, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D60529 (detail)
    by delcypher
  52. [builtins] Add __cmpsf2 for ARM version of comparesf2

    The generic version of comparesf2 defines __cmpsf2 alias for libgcc
    compatibility, but the ARM overlay is missing the alias.

    Differential Revision: https://reviews.llvm.org/D60805 (detail)
    by kongyi
  53. [HWASan] Fixed slow DWARF unwinding.

    Summary: CFA was setup incorrectly, as there is an 8-byte gap at the top of the stack for SP 16-byte alignment purposes.

    Reviewers: eugenis

    Reviewed By: eugenis

    Subscribers: kubamracek, javed.absar, #sanitizers, llvm-commits, pcc

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D60798 (detail)
    by hctim
  54. [libFuzzer] Remove tautological compare. (detail)
    by morehouse
  55. [TSan][libdispatch] Port gcd-sync-block-copy.mm to C++

    Summary:
    Apparently, it makes a difference on where a block lives depending on if
    it's passed "inline" versus assigned and then passed via a variable.
    Both tests in this commit now give a signal, if `Block_copy` is used in
    `dispatch_sync`.

    Since these tests use different mechanisms (Objective-C retain versus
    C++ copy constructor) as proxies to observe if the block was copied, we
    should keep both of them.

    Commit, that first avoided the unnecessary copy:
    faef7d034a9ec6cb757137adce8e8670ec6c2d7b

    Subscribers: kubamracek, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D60639 (detail)
    by yln
Revision: 358206
Changes
  1. Add tests specifically for LWG2164. We already did this; but now we have tests. NFC (detail)
    by marshall
  2. Fix permission error while running bots (detail)
    by ericwf
  3. attempt to unbreak build bots (detail)
    by ericwf
  4. Attempt to switch to auto-scaling bots (detail)
    by ericwf
  5. Add '_LIBCPP_ASSERT(ready())' to several match_results method that have this precondtion. Fix several tests which did not honor this precondition. Thanks to Andrey Maksimov for pointing this out. (detail)
    by marshall
  6. [libc++] Relax libc++-only test on regex_constants

    The standard requires the following for the std::regex_constants::error_type
    values: "The type error_type is an implementation-defined enumerated type."

    The values of this enumerated type are not required to be non-zero.
    This patch makes such checks in tests libc++-specific to let the tests
    pass for other conforming implementations.

    Thanks to Andrey Maksimov for the patch.
    Differential Revision: https://reviews.llvm.org/D61195 (detail)
    by ldionne
  7. Fix r359229 which tried to fix r359159...

    When r359229 added noexcept to the declaration of `~mutex`, it didn't
    add it to the definition which caused -Wimplicit-exception-spec-mismatch
    to fire. This just adapts the definition to agree with the declaration. (detail)
    by chandlerc
  8. add tuple_cat test for const T (detail)
    by ericwf
  9. Fix return type of std::tuple_cat.

    When the arguments to tuple cat were const, the const was incorrectly
    propagated into the type of the resulting tuple. For example:

    const std::tuple<int> t(42);
    auto r = std::tuple_cat(t, t);
    // Incorrect! should be std::tuple<int, int>.
    static_assert(is_same_v<decltype(r), std::tuple<const int, const int>>); (detail)
    by ericwf
  10. Remove incorrect explicit instantiation declarations for valarray

    libc++ ABI v1 provides three valarray symbols as part of the shared library:

    valarray<size_t>::valarray(size_t)
    valarray<size_t>::~valarray()
    valarray<size_t>::resize(size_t, size_t)

    The first two of these are intended to be removed in V2 of the ABI: they're
    attributed _LIBCPP_HIDE_FROM_ABI_AFTER_V1, and  it appears that the intention
    is that these symbols from the library are not used even when building using
    the V1 ABI. However, there are explicit instantiation declarations for all
    three symbols in the header, which are not correct as we do not intend to find
    an instantiation of these functions that is provided elsewhere.

    (A recent change to clang to properly diagnose explicit instantiation
    declarations of internal linkage functions -- required by [temp.explicit]p13 --
    had to be rolled back because it diagnosed these explicit instantiations.)

    Remove the explicit instantiation declarations, and remove the explicit
    instantiation definitions for V2 of the libc++ ABI onwards. (detail)
    by rsmith
  11. Remove libc++ checks and workarounds for unsupported old versions of GCC (<4.9).

    Differential Revision: https://reviews.llvm.org/D61107 (detail)
    by rsmith
  12. Fix buildbot failures after r359159.

    std::mutex was not actually is_nothrow_default_constructible in C++98/C++03,
    because the variable declaration

      std::mutex M;

    ... could throw an exception from the mutex destructor. Fix it by marking the
    destructor as non-throwing. This has no effect in C++11 onwards, because
    destructors are non-throwing by default in those language modes. (detail)
    by rsmith
  13. Set _LIBCPP_DLL_VIS on _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS in MinGW mode

    Contrary to MSVC, MinGW compilers wants the dllexport attribute on
    the declaration of an explicit template instantiation, not on the
    definition.

    Differential Revision: https://reviews.llvm.org/D61123 (detail)
    by mstorsjo
  14. [libc++][test] Fix noexcept assertions in variant's get tests

    All constant expressions are non-potentially-throwing in C++14, but that is *not* the case in C++17. Change these tests of the `variant`-flavored overloads of `std::get` to expect the correct behavior when the compiler is not GCC or is GCC 9+.

    Credit to Jonathan Wakely for providing an improved version of my initial change that validates the incorrect behavior on GCC < 9 as well as validating the correct behavior on other compilers.

    Differential Revision: https://reviews.llvm.org/D61033 (detail)
    by caseycarter
  15. Implement 'lerp'; which is the last bit of P0811. Mark that paper as complete. (detail)
    by marshall
  16. Implement midpoint for floating point types. Reviewed as https://reviews.llvm.org/D61014. (detail)
    by marshall
  17. Update test to better check for the non-constexpr-ness of a move constructor. Fixes PR#41577. (detail)
    by marshall
  18. Use modern type trait implementations when available.

    Teach libcxx to stop using various deprecated __has_* type traits, in favor of
    the ("modern", C++11 era) __is_* type traits.

    This is mostly just a simplification, but fixes at least one bug: _Atomic T
    should be considered trivially-destructible, but is not considered to be POD by
    Clang, and __has_trivial_destructor is specified in the GCC documentation as
    returning false for non-POD non-class types.

    Differential Revision: https://reviews.llvm.org/D48292 (detail)
    by rsmith
  19. Add std::is_constant_evaluated.

    Clang recently added __builtin_is_constant_evaluated() and GCC 9.0
    has it as well.

    This patch adds support for it in libc++. (detail)
    by ericwf
  20. Make the test object callable. libstdc++'s bind checks that (libc++ currently does not). Thanks to Jonathan Wakely for the fix. (detail)
    by marshall
  21. Fix a one more compare test that assumed -1/0/1 instsad of <0/0/>0. NFC. (detail)
    by marshall
  22. Fix a couple of tests that assumed that compare retunred -1/0/1 instead of <0/0/>0. Thanks to Jonathan Wakely for the report. (detail)
    by marshall
  23. Add an any_cast test for array types. Thanks to Jonathan Wakely for the suggestion. (detail)
    by marshall
  24. Avoid name conflict with kernel headers (detail)
    by ericwf
  25. [libcxx] Use relative path for libc++ library when generating script

    This addresses the issue introduced in D60309 which leads to linker
    scripts being generated with absolute paths.

    Differential Revision: https://reviews.llvm.org/D61039 (detail)
    by phosek
  26. Fix namespace name conflict with GCC (detail)
    by ericwf
  27. Fix implementation of ::abs and std::abs LWG 2192.

    Summary:
    All overloads of `::abs` and `std::abs` must be present in both `<cmath>` and `<cstdlib>`. This is problematic to implement because C defines `fabs` in `math.h` and `labs` in `stdlib.h`. This introduces a circular dependency between the two headers.

    This patch implements that requirement by moving `abs` into `math.h` and making `stdlib.h` include `math.h`. In order to get the underlying C declarations from the "real" `stdlib.h` inside our `math.h` we need some trickery. Specifically we need to make `stdlib.h` include next itself.

    Suggestions for a cleaner implementation are welcome.

    Reviewers: mclow.lists, ldionne

    Reviewed By: ldionne

    Subscribers: krytarowski, fedor.sergeev, dexonsmith, jdoerfert, jsji, libcxx-commits

    Differential Revision: https://reviews.llvm.org/D60097 (detail)
    by ericwf
  28. [libc++] Remove redundant conditionals for Apple platforms

    Summary:
    In a bunch of places, we used to check whether LIBCXX_BUILDING_LIBCXXABI
    is defined OR we're building for an Apple platform. This used to
    be necessary in a time when Apple's build script did NOT define
    LIBCXX_BUILDING_LIBCXXABI. However this is not relevant anymore
    since Apple's build does define LIBCXX_BUILDING_LIBCXXABI.

    Reviewers: EricWF

    Subscribers: christof, jkorous, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D60842 (detail)
    by ldionne
  29. [libcxx] Update gen_link_script.py to support different input and output

    This enables the use of this script from other build systems like
    GN which don't support post-build actions as well as for static
    archives.

    Differential Revision: https://reviews.llvm.org/D60309 (detail)
    by phosek
  30. [libc++][test] Update some wstring_convert tests for MSVC quirks

    Due to MSVC's decision to encode `wchar_t` as UTF-16, it rejects wide
    character/string literals that expect a character value greater than
    `\xffff`. UTF-16 `wchar_t` is clearly non-conforming, given that the
    standard requires wchar_t to be capable of representing all characters
    in the supported wide character execution sets, but rejecting e.g.
    `\x40003` is a reasonably sane compromise given that encoding choice:
    there's an expectation that `\xFOO` produces a single character in the
    resulting literal. Consequently `L'\x40003'`/`L"\x40003"` are ill-formed
    literals on MSVC. `L'\U00040003'` is a high surrogate (and produces a
    warning about ignoring the "second character" in a multi-character
    literal), and `L"\U00040003"` is a perfectly-valid `const wchar_t[3]`.

    This change updates these tests to use universal-character-names instead
    of raw values for the intended character values, which technically makes
    them portable even to implementations that don't use a unicode
    transformation format encoding for their wide character execution
    character set. The two-character literal `L"\u1005e"` is awkward - the
    `e` looks like part of the UCN's hex encoding - but necessary to compile
    in '03 mode since '03 didn't allow UCNs to be used for members of the
    basic execution character set even in character/string literals.

    I've also eliminated the extraneous `\x00` "bonus null-terminator" in
    some of the string literals which doesn't affect the tested behavior.

    I'm sorry about using `*L"\U00040003"` in `conversions.string/to_bytes.pass.cpp`,
    but it's correct for platforms with 32-bit wchar_t, *and* doesn't
    trigger narrowing warnings as did the prior `CharT(0x40003)`.

    Differential Revision: https://reviews.llvm.org/D60950 (detail)
    by caseycarter
  31. [libc++] [test] Silence C++20 deprecation warnings in the MSVC STL

    ... when including msvc_stdlib_force_include.hpp. (detail)
    by caseycarter
  32. [libc++] Make __debug_less::operator() constexpr

    This is a followup to [1] which added a new `__debug_less::operator()` overload.
    [2] added `_LIBCPP_CONSTEXPR_AFTER_CXX17` to the original
    `__debug_less::operator()` between the time of writing [1] and landing it.  This
    change adds `_LIBCPP_CONSTEXPR_AFTER_CXX17` to the new overload too.

    [1] https://reviews.llvm.org/rL358423
    [2] https://reviews.llvm.org/rL358252

    Differential Revision: https://reviews.llvm.org/D60724 (detail)
    by thomasanderson
  33. [libc++] Link against libc++abi in the libc++abi tests

    PR27405 (detail)
    by ldionne
  34. [libc++] [test] Add missing required headers to midpoint.integer.pass.cpp

    This change authored by Paolo Torres <t-pator@microsoft.com> (detail)
    by bion
  35. [libc++] Make sure we re-export some missing libc++abi symbols from libc++

    Summary:
    Ensure we re-export __cxa_throw_bad_array_new_length and
    __cxa_uncaught_exceptions from libc++, since they are now
    provided by libc++abi.

    Doing this allows us to stop linking explicitly against libc++abi in
    the libc++abi tests, since libc++ re-exports all the necessary symbols.
    However, there is one caveat to that. We don't want libc++ to re-export
    __cxa_uncaught_exception (the singular form), since it's only provided
    for backwards compatibility. Hence, for the single test where we check
    this backwards compatibility, we explicitly link against libc++abi.

    PR27405
    PR22654

    Reviewers: EricWF

    Subscribers: christof, jkorous, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D60424 (detail)
    by ldionne
  36. [libc++] Unconditionally enable the __pad_and_output optimization

    This used to be guarded on whether the deployment target was greater
    than macosx10.8, however testing against the dylibs for 10.8 and earlier
    with the function enabled works too. The revision that introduced
    __pad_and_output is r164241 and it does not mention a reason for the
    guard. (detail)
    by ldionne
  37. [libc++][CMake] Always provide new/delete in libc++ unless specified otherwise

    Summary:
    Let's not try to be clever and detect it based on the libc++abi setting.
    The only build that puts new/delete in libc++abi is Apple's and we set
    this CMake option explicitly in both libc++ and libc++abi. Complicated
    dependent options hurt, let's avoid them when possible.

    Reviewers: phosek, EricWF

    Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D60797 (detail)
    by ldionne
  38. [libc++][CMake] Remove unnecessary conditional for defining new handlers

    It turns out that whether the new handlers should be provided is orthogonal
    to whether new/delete are provided in libc++ or libc++abi. The reason why
    I initially added this conditional is because of an incorrect understanding
    of the path we're taking when building on Apple platforms. In fact, we
    always build libc++ on top of libc++abi on Apple platforms, so we take
    the branch for `LIBCXX_BUILDING_LIBCXXABI` there. (detail)
    by ldionne
  39. [CMake] Split linked libraries for shared and static libc++

    Some linker libraries are only needed for shared libc++, some only
    for static libc++, combining these together in LIBCXX_LIBRARIES and
    LIBCXX_INTERFACE_LIBRARIES can introduce unnecessary dependencies.

    This changes splits those up into LIBCXX_SHARED_LIBRARIES and
    LIBCXX_STATIC_LIBRARIES matching what libc++abi already does.

    Differential Revision: https://reviews.llvm.org/D57872 (detail)
    by phosek
  40. [libc++] (Take 2) Add a test that uses the debug database from multiple threads

    In r358591, I added a test that uses the debug database from multiple
    threads and that helped us uncover the problem that was fixed in r355367.
    However, the test broke the tsan CI bots, and I think the problem is the
    test allocator that was used in the test (which is not thread safe).

    I'm committing again without using the test allocator, and in a separate
    test file. (detail)
    by ldionne
  41. [libc++][CMake] Allow building neither the shared nor the static library

    It's possible to build just the headers, and we actually do it. (detail)
    by ldionne
  42. [libc++] Use the no_destroy attribute to avoid destroying debug DB statics

    Summary:
    Otherwise, we can run into problems when the program has static variables
    that need to use the debug database during their deinitialization, if
    the debug DB has already been deinitialized.

    Reviewers: EricWF

    Subscribers: christof, jkorous, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D60830 (detail)
    by ldionne
  43. Revert "[libc++] Add a test that uses the debug database from multiple threads"

    This reverts r358591, which seems to have uncovered an actual bug and
    causes the tsan CI to fail. We need to fix the bug and re-commit the
    test. (detail)
    by ldionne
  44. [libc++] Add a test that uses the debug database from multiple threads

    This test helped us concurrently discover the problem that was fixed
    in r355367. (detail)
    by ldionne
  45. [libc++][NFC] Make size of allocation more self-documenting (detail)
    by ldionne
  46. Fix visibility for coroutine types on Windows (detail)
    by ericwf
  47. Add tests for stability to list::sort and forward_list::sort. Thanks to Jonathan Wakely for the notice (detail)
    by marshall
  48. Fix list/forward_list implementations of remove_if and unique to deal with predicates that are part of the sequence passed in. We already do this for remove. (detail)
    by marshall
  49. [NFC] Build libc++ verbosely in the macOS CI (detail)
    by ldionne
  50. [libc++] Make sure we use new/delete from libc++abi on CI for Apple platforms (detail)
    by ldionne
  51. [libc++] Remove old workaround for buildit

    Summary:
    I'm not sure what the problem was at the time, however I don't think
    this is necessary since buildit doesn't exist anymore.

    Instead of the workaround, the correct thing to do is to leave out
    the get_new_handler/set_new_handler definitions from libc++ when
    we're getting them from libc++abi.

    Reviewers: EricWF

    Subscribers: christof, jkorous, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D60717 (detail)
    by ldionne
  52. [libc++] Fix debug_less test in C++03

    We were using C++11 features but the test needs to work in C++03 too. (detail)
    by ldionne
  53. [libc++] Fix build failure with _LIBCPP_DEBUG=0 when iterators return values instead of references

    There are many STL algorithms (such as lexicographical_compare) that compare
    values pointed to by iterators like so:
        __comp(*it1, *it2);

    When building with `_LIBCPP_DEBUG=0`, comparators are wrapped in `__debug_less`
    which does some additional validation.  But `__debug_less::operator()` takes
    non-const references, so if the type of `*it1` is int, not int&, then the build
    will fail.

    This change adds a `const&` overload for `operator()` to fix the build.

    Differential Revision: https://reviews.llvm.org/D60592 (detail)
    by thomasanderson
  54. [NFC] Add missing revision number in libc++ ABI changelog (detail)
    by ldionne
  55. [libc++] Make sure that the symbol differ takes into account symbol types

    Summary:
    Otherwise, it doesn't take into account things like whether the symbol
    is defined or undefined, and whether symbols are indirect references
    (re-exports) or not.

    Reviewers: EricWF

    Subscribers: christof, jkorous, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D60416 (detail)
    by ldionne

Started by upstream project relay-lnt-test-suite build number 7124
originally caused by:

This run spent:

  • 13 min waiting;
  • 59 min build duration;
  • 59 min total from scheduled to completion.

Identified problems

No identified problem

No problems were identified. If you know why this problem occurred, please add a suitable Cause for it.