Started 1 yr 5 mo ago
Took 41 min on green-dragon-22

Failed Build rL:346148 - C:346146 - #23 - green-dragon-22 (Nov 6, 2018 7:49:33 AM)

  • : 346148
  • : 346146
  • : 346145
  • : 346066
  • : 346037
  • : 346104
  • : 346054
  1. [Power9] Add support for and intrinsics

    On Power9, we don't have patterns to select the following intrinsics:

    This patch adds support for these.

    Differential Revision: (detail)
    by syzaara
  2. [InstCombine] canonicalize -0.0 to +0.0 in fcmp

    As stated in IEEE-754 and discussed in:
    ...the sign of zero does not affect any FP compare predicate.

    Known regressions were fixed with:
    rL346097 (D54001)

    The transform will help reduce pattern-matching complexity to solve: well as improve CSE and codegen (a zero constant is almost always
    easier to produce than 0x80..00). (detail)
    by spatel
  3. [AST] Get aliased type info from an aliased TemplateSpecialization.

    Previously the TemplateSpecialization instance for 'template_alias', in the example below, returned the type info of the  canonical type (int).  This ignored the type alias if the template type happen to be aliased.

    Before this patch, the assert would trigger with an  alignment of 4:
    typedef int __attribute__(( aligned( 16 ) )) aligned_int;
    template < typename >
    using template_alias = aligned_int;
    static_assert( alignof( template_alias<void>) == 16, "" );

    This patch checks if the TemplateSpecialization type has an alias, and if so will return the type information for the aliased type, else the canonical type's info is returned (original behavior).  I believe that this is the desired behavior. 

    Reviewers: aaron.ballman, rjmccall

    Reviewed By: rjmccall

    Subscribers: cfe-commits

    Differential Revision: (detail)
    by mattd
  4. [UBsan] disable few tests for FreeBSD

    Reviewers: krytarowsky, vitalybuka

    Reviewed By: vitalybuka

    Differential Revision: (detail)
    by David CARLIER
  5. [Format] Add debugging to ObjC language guesser

    To handle diagnosing bugs where ObjCHeaderStyleGuesser guesses
    wrong, this diff adds a bit more debug logging to the Objective-C
    language guesser.

    Reviewers: krasimir

    Reviewed By: krasimir

    Subscribers: cfe-commits

    Differential Revision: (detail)
    by benhamilton
  6. [InstCombine] loosen FP 0.0 constraint for fcmp+select substitution

    It looks like we correctly removed edge cases with 0.0 from D50714,
    but we were a bit conservative because getBinOpIdentity() doesn't
    distinguish between +0.0 and -0.0 and 'nsz' is effectively always
    true for fcmp (see discussion in:

    Without this change, we would get regressions by canonicalizing
    to +0.0 in all fcmp, and that's a step towards solving: (detail)
    by spatel
  7. [InstCombine] adjust tests for select with FP identity op; NFC

    These are mislabeled as negative tests. (detail)
    by spatel
  8. [FPEnv] Add constrained CEIL/FLOOR/ROUND/TRUNC intrinsics

    Differential Revision: (detail)
    by mcinally
  9. [ThinLTO] Add an option to disable (thin)lto internalization.

    LTO and ThinLTO optimizes the IR differently.

    One source of differences is the amount of internalizations that
    can happen.

    Add an option to enable/disable internalization so that other
    differences can be studied in isolation. e.g. inlining.

    There are other things lto and thinlto do differently, I will add
    flags to enable/disable them as needed.

    Reviewers: tejohnson, pcc, steven_wu

    Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, dang, llvm-commits

    Differential Revision: (detail)
    by trentxintong
  10. [TargetLowering] Begin generalizing TargetLowering::expandFP_TO_SINT support. NFCI.

    Prior to initial work to add vector expansion support, remove assumptions that we're working on scalar types. (detail)
    by rksimon
  11. [InstCombine] add/adjust tests for select with fsub identity op; NFC (detail)
    by spatel
  12. [NFCI][FPEnv] Split constrained intrinsic tests

    The constrained intrinsic tests have grown in number. Split off
    the FMA tests into their own file to reduce double coverage.

    Differential Revision: (detail)
    by mcinally
  13. [InstCombine] add tests for select with FP identity op; NFC (detail)
    by spatel
  14. [Tooling] Correct the total number of files being processed when `filter` is provided.

    Reviewers: ioeric

    Subscribers: cfe-commits

    Differential Revision: (detail)
    by hokein
  15. [Inliner] Penalise inlining of calls with loops at Oz

    We currently seem to underestimate the size of functions with loops in them,
    both in terms of absolute code size and in the difficulties of dealing with
    such code. (Calls, for example, can be tail merged to further reduce
    codesize). At -Oz, we can then increase code size by inlining small loops
    multiple times.

    This attempts to penalise functions with loops at -Oz by adding a CallPenalty
    for each top level loop in the function. It uses LI (and hence DT) to calculate
    the number of loops. As we are dealing with minsize, the inline threshold is
    small and functions at this point should be relatively small, making the
    construction of these cheap.

    Differential Revision: (detail)
    by dmgreen
  16. [Mips] Supplement long branch pseudo instructions

    Expand on LONG_BRANCH_LUi and LONG_BRANCH_(D)ADDiu pseudo
    instructions by creating variants which support
    less operands/accept GPR64Opnds as their operand in order
    to appease the machine verifier pass.

    Differential Revision: (detail)
    by smaksimovic
  17. [NFC][ARM] Adding extra test for ARM CGP

    Added a reproducer that I received a while ago. (detail)
    by sam_parker
  18. [Tooling] Add "-filter" option to AllTUsExecution

    Summary: We can run the tools on a subset files of compilation database.

    Reviewers: ioeric

    Subscribers: cfe-commits

    Differential Revision: (detail)
    by hokein
  19. Reapply "Fix regression in behavior of clang -x c++-header -fmodule-name=XXX"

    This reverts commit r345963. We have a path forward now.

    Original commit message:
    The driver accidentally stopped passing the input filenames on to -cc1
    in this mode due to confusion over what action was being requested.

    This change also fixes a couple of crashes I encountered when passing
    multiple files to such a -cc1 invocation. (detail)
    by d0k
  20. Fix build on sparc64-linux-gnu.

    Differential Revision: (detail)
    by marxin
  21. [AMDGPU] Fix the new atomic optimizer in pixel shaders.

    The new atomic optimizer I previously added in D51969 did not work
    correctly when a pixel shader was using derivatives, and had helper
    lanes active.

    To fix this we add an call that guards a branch
    around the entire atomic operation - ensuring that all helper lanes are
    inactive within the wavefront when we compute our atomic results.

    I've added a test case that can cause derivatives, and exposes the

    Differential Revision: (detail)
    by sheredom
  22. [CMake] Expose opt-remark tooling through libOptRemarks.dylib

    * Create an install target for it
    * Add it under tools/opt-remarks
    * Add an export file for the dylib
    * Install the llvm-c/OptRemarks.h header
    * Add an API to query its version

    rdar://45458839 (detail)
    by thegameg
  23. [ARM] Turn assert into condition in ARMCGP

    Turn the assert in PrepareConstants into a conditon so that we can
    handle mul instructions with negative immediates.

    Differential Revision: (detail)
    by sam_parker
  24. [ARM][ARMCGP] Remove unecessary zexts and truncs

    r345840 slightly changed the way promotion happens which could
    result in zext and truncs having the same source and destination
    types. This fixes that issue.

    We can now also remove the zext and trunc in the following case:
    (zext (trunc (promoted op)), i32)

    This means that we can no longer treat a value, that is only used by
    a sink, to be safe to promote.

    I've also added in some extra asserts and replaced a cast for a

    Differential Revision: (detail)
    by sam_parker
  25. [mips][msa] Fix broken test

    Test builtins-mips-msa-error.c wasn't reporting errors.
    This patch fixes the test, so further test cases can be added.

    Differential Revision: (detail)
    by abeserminji
  26. Fix breakage on FrontendTest by initializing new field on constructor (detail)
    by kadircet
  27. Exclude wasm target from Windows packaging due to PR39448 (detail)
    by hans
  28. [NFC][x86][AArch64] extract-bits.ll: add test with 'ashr'. (detail)
    by lebedevri
  29. [hwasan] Fix stack-uar.c after rCRT345110

    Set -fno-discard-value-names so that the frame description string contains the variable name. (detail)
    by maskray
  30. [DAGCombiner] Use tryFoldToZero to simplify some code and make it work correctly between LegalTypes and LegalOperations.

    The original code avoided creating a zero vector after type legalization, but if we're after type legalization the type we have is legal. The real hazard we need to avoid is creating a build vector after op legalization. tryFoldToZero takes care of checking for this. (detail)
    by ctopper
  31. [DAGCombiner] Remove an unused argument from tryFoldToZero. NFC (detail)
    by ctopper
  32. [AVR] Fix a backend bug that left extraneous operands after expansion

    This patch fixes a bug in the AVR FRMIDX expansion logic.

    The expansion would leave a leftover operand from the original FRMIDX,
    but now attached to a MOVWRdRr instruction. The MOVWRdRr instruction
    did not expect this operand and so LLVM rejected the machine

    This would trigger an assertion:

        Assertion failed: ((isImpReg || Op.isRegMask() || MCID->isVariadic() ||
                            OpNo < MCID->getNumOperands() || isMetaDataOp) &&
                            "Trying to add an operand to a machine instr that is already done!"),
        function addOperand, file llvm/lib/CodeGen/MachineInstr.cpp

    Tim fixed this so that now the FRMIDX is expanded correctly into
    a well-formed MOVWRdRr.

    Patch by Tim Neumann (detail)
    by dylanmckay
  33. [XRay] Update TSC math to handle wraparound

    Prior to this change, we can run into situations where the TSC we're
    getting when exiting a function is less than the TSC we got when
    entering it. This would sometimes cause the counter for cumulative call
    times overflow, which was erroneously also being stored as a signed
    64-bit integer.

    This change addresses both these issues while adding provisions for
    tracking CPU migrations. We do this because moving from one CPU to
    another doesn't guarantee that the timestamp counter for some
    architectures aren't guaranteed to be synchronised. For the moment, we
    leave the provisions there until we can update the data format to
    include the counting of CPU migrations we can catch.

    We update the necessary tests as well, ensuring that our expectations
    for the cycle accounting to be met in case of counter wraparound.

    Reviewers: mboerger

    Subscribers: llvm-commits

    Differential Revision: (detail)
    by dberris
  34. [X86] Custom type legalize v2i8/v2i16/v2i32 mul to use to pmuludq.

    v2i8/v2i16/v2i32 are promoted to v2i64. pmuludq takes a v2i64 input and produces a v2i64 output. Since we don't about the upper bits of the type legalized multiply we can use the pmuludq to produce the multiply result for the bits we do care about. (detail)
    by ctopper
  35. [AVR] Disallow the LDDWRdPtrQ instruction with Z as the destination

    This is an AVR-specific workaround for a limitation of the register
    allocator that only exposes itself on targets with high register
    contention like AVR, which only has three pointer registers.

    The three pointer registers are X, Y, and Z.
    In most nontrivial functions, Y is reserved for the frame pointer,
    as per the calling convention. This leaves X and Z. Some instructions,
    such as LPM ("load program memory"), are only defined for the Z
    register. Sometimes this just leaves X.

    When the backend generates a LDDWRdPtrQ instruction with Z as the
    destination pointer, it usually trips up the register allocator
    with this error message:

      LLVM ERROR: ran out of registers during register allocation

    This patch is a hacky workaround. We ban the LDDWRdPtrQ instruction
    from ever using the Z register as an operand. This gives the
    register allocator a bit more space to allocate, fixing the
    regalloc exhaustion error.

    Here is a description from the patch author Peter Nimmervoll

      As far as I understand the problem occurs when LDDWRdPtrQ uses
      the ptrdispregs register class as target register. This should work, but
      the allocator can't deal with this for some reason. So from my testing,
      it seams like (and I might be totally wrong on this) the allocator reserves
      the Z register for the ICALL instruction and then the register class
      ptrdispregs only has 1 register left and we can't use Y for source and
      destination. Removing the Z register from DREGS fixes the problem but
      removing Y register does not.

    More information about the bug can be found on the avr-rust issue
    tracker at

    A bug has raised to track the removal of this workaround and a proper
    fix; PR39553 at

    Patch by Peter Nimmervoll (detail)
    by dylanmckay
  36. [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

    One of the reasons why AnalyzerOptions is so chaotic is that options can be
    retrieved from the command line whenever and wherever. This allowed for some
    options to be forgotten for a looooooong time. Have you ever heard of
    "region-store-small-struct-limit"? In order to prevent this in the future, I'm
    proposing to restrict AnalyzerOptions' interface so that only checker options
    can be retrieved without special getters. I would like to make every option be
    accessible only through a getter, but checkers from plugins are a thing, so I'll
    have to figure something out for that.

    This also forces developers who'd like to add a new option to register it
    properly in the .def file.

    This is done by

    * making the third checker pointer parameter non-optional, and checked by an
      assert to be non-null.
    * I added new, but private non-checkers option initializers, meant only for
      internal use,
    * Renamed these methods accordingly (mind the consistent name for once with
      - getOptionAsString -> getCheckerStringOption,
      - getOptionAsInteger -> getCheckerIntegerOption
    * The 3 functions meant for initializing data members (with the not very
      descriptive getBooleanOption, getOptionAsString and getOptionAsUInt names)
      were renamed to be overloads of the getAndInitOption function name.
    * All options were in some way retrieved via getCheckerOption. I removed it, and
      moved the logic to getStringOption and getCheckerStringOption. This did cause
      some code duplication, but that's the only way I could do it, now that checker
      and non-checker options are separated. Note that the non-checker version
      inserts the new option to the ConfigTable with the default value, but the
      checker version only attempts to find already existing entries. This is how
      it always worked, but this is clunky and I might end reworking that too, so we
      can eventually get a ConfigTable that contains the entire configuration of the

    Differential Revision: (detail)
    by szelethus
  37. Ensure the correct order of evaluation in part 2. of PlistMacroExpansion

    Windows buildbots break with the previous commit '[analyzer][PlistMacroExpansion]
    Part 2.: Retrieving the macro name and primitive expansion'. This patch attempts
    to solve this issue. (detail)
    by szelethus
  38. Reland '[analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion' (detail)
    by szelethus
  39. [X86] Fix typo in test comment. NFC (detail)
    by ctopper
  40. [HotColdSplitting] Use TTI to inform outlining threshold

    Using TargetTransformInfo allows the splitting pass to factor in the
    code size cost of instructions as it decides whether or not outlining is

    This did not regress the overall amount of outlining seen on the handful
    of internal frameworks I tested.

    Thanks to Jun Bum Lim for suggesting this!

    Differential Revision: (detail)
    by Vedant Kumar
  41. [Driver] Use -Bstatic/dynamic for libc++ on Fuchsia

    -static relies on lld's behavior, but -Bstatic/dynamic is supported
    across all linkers.

    Differential Revision: (detail)
    by phosek
  42. [X86] Add nounwind to some tests to remove cfi directives from checks. NFC (detail)
    by ctopper
  43. [X86] Regenerate test checks to merge 32 and 64 bit. Remove stale check prefixes. NFC (detail)
    by ctopper
  44. Fix the test for partition_copy so it is not ridiculously slow. Also, detab. (detail)
    by marshall
  45. Add support of the next Ubuntu (Ubuntu 19.04 - Disco Dingo) (detail)
    by sylvestre
  46. [X86] Add vector shift by immediate to SimplifyDemandedBitsForTargetNode.

    Summary: This also enables some constant folding from KnownBits propagation. This helps on some cases vXi64 case in 32-bit mode where constant vectors appear as vXi32 and a bitcast. This can prevent getNode from constant folding sra/shl/srl.

    Reviewers: RKSimon, spatel

    Reviewed By: spatel

    Subscribers: llvm-commits

    Differential Revision: (detail)
    by ctopper
  47. Update our URLs in clang doc to use https (detail)
    by sylvestre
  48. Disable recursive interception for tzset in MSan

    This fixes sanitization of this library call on NetBSD.
    Extracted as a part of D42050. (detail)
    by kamil
  49. [ValueTracking] determine sign of 0.0 from select when matching min/max FP

    In PR39475:
    ..we may fail to recognize/simplify fabs() in some cases because we do not
    canonicalize fcmp with a -0.0 operand.

    Adding that canonicalization can cause regressions on min/max FP tests, so
    that's this patch: for the purpose of determining whether something is min/max,
    let the value returned by the select determine how we treat a 0.0 operand in the fcmp.

    This patch doesn't actually change the -0.0 to +0.0. It just changes the analysis, so
    we don't fail to recognize equivalent min/max patterns that only differ in the
    signbit of 0.0.

    Differential Revision: (detail)
    by spatel
  50. Revert '[analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion' (detail)
    by szelethus
  51. [analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion

    This patch adds a couple new functions to acquire the macro's name, and also
    expands it, although it doesn't expand the arguments, as seen from the test files

    Differential Revision: (detail)
    by szelethus
  52. [DAGCombiner] Remove 'else' after return. NFC

    This makes this code consistent with the nearly identical code in visitZERO_EXTEND. (detail)
    by ctopper
  53. [Driver] Always match resource dir in Fuchsia driver tests

    This makes the tests stricter by not only matching the runtime file
    name, but the entire path into the resource directory.

    Differential Revision: (detail)
    by phosek
  54. [SelectionDAG] Remove special methods for creating *_EXTEND_VECTOR_INREG nodes. Move asserts into getNode.

    These methods were just wrappers around getNode with additional asserts (identical and repeated 3 times). But getNode already has a switch that can be used to hold these asserts that allows them to be shared for all 3 opcodes. This also enables checking on the places that create these nodes without using the wrappers.

    The rest of the patch is just changing all callers to use getNode directly. (detail)
    by ctopper
  55. [coroutines] Fix fallthrough warning on try/catch

    The test case added in this diff would incorrectly warn that control
    flow may fall through without returning. Here's a standalone example:

    The same program, but using `return` instead of `co_return`, does not
    produce a warning:

    The issue was in how Clang analysis would structure its representation
    of the control-flow graph. Specifically, when constructing the CFG,
    `CFGBuilder::Visit` had special handling of a `ReturnStmt`, in which it
    would place object destructors in the same CFG block as a `return` statement,
    immediately after it. Doing so would allow the logic in
    `lib/Sema/AnalysisBasedWarning.cpp` `CheckFallThrough` to work properly in the
    program that used `return`, correctly determining that no "plain edges" preceded
    the exit block of the function.

    Because a `co_return` statement would not enjoy the same treatment when
    it was being built into the control-flow graph, object destructors
    would not be placed in the same CFG block as the `co_return`, thus
    resulting in a "plain edge" preceding the exit block of the function,
    and so the warning logic would be triggered.

    Add special casing for `co_return` to Clang analysis, thereby
    remedying the mistaken warning.

    Test Plan: `check-clang`

    Reviewers: GorNishanov, tks2103, rsmith

    Reviewed By: GorNishanov

    Subscribers: EricWF, lewissbaker, cfe-commits

    Differential Revision: (detail)
    by modocache
  56. [X86] Update comment I forgot to change in r346043. NFC (detail)
    by ctopper
  57. [NFC] Fix incorrect comment in std::list (detail)
    by Louis Dionne
  58. [ValueTracking] peek through 2-input shuffles in ComputeNumSignBits

    This patch gives the IR ComputeNumSignBits the same functionality as the
    DAG version (the code is derived from the existing code).

    This an extension of the single input shuffle analysis added with D53659.

    Differential Revision: (detail)
    by spatel
  59. Fix test on Windows.

    This test checks the entire output of a help option, the problem
    is that on Windows, the line break occurs in a different place
    causing the CHECK to fail because it is not expecting a line break. (detail)
    by dyung
  60. Add /Zc:DllexportInlines option to clang-cl

    This CL adds /Zc:DllexportInlines flag to clang-cl.
    When Zc:DllexportInlines- is specified, inline class member function is not exported if the function does not have local static variables.

    By not exporting inline function, code for those functions are not generated and that reduces both compile time and obj size. Also this flag does not import inline functions from dllimported class if the function does not have local static variables.

    On my 24C48T windows10 machine, build performance of chrome target in chromium repository is like below.
    These stats are come with 'target_cpu="x86" enable_nacl = false is_component_build=true dcheck_always_on=true` build config and applied

    Below stats were taken with this patch applied on

    | config                          | build time | speedup | build dir size |
    | with patch, PCH on, debug       | 1h10m0s    | x1.13   | 35.6GB         |
    | without patch, PCH on, debug    | 1h19m17s   |         | 49.0GB         |
    | with patch, PCH off, debug      | 1h15m45s   | x1.16   | 33.7GB         |
    | without patch, PCH off, debug   | 1h28m10s   |         | 52.3GB         |
    | with patch, PCH on, release     | 1h13m13s   | x1.22   | 26.2GB         |
    | without patch, PCH on, release  | 1h29m57s   |         | 37.5GB         |
    | with patch, PCH off, release    | 1h23m38s   | x1.32   | 23.7GB         |
    | without patch, PCH off, release | 1h50m50s   |         | 38.7GB         |

    This patch reduced obj size and the number of exported symbols largely, that improved link time too.
    e.g. link time stats of blink_core.dll become like below
    |                              | cold disk cache | warm disk cache |
    | with patch, PCH on, debug    | 71s             | 30s             |
    | without patch, PCH on, debug | 111s            | 48s             |

    This patch's implementation is based on Nico Weber's patch. I modified to support static local variable, added tests and took stats.


    Reviewers: hans, thakis, rnk, javed.absar

    Reviewed By: hans

    Subscribers: kristof.beyls, smeenai, dschuff, probinson, cfe-commits, eraman

    Differential Revision: (detail)
    by tikuta
  61. [debuginfo-tests] commands.getoutput -> subprocess.check_output

    We should also make Darwin Python3 happy after r346059
    The output has an extra newline but it is fine in this particular case. (detail)
    by maskray
  62. Revert r345562: "PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type"

    This exposes a (known) CodeGen bug: it can't cope with emitting lvalue
    expressions that denote non-odr-used but usable-in-constant-expression
    variables. See PR39528 for a testcase.

    Reverted for now until that issue can be fixed. (detail)
    by rsmith
  63. [Driver] Use -push-/-pop-state and -as-needed for libc++ on Fuchsia

    This avoids introducing unnecessary DT_NEEDED entries when using
    C++ driver for linking C code or C++ code that doesn't use C++
    standard library.

    Differential Revision: (detail)
    by phosek
  64. [compiler-rt] Support for passing through linker flags to libc++ build

    This may be needed when cross-compiling to certain platforms.

    Differential Revision: (detail)
    by phosek
  65. [codeview] Let the X86 backend tell us the VFRAME offset adjustment

    Use MachineFrameInfo's OffsetAdjustment field to pass this information
    from the target to CodeViewDebug.cpp. The X86 backend doesn't use it for
    any other purpose.

    This fixes PR38857 in the case where there is a non-aligned quantity of
    CSRs and a non-aligned quantity of locals. (detail)
    by rnk
  66. [DWARF v5] Verifier: Add checks for DW_FORM_strx* forms.

    Adding functionality to the DWARF verifier for DWARF v5 strx* forms which
    index into the string offsets table.

    Differential Revision: (detail)
    by wolfgangp
  67. Update debuginfo tests lit for r341135 (detail)
    by rnk
  68. [debuginfo-tests] Avoid "import commands" which was deprecated in Py3 (detail)
    by rnk
  69. [CMake][Fuchsia] Set -fuse-ld=lld explicitly for Linux runtimes

    We set lld as the default linker on non-Darwin platforms, but we still
    need to set -fuse-ld=lld explicitly in to support cross-compiling Linux
    runtimes on Darwin.

    Differential Revision: (detail)
    by phosek
  70. [LTO] Fix a crash caused by accessing an empty ValueInfo

    ModuleSummaryIndex::exportToDot crashes when linking the Linux kernel
    under ThinLTO using This is due to the exportToDot
    function trying to get the GUID of an empty ValueInfo. The root cause
    related to the fact that we attempt to get the GUID of an aliasee
    via its OriginalGUID recorded in the aliasee summary, and that is not
    always possible. Specifically, we cannot do this mapping when the value
    is internal linkage and there were other internal linkage symbols with
    the same name.

    There are 2 fixes for the problem included here.

    1) In all cases where we can currently print the dot file from the
    command line (which is only via save-temps), we have a valid AliaseeGUID
    in the AliasSummary. Use that when it is available, so that we can get
    the correct aliasee GUID whenever possible.

    2) However, if we were to invoke exportToDot from the debugger right
    after it is built during the initial analysis step (i.e. the per-module
    summary), we won't have the AliaseeGUID field populated. In that case,
    we have a fallback fix that will simply print "@"+GUID when we aren't
    able to get the GUID from the OriginalGUID. It simply checks if the VI
    is valid or not before attempting to get the name. Additionally, since
    getAliaseeGUID will assert that the AliaseeGUID is non-zero, guard the
    earlier fix #1 by a new function hasAliaseeGUID().

    Reviewers: pcc, tmroeder

    Subscribers: evgeny777, mehdi_amini, inglorion, dexonsmith, arphaman, llvm-commits

    Differential Revision: (detail)
    by tejohnson
  71. [clangd] don't buffer the input-mirror stream, it's used to diagnose crashes (detail)
    by sammccall
  72. [compiler-rt][Fuzzer] Fix the fuzzer test build

    This fixes the issue introduced in r345765 which changed the way in
    which the embedded libc++ is being built but omitted tests.

    Differential Revision: (detail)
    by phosek
  73. Workaround using new Clang with an old NDK.

    We're using an old NDK and a new Clang. New Clangs default to
    `-stdlib=libc++` for Android, but those libraries cannot be found by
    default with an old NDK. Use an explicit `-stdlib=libstdc++` in the
    cxx_mode_flags. (detail)
    by danalbert
  74. [X86] In LowerEXTEND_VECTOR_INREG, emit a vector shuffle instead of directly using X86ISD::UNPCKL

    The majority of the changes are because the rest of shuffle lowering/combining prefers to replace the undef input with the other operand. Using UNPCKL directly seemed to avoid this and just grabbed a randomish register for the undef which can create false dependencies. (detail)
    by ctopper
  75. Add an explicit -std=c++14 to this test.

    rdar://problem/45642490 (detail)
    by Adrian Prantl
  76. [WebAssembly] Parsing missing directives to produce valid .o

    The assembler was able to assemble and then dump back to .s, but
    was failing to parse certain directives necessary for valid .o
    - .type directives are now recognized to distinguish function symbols
      and others.
    - .size is now parsed to provide function size.
    - .globaltype (introduced in is now
      recognized to ensure symbols like __stack_pointer have a proper type
      set for both .s and .o output.

    Also added tests for the above.

    Reviewers: sbc100, dschuff

    Subscribers: jgravelle-google, aheejin, dexonsmith, kristina, llvm-commits, sunfish

    Differential Revision: (detail)
    by aardappel
  77. [COFF, ARM64] Implement InterlockedExchange*_* builtins

    Summary: Windows SDK needs these intrinsics to be proper builtins.  This is second in a series of patches to move intrinsic defintions out of intrin.h.

    Reviewers: rnk, mstorsjo, efriedma, TomTan

    Reviewed By: rnk, efriedma

    Subscribers: javed.absar, kristof.beyls, chrib, jfb, kristina, cfe-commits

    Differential Revision: (detail)
    by mgrang
  78. [X86] Don't emit *_extend_vector_inreg nodes when both the input and output types are legal with AVX1

    We already have custom lowering for the AVX case in LegalizeVectorOps. So its better to keep the regular extend op around as long as possible.

    I had to qualify one place in DAG combine that created illegal vector extending load operations. This change by itself had no effect on any tests which is why its included here.

    I've made a few cleanups to the custom lowering. The sign extend code no longer creates an identity shuffle with undef elements. The zero extend code now emits a zero_extend_vector_inreg instead of an unpckl with a zero vector.

    For the high half of the custom lowering of zero_extend/any_extend, we're now using an unpckh with a zero vector or undef. Previously we used used a pshufd to move the upper 64-bits to the lower 64-bits and then used a zero_extend_vector_inreg. I think the zero vector should require less execution resources and be smaller code size.

    Differential Revision: (detail)
    by ctopper
  79. Try to unbreak the build of sanitizers on !NetBSD

    Include the build of unpoison_passwd() and unpoison_group() for
    static void unpoison_passwd( (detail)
    by kamil
  80. Diagnose parameter names that shadow the names of inherited fields under -Wshadow-field.

    This addresses PR34120. Note, unlike GCC, we take into account the accessibility of the field when deciding whether to warn or not. (detail)
    by aaronballman
  81. [DWARF] Fix typo, .gnu_index -> .gdb_index (detail)
    by maskray
  82. Split getpwent and fgetgrent functions in interceptors

    NetBSD does not ship with fgetpwent_r() and fgetgrent_r().
    Split their interceptors from getpwent_r() and getgrent_r()
    and disable for this OS.

    Installation of supernumerary interceptors causes leaking of
    errors to dlsym(3)-like operations.

    No functional change for other OSes.

    Reviewers: vitalybuka, joerg

    Reviewed By: vitalybuka

    Subscribers: srhines, kubamracek, fedor.sergeev, llvm-commits, #sanitizers, mgorny

    Tags: #sanitizers

    Differential Revision: (detail)
    by kamil
  83. Removed dead builder/slave lldb-amd64-ninja-netbsd7. (detail)
    by gkistanova
  84. [AArch64] [Windows] Misc fixes for llvm-readobj -unwind.

    Use getImageBase() helper to compute the image base. Fix various
    offsets/addresses/masks so they're actually correct.

    This allows decoding unwind info from DLLs, and unwind info from object
    files containing multiple functions.

    Differential Revision: (detail)
    by efriedma
  85. [RISCV] Add some missing expansions for floating-point intrinsics

    A number of intrinsics, such as llvm.sin.f32, would result in a failure to
    select. This patch adds expansions for the relevant selection DAG nodes, as
    well as exhaustive testing for all f32 and f64 intrinsics.

    The codegen for FMA remains a TODO item, pending support for the various
    RISC-V FMA instruction variants.

    The llvm.minimum.f32.* and llvm.maximum.* tests are commented-out, pending
    upstream support for target-independent expansion, as discussed in

    Differential Revision:
    Patch by Luís Marques. (detail)
    by asb
  86. Attempt to fix 'logical operation on address of string constant'

    Caused a lot of warnings for Windows: (detail)
    by szelethus
  87. [X86][AVX512] Change mask ops on vpermi2var tests to not use zeroinitializer.

    This is necessary as I'm wanting to remove the 'Constant Pool' shuffle decoding from getTargetShuffleMask - but using getTargetShuffleMaskIndices allows the shuffle combiner to realize that these calls are really broadcasts.....

    As with a lot of the X86ISD::VPERMV3 code this causes some vperm2i/vperm2t shuffles to flip depending on optimal commutation. (detail)
    by rksimon
  88. [WebAssembly] Change indices types to unsined int (NFC)

    This changes int types to unsigned int in a few places: function indices
    and `wasm::Valtype` (which is unsigend int enum).  Currently these
    values cannot have negative values anyway, so this should not be a
    functional change for now.

    Reviewers: sbc100

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

    Differential Revision: (detail)
    by aheejin
  89. [PowerPC]Disable randomized address space on Linux ppc64le

    Recent versions of Ubuntu (17.04 and 18.04) on PowerPC have introduced changes
    to Address Space Layout Randomization (ASLR) that is causing 500+ sanitizer
    failures. This patch disables ASLR when running the sanitizers on PowerPC 64bit

    Differential Revision: (detail)
    by lei
  90. [WebAssembly] Fix bugs in rethrow depth counting and InstPrinter

    EH stack depth is incremented at `try` and decremented at `catch`. When
    there are more than two catch instructions for a try instruction, we
    shouldn't count non-first catches when calculating EH stack depths.

    This patch fixes two bugs:
    - CFGStackify: Exclude `catch_all` in the terminate catch pad when
      calculating EH pad stack, because when we have multiple catches for a
      try we should count only the first catch instruction when calculating
      EH pad stack.
    - InstPrinter: The initial intention was also to exclude non-first
      catches, but it didn't account nested try-catches, so it failed on
      this case:
    catch    <-- (1)
    In the example, when we are at the catch (1), the last seen EH
    instruction is not `try` but `end_try`, violating the wrong assumption.

    We don't need these after we switch to the second proposal because there
    is gonna be only one `catch` instruction. But anyway before then these
    bugfixes are necessary for keep trunk in working state.

    Reviewers: dschuff

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

    Differential Revision: (detail)
    by aheejin
  91. [analyzer] Fixup of the module build after

    Adds AnalyzerOptions.def to the list of textual headers. (detail)
    by George Karpenkov
  92. [DebugInfo][InstMerge] Fix -debugify for phi node created by -mldst-motion

    -mldst-motion creates a new phi node without any debug info. Use the merged debug location from the incoming stores to fix this.

    Fixes PR38177. The test case here is (somewhat) simplified from:

    struct S {
      int foo;
      void fn(int bar);
    void S::fn(int bar) {
      if (bar)
        foo = 1;
        foo = 0;

    Reviewers: dblaikie, gbedwell, aprantl, vsk

    Reviewed By: vsk

    Subscribers: vsk, JDevlieghere, llvm-commits

    Tags: #debug-info

    Differential Revision: (detail)
    by rupprecht
  93. ARMExpandPseudoInsts: Fix CMP_SWAP expansion adding a kill flag to a def (detail)
    by matze
  94. [ValueTracking] add test for non-canonical shuffle; NFC (detail)
    by spatel
  95. [COFF, ARM64] Change setjmp for AArch64 Windows to use Intrinsic.sponentry

    Summary: ARM64 setjmp expects sp on entry instead of framepointer.

    Patch by: Yin Ma (

    Reviewers: mgrang, eli.friedman, ssijaric, mstorsjo, rnk, compnerd

    Reviewed By: mgrang

    Subscribers: efriedma, javed.absar, kristof.beyls, chrib, cfe-commits

    Differential Revision: (detail)
    by mgrang
  96. Fix a few small issues in llvm-pdbutil

    Running "llvm-pdbutil dump -all" on linux (using the native PDB reader),
    over a few PDBs pulled from the Microsoft public symbol store uncovered
    a few small issues:

    - stripped PDBs might not have the strings stream (/names)
    - stripped PDBs might not have the "module info" stream

    Differential Revision: (detail)
    by lemo
  97. [SystemZ::TTI]  Improve cost handling of uint/sint to fp conversions.

    Let i8/i16 uint/sint to fp conversions cost 1 if operand is a load.

    Since the load already does the extension, there is no extra cost (previously
    returned 2).

    Review: Ulrich Weigand (detail)
    by jonpa
  98. Refactor the lit configuration files

    A year or so ago, I re-wrote most of the lit infrastructure in LLVM so
    that it wasn't so boilerplate-y. I added lots of common helper type
    stuff, simplifed usage patterns, and made the code more elegant and

    We migrated to this in LLVM, clang, and lld's lit files, but not in
    LLDBs. This started to bite me recently, as the 4 most recent times I
    tried to run the lit test suite in LLDB on a fresh checkout the first
    thing that would happen is that python would just start crashing with
    unhelpful backtraces and I would have to spend time investigating.

    You can reproduce this today by doing a fresh cmake generation, doing
    ninja lldb and then python bin/ -sv ~/lldb/lit/SymbolFile at
    which point you'll get a segfault that tells you nothing about what your
    problem is.

    I started trying to fix the issues with bandaids, but it became clear
    that the proper solution was to just bring in the work I did in the rest
    of the projects. The side benefit of this is that the lit configuration
    files become much cleaner and more understandable as a result.

    Differential Revision: (detail)
    by zturner
  99. [ProfileSummary] Add options to override hot and cold count thresholds.

    The hot and cold count thresholds are derived from the summary, but for
    debugging purposes it is convenient to provide the actual thresholds.

    Reviewers: davidxl

    Subscribers: llvm-commits

    Differential Revision: (detail)
    by eraman
  100. [CodeGen] Fix a crash when updating a designated initializer

    We need to handle the ConstantAggregateZero case here too.


    Differential revision: (detail)
    by epilk
  101. Change -fsanitize-address-poison-class-member-array-new-cookie to -fsanitize-address-poison-custom-array-cookie

    Handle it in the driver and propagate it to cc1

    Reviewers: rjmccall, kcc, rsmith

    Subscribers: cfe-commits

    Differential Revision: (detail)
    by filcab
  102. Fixed inclusion of M_PI fow MinGW-w64

    Patch by KOLANICH (detail)
    by sylvestre
  103. [SystemZ] Rework getInterleavedMemoryOpCost()

    Model this function more closely after the BasicTTIImpl version, with
    separate handling of loads and stores. For loads, the set of actually loaded
    vectors is checked.

    This makes it more readable and just slightly more accurate generally.

    Review: Ulrich Weigand (detail)
    by jonpa
  104. Remove the duplicated definition of size_t

    So hopefully windows won't complain. (detail)
    by szelethus
  105. [MachineSink][DebugInfo] Correctly sink DBG_VALUEs

    As reported in PR38952, postra-machine-sink relies on DBG_VALUE insns being
    adjacent to the def of the register that they reference. This is not always
    true, leading to register copies being sunk but not the associated DBG_VALUEs,
    which gives the debugger a bad variable location.

    This patch collects DBG_VALUEs as we walk through a BB looking for copies to
    sink, then passes them down to performSink. Compile-time impact should be

    Differential Revision: (detail)
    by jmorse
  106. [fix][clang-tidy] fix for r345961 that introduced a test failure on Windows builds

    r345961 introduced a path check in

    r345961 added a check line for a path that only handled / on unix
    machines and not \ on windows machines.

    This patch handles both cases.

    Patch by TWeaver.

    Differential Revision: (detail)
    by jonastoth
  107. Didn't -> didnt, because #errors complains about untermianted ' (detail)
    by szelethus
  108. [analyzer] Fix diagnostics/explicit-suppression.cpp

    *OI++ = *II++ is on line 670, not 668 (detail)
    by maskray
  109. [OPENMP][NVPTX]Use __kmpc_data_sharing_coalesced_push_stack function.

    Coalesced memory access requires use of the new function
    `__kmpc_data_sharing_coalesced_push_stack` instead of the
    `__kmpc_data_sharing_push_stack`. (detail)
    by abataev
  110. [analyzer] Put llvm.Conventions back in alpha

    Interestingly, this many year old (when I last looked I remember 2010ish)
    checker was committed without any tests, so I thought I'd implement them, but I
    was shocked to see how I barely managed to get it working. The code is severely
    outdated, I'm not even sure it has ever been used, so I'd propose to move it
    back into alpha, and possibly even remove it.

    Differential Revision: (detail)
    by szelethus
  111. [analyzer] New flag to print all -analyzer-config options

    A new -cc1 flag is avaible for the said purpose: -analyzer-config-help

    Differential Revision: (detail)
    by szelethus
  112. [ValueTracking] allow non-canonical shuffles when computing signbits

    This possibility is noted in D53987 for a different case,
    so we need to adjust the existing code. (detail)
    by spatel
  113. [NFC] Remove some extra characters from docs/LangRef.rst (detail)
    by mcinally
  114. [analyzer][NFC] Collect all -analyzer-config options in a .def file

    I'm in the process of refactoring AnalyzerOptions. The main motivation behind
    here is to emit warnings if an invalid -analyzer-config option is given from the
    command line, and be able to list them all.

    In this patch, I'm moving all analyzer options to a def file, and move 2 enums
    to global namespace.

    Differential Revision: (detail)
    by szelethus
  115. [analyzer][NFC] Fix some incorrect uses of -analyzer-config options

    I'm in the process of refactoring AnalyzerOptions. The main motivation behind
    here is to emit warnings if an invalid -analyzer-config option is given from
    the command line, and be able to list them all.

    In this patch, I found some flags that should've been used as checker options,
    or have absolutely no mention of in AnalyzerOptions, or are nonexistent.

    - NonLocalizedStringChecker now uses its "AggressiveReport" flag as a checker
    - lib/StaticAnalyzer/Frontend/ModelInjector.cpp now accesses the "model-path"
        option through a getter in AnalyzerOptions
    - -analyzer-config path-diagnostics-alternate=false is not a thing, I removed it,
    - lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp and
        lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h are weird, they actually
        only contain an option getter. I deleted them, and fixed RetainCountChecker
        to get it's "leak-diagnostics-reference-allocation" option as a checker option,
    - "region-store-small-struct-limit" has a proper getter now.

    Differential Revision: (detail)
    by szelethus
  116. [clang-tidy] Fixed code sample in a comment. NFC (detail)
    by alexfh
  117. [NFC] Refactor initialisation of Darwin malloc zone fields into separate function called `InitMallocZoneFields()` which is now called from `ReplaceSystemMalloc()`.

    The motivation here is to be able support initialisation of the
    malloc zone on other code paths.


    Reviewers: kubamracek, george.karpenkov

    Subscribers: llvm-commits, #sanitizers

    Differential Revision: (detail)
    by delcypher
  118. [OPENMP]Change the mapping type for lambda captures.

    The previously used combination `PTR_AND_OBJ | PRIVATE` could be used for mapping of some data in Fortran. Changed it to `PTR_AND_OBJ | LITERAL`. (detail)
    by abataev
  119. [clang-tidy] .reset(new X) -> make_unique<X>() in a comment. NFC (detail)
    by alexfh
  120. [OPENMP][NVPTX]Improve emission of the globalized variables for
    target/teams/distribute regions.

    Target/teams/distribute regions exist for all the time the kernel is
    executed. Thus, if the variable is declared in their context and then
    escape it, we can allocate global memory statically instead of
    allocating it dynamically.
    Patch captures all the globalized variables in target/teams/distribute
    contexts, merges them into the records, one per each target region.
    Those records are then joined into the union, one per compilation unit
    (to save the global memory). Those units are organized into
    2 x dimensional arrays, where the first dimension is
    the number of blocks per SM and the second one is the number of SMs.
    Runtime functions manage this global memory space between the executing
    teams. (detail)
    by abataev
  121. [Hexagon] Do not reduce load size for globals in small-data

    Small-data (i.e. GP-relative) loads and stores allow 16-bit scaled
    offset. For a load of a value of type T, the small-data area is
    equivalent to an array "T sdata[65536]". This implies that objects
    of smaller sizes need to be closer to the beginning of sdata,
    while larger objects may be farther away, or otherwise the offset
    may be insufficient to reach it. Similarly, an object of a larger
    size should not be accessed via a load of a smaller size. (detail)
    by kparzysz
  122. [clangd] Add fallbackFlags initialization extension.

    This allows customizing the flags used when no compile database is
    available. It addresses some uses of the old extraFlags extension.

    Reviewers: ilya-biryukov

    Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Differential Revision: (detail)
    by sammccall
  123. [DEBUGINFO, NVPTX]DO not emit ',debug' option if no debug info or only debug directives are requested.

    If the output of debug directives only is requested, we should drop
    emission of ',debug' option from the target directive. Required for
    supporting of nvprof profiler.

    Reviewers: probinson, echristo, dblaikie

    Subscribers: Hahnfeld, jholewinski, llvm-commits, JDevlieghere, aprantl

    Differential Revision: (detail)
    by abataev
  124. Reapply Logging: make os_log buffer size an integer constant expression.

    The size of an os_log buffer is known at any stage of compilation, so making it
    a constant expression means that the common idiom of declaring a buffer for it
    won't result in a VLA. That allows the compiler to skip saving and restoring
    the stack pointer around such buffers.

    This also moves the OSLog and other FormatString helpers from
    libclangAnalysis to libclangAST to avoid a circular dependency. (detail)
    by Tim Northover
  125. [clangd] Make in-memory CDB always available as an overlay, refactor.

    The new implementation is a GlobalCompilationDatabase that overlays a base.
    Normally this is the directory-based CDB.
    To preserve the behavior of compile_args_from=LSP, the base may be null.

    The OverlayCDB is always present, and so the extensions to populate it
    are always supported.

    It also allows overriding the flags of the fallback command. This is
    just unit-tested for now, but the plan is to expose this as an extension
    on the initialize message. This addresses use cases like

    Reviewers: ilya-biryukov

    Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Differential Revision: (detail)
    by sammccall
  126. [clangd] Remove didOpen extraFlags extension.

    This was added in D34947 to support YCM, but YCM actually provides *all* args,
    and this was never actually used.
    Meanwhile, we grew another extension that allows specifying all args.

    I did find one user of this extension:
    I'll reach out, there are multiple good alternatives:
    - compile_commands.txt can serve the same purpose as .clang_complete there
    - we can add an extension to support setting the fallback command

    Reviewers: ilya-biryukov

    Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Differential Revision: (detail)
    by sammccall
  127. [clangd] Only log ignored diagnostics with -log=verbose.

    Reviewers: ilya-biryukov

    Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Differential Revision: (detail)
    by sammccall
  128. Add support for 'atomic_default_mem_order' clause on 'requires' directive. Also renamed test files relating to 'requires'. Differntial review: (detail)
    by plyster
  129. Allow null-valued function operands in getCalledFunction()

    Change the dynamic cast in CallBase::getCalledFunction() to allow
    null-valued function operands.

    This patch fixes a crash that occurred when a funtion operand of a
    call instruction was dropped, and later on a metadata-carrying
    instruction was printed out. When allocating the metadata slot numbers,
    getCalledFunction() would be invoked on the call with the dropped
    operand, resulting in a failed non-null assertion in isa<>.

    This fixes PR38924, in which a printout in DBCE crashed due to this.

    This aligns getCalledFunction() with getCalledValue(), as the latter
    allows the operand to be null.

    Reviewers: vsk, dexonsmith, hfinkel

    Reviewed By: dexonsmith

    Subscribers: hfinkel, llvm-commits

    Differential Revision: (detail)
    by dstenb
  130. [analyzer][CTU] Correctly signal in the function index generation tool if there was an error

    Differential Revision: (detail)
    by xazax
  131. [DAGCombiner] Remove reduceBuildVecConvertToConvertBuildVec and rely on the vectorizers instead (PR35732)

    reduceBuildVecConvertToConvertBuildVec vectorizes int2float in the DAGCombiner, which means that even if the LV/SLP has decided to keep scalar code using the cost models, this will override this.

    While there are cases where vectorization is necessary in the DAG (mainly due to legalization artefacts), I don't think this is the case here, we should assume that the vectorizers know what they are doing.

    Differential Revision: (detail)
    by rksimon
  132. Revert "Fix regression in behavior of clang -x c++-header -fmodule-name=XXX"

    This reverts commit r345803 and r345915 (a follow-up fix to r345803).

    Reason: r345803 blocks our internal integrate because of the new
    warnings showing up in too many places. The fix is actually correct,
    we will reland it after figuring out how to integrate properly. (detail)
    by ibiryukov
  133. [AMDGPU] UBSan bug fix for r345710

    UBSan detected an error in our ISelLowering that is exposed only when
    you have a dmask == 0x1. Fix this by adding in an explicit check to
    ensure we don't do the UBSan detected shl << 32. (detail)
    by sheredom
  134. [clang-tidy] Get ClangTidyContext out of the business of storing diagnostics. NFC

    Currently ClangTidyContext::diag() sends the diagnostics to a
    DiagnosticsEngine, which probably delegates to a ClangTidyDiagnosticsConsumer,
    which is supposed to go back and populate ClangTidyContext::Errors.

    After this patch, the diagnostics are stored in the ClangTidyDiagnosticsConsumer
    itself and can be retrieved from there.

    - the round-trip from context -> engine -> consumer -> context is confusing
       and makes it harder to establish layering between these things.
    - context does too many things, and makes it hard to use clang-tidy as a library
    - everyone who actually wants the diagnostics has access to the ClangTidyDiagnosticsConsumer

    The most natural implementation (ClangTidyDiagnosticsConsumer::take()
    finalizes diagnostics) causes a test failure: clang-tidy-run-with-database.cpp
    asserts that clang-tidy exits successfully when trying to process a file
    that doesn't exist.
    In clang-tidy today, this happens because finish() is never called, so the
    diagnostic is never flushed. This looks like a bug to me.
    For now, this patch carefully preserves that behavior, but I'll ping the
    authors to see whether it's deliberate and worth preserving.

    Reviewers: hokein

    Subscribers: xazax.hun, cfe-commits, alexfh

    Differential Revision: (detail)
    by sammccall
  135. Fix a typo in a function name

    Declaration and definition have slightly different names with a typo in the
    declaration, which leads to a link error.
    See the following bug report for more details: (detail)
    by alexdenisov
  136. [LV] Avoid vectorizing loops under opt for size that involve SCEV checks

    Fix PR39417, PR39497

    The loop vectorizer may generate runtime SCEV checks for overflow and stride==1
    cases, leading to execution of original scalar loop. The latter is forbidden
    when optimizing for size. An assert introduced in r344743 triggered the above
    PR's showing it does happen. This patch fixes this behavior by preventing
    vectorization in such cases.

    Differential Revision: (detail)
    by ayalz
  137. [XRay] Fix tests with updated fdr-dump

    Follow-up to D54022. (detail)
    by dberris
  138. [XRay] Update delta computations in runtime

    Fix some issues discovered from mostly manual inspection of outputs from
    the `llvm-xray fdr-dump` tool.

    It turns out we haven't been writing the deltas properly, and have been
    writing down zeros for deltas of some records. This change fixes this
    oversight born by the recent refactoring.

    Reviewers: mboerger

    Subscribers: llvm-commits, hiraditya

    Differential Revision: (detail)
    by dberris
  139. [clangd] Really fix clang -Wimplicit-fallthrough

    The intention was to fall through to Function case in LLVM_ENABLE_ASSERTIONS=Off builds.

    Use #ifndef NDEBUG to fix -Wimplicit-fallthrough (detail)
    by maskray
  140. [clangd] Fix clang -Wimplicit-fallthrough (detail)
    by maskray
  141. Fix -Wimplicit-fallthrough warning in LLVM_ENABLE_ASSERTIONS=Off builds (detail)
    by maskray
  142. Fix -Wimplicit-fallthrough warning in LLVM_ENABLE_ASSERTIONS=Off builds (detail)
    by maskray
  143. AMDGPU: Fix assertion with bitcast from i64 constant to v4i16 (detail)
    by arsenm
  144. test/DebugInfo: Convert some tests to MIR

    These tests are meant to test dwarf emission (or prolog/epilogue
    generation) so we can convert them to .mir and only run the relevant
    part of the pipeline.
    This way they become independent of changes in earlier passes such as my
    planned changes to RegAllocFast. (detail)
    by matze
  145. LLVMTargetMachine/TargetPassConfig: Simplify handling of start/stop options; NFC

    - Make some TargetPassConfig methods that just check whether options have
      been set static.
    - Shuffle code in LLVMTargetMachine around so addPassesToGenerateCode
      only deals with TargetPassConfig now (but not with MCContext or the
      creation of MachineModuleInfo) (detail)
    by matze
  146. [WebAssembly] Added a .globaltype directive to .s output.

    Assembly output can use globals like __stack_pointer implicitly,
    but has no way of indicating the type of such a global, which makes
    it hard for tools processing it (such as the MC Assembler) to
    reconstruct this information.

    The improved assembler directives parsing (in progress in will make use of this information.

    Also deleted code for the .import_global directive which was unused.

    New test case in userstack.ll

    Reviewers: dschuff, sbc100

    Subscribers: jgravelle-google, aheejin, sunfish, llvm-commits

    Differential Revision: (detail)
    by aardappel
  147. [WebAssembly] General vector shift lowering

    Summary: Adds support for lowering non-splat shifts.

    Reviewers: aheejin, dschuff

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

    Differential Revision: (detail)
    by tlively
  148. When building a header module, treat inputs as headers rather than
    source files.

    This suppresses certain warnings (eg, '#include_next in main source
    file'). (detail)
    by rsmith
  149. [NFC][LICM] Factor out instruction erasing logic

    This patch factors out a function that makes all required updates
    whenever an instruction gets erased.

    Differential Revision:
    Reviewed By: apilipenko (detail)
    by mkazantsev
  150. [WebAssembly] Expand inserts and extracts with variable indices

    Reviewers: aheejin, dschuff

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

    Differential Revision: (detail)
    by tlively
  151. [AliasSetTracker] Misc cleanup (NFCI)

    Summary: Remove two redundant checks, add one in the unit test. Remove an unused method. Fix computation of TotalMayAliasSetSize. (detail)
    by asbirlea
  152. [gold-plugin] Fix a bunch of build warnings

    Phabricator: (detail)
    by mgrang
  153. [COFF, ARM64] Implement Intrinsic.sponentry for AArch64

    Summary: This patch adds Intrinsic.sponentry. This intrinsic is required to correctly support setjmp for AArch64 Windows platform.

    Patch by: Yin Ma (

    Reviewers: mgrang, ssijaric, eli.friedman, TomTan, mstorsjo, rnk, compnerd, efriedma

    Reviewed By: efriedma

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

    Differential Revision: (detail)
    by mgrang
  154. [DAGCombiner] Make the isTruncateOf call from visitZERO_EXTEND work for vectors. Remove FIXME.

    I'm having trouble creating a test case for the ISD::TRUNCATE part of this that shows any codegen differences. But I was able to test the setcc path which is what the test changes here cover. (detail)
    by ctopper
  155. [X86] Add test cases for adding vector support to isTruncateOf in DAGCombiner::visitZERO_EXTEND (detail)
    by ctopper
  156. [MachineOutliner][NFC] Remember when you map something illegal across MBBs

    Instruction mapping in the outliner uses "illegal numbers" to signify that
    something can't ever be part of an outlining candidate. This means that the
    number is unique and can't be part of any repeated substring.

    Because each of these is unique, we can use a single unique number to represent
    a range of things we can't outline.

    The outliner tries to leverage this using a flag which is set in an MBB when
    the previous instruction we tried to map was "illegal". This patch improves
    that logic to work across MBBs. As a bonus, this also simplifies the mapping
    logic somewhat.

    This also updates the machine-outliner-remarks test, which was impacted by the
    order of Candidates on an OutlinedFunction changing. This order isn't
    guaranteed, so I added a FIXME to fix that in a follow-up. The order of
    Candidates on an OutlinedFunction isn't important, so this still is NFC. (detail)
    by paquette
  157. [XRay] Fix TSC and atomic custom/typed event accounting

    This is a follow-on change to D53858 which turns out to have had a TSC
    accounting bug when writing out function exit records in FDR mode.

    This change adds a number of tests to ensure that:

    - We are handling the delta between the exit TSC and the last TSC we've

    - We are writing the custom event and typed event records as a single
      update to the buffer extents.

    - We are able to catch boundary conditions when loading FDR logs.

    We introduce a TSC matcher to the test helpers, which we use in the
    testing/verification of the TSC accounting change.

    Reviewers: mboerger

    Subscribers: mgorny, hiraditya, jfb, llvm-commits

    Differential Revision: (detail)
    by dberris
  158. [IR] remove fake binop query for fneg

    We want to remove this fneg API because it would silently fail
    if we add an actual fneg instruction to IR (as proposed in
    D53877 ).

    We have a newer 'match' API that makes checking for
    these patterns simpler. It also works with vectors
    that may include undef elements in constants.

    If any out-of-tree users need updating, they can model
    their code changes on this commit: (detail)
    by spatel
  159. [CodeGen] Fix assertion on referencing constexpr Obj-C object with ARC.

    Failed assertion is
    > Assertion failed: ((ND->isUsed(false) || !isa<VarDecl>(ND) || !E->getLocation().isValid()) && "Should not use decl without marking it used!"), function EmitDeclRefLValue, file llvm-project/clang/lib/CodeGen/CGExpr.cpp, line 2437.

    `EmitDeclRefLValue` mentions
    > // A DeclRefExpr for a reference initialized by a constant expression can
    > // appear without being odr-used. Directly emit the constant initializer.

    The fix is to use the similar approach for non-references as for references. It
    is achieved by trying to emit a constant before we attempt to load non-odr-used
    variable as LValue.


    Reviewers: ahatanak, rjmccall

    Reviewed By: rjmccall

    Subscribers: dexonsmith, erik.pilkington, cfe-commits

    Differential Revision: (detail)
    by vsapsai
  160. [AMDGPU] Handle the idot8 pattern generated by FE.

    Summary: Different variants of idot8 codegen dag patterns are not generated by llvm-tablegen due to a huge
             increase in the compile time. Support the pattern that clang FE generates after reordering the
             additions in integer-dot8 source language pattern.

    Author: FarhanaAleen

    Reviewed By: arsenm

    Differential Revision: (detail)
    by faaleen
  161. Fix test assumption that Linux implies glibc.

    This fixes an regression when using bionic introduced in r345173.

    I need to follow up and figure out what exactly is implied by
    TEST_HAS_C11_FEATURES and see what the correct configuration is for
    bionic (new versions should have everything the tests care about,
    versions that predate C11 certainly don't), but this gets the tests
    back to the old behavior.

    Reviewers: EricWF

    Reviewed By: EricWF

    Subscribers: mclow.lists, christof, ldionne, libcxx-commits, cfe-commits

    Differential Revision: (detail)
    by danalbert
  162. [CodeGen] Move `emitConstant` from ScalarExprEmitter to CodeGenFunction. NFC.

    The goal is to use `emitConstant` in more places. Didn't move
    `ComplexExprEmitter::emitConstant` because it returns a different type.

    Reviewers: rjmccall, ahatanak

    Reviewed By: rjmccall

    Subscribers: dexonsmith, erik.pilkington, cfe-commits

    Differential Revision: (detail)
    by vsapsai
  163. [llvm-objcopy/strip] [NFC] Clean up tablegen opts (clang-format + reorganizing things). (detail)
    by rupprecht
  164. Silence -Wimplicit-fallthrough in gold plugin

    Fatal errors are likely fatal, but in case they aren't, return instead
    of printing a second warning. (detail)
    by rnk
  165. Revert "Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using unsigned division by 2 when possible."

    This reverts r345525. I'm reverting because that patch apparently caused
    a regression on certain platforms (see
    Since we don't fully understand the reasons for the regression, I'm
    reverting until we can provide a fix we understand. (detail)
    by Louis Dionne
  166. [COFF, ARM64] Implement llvm.addressofreturnaddress intrinsic

    Reviewers: rnk, mstorsjo, efriedma, TomTan

    Reviewed By: efriedma

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

    Differential Revision: (detail)
    by mgrang
  167. [CMake][Fuchsia] Don't restrict Linux runtimes to UNIX

    This allows building Linux runtimes on any platform if the correct
    sysroot is provided via CMake option.

    Differential Revision: (detail)
    by phosek
  168. [WebAssembly] Fix signature parsing for 'try' in AsmParser

    Like `block` or `loop`, `try` can take an optional signature which can
    be omitted. This patch allows `try`'s signature to be omitted. Also
    added some tests for EH instructions.

    Reviewers: aardappel

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

    Differential Revision: (detail)
    by aheejin
  169. Enable -Wimplicit-fallthrough for clang as well as GCC

    All instances of this warning should already be fixed across all LLVM
    subprojects, at least on Linux. (detail)
    by rnk
  170. [Hexagon] Remove unintended fallthrough from MC duplex code

    I added these annotations in r345878 because I wasn't sure if the
    fallthrough was intended. Krzysztof Parzyszek confirmed that they should
    be breaks, so that's what this patch does.

    Reviewers: kparzysz

    Differential Revision: (detail)
    by rnk
  171. Fix clang -Wimplicit-fallthrough warnings across llvm, NFC

    This patch should not introduce any behavior changes. It consists of
    mostly one of two changes:
    1. Replacing fall through comments with the LLVM_FALLTHROUGH macro
    2. Inserting 'break' before falling through into a case block consisting
       of only 'break'.

    We were already using this warning with GCC, but its warning behaves
    slightly differently. In this patch, the following differences are
    1. GCC recognizes comments that say "fall through" as annotations, clang
    2. GCC doesn't warn on "case N: foo(); default: break;", clang does
    3. GCC doesn't warn when the case contains a switch, but falls through
       the outer case.

    I will enable the warning separately in a follow-up patch so that it can
    be cleanly reverted if necessary.

    Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu

    Differential Revision: (detail)
    by rnk
  172. [LoopInterchange] Fix unused variables in release build (detail)
    by fhahn
  173. [WebAssembly] Fixup `main` signature by default

    Differential Revision: (detail)
    by sbc
  174. [codeview] Add breaks to fix -Wimplicit-fallthrough

    This is a minor bug fix. Previously, if you tried to encode the RSP
    register on the x86 platform, that might have succeeded and been encoded
    incorrectly. However, no existing producer or consumer passes the x86_64
    registers when targeting x86_32. (detail)
    by rnk
  175. Annotate possibly unintended fallthroughs in Hexagon MC code, NFC

    Clang's -Wimplicit-fallthrough check fires on these switch cases. GCC
    does not warn when a case body that ends in a switch falls through to a
    case label of an outer switch.

    It's not clear if these fall throughs are truly intended.  The Hexagon
    tests pass regardless of whether these case blocks fall through or

    For now, I have applied the intended fallthrough annotation macro with a
    FIXME comment to unblock enabling the warning. I will send a follow-up
    patch that converts them to breaks to the Hexagon maintainers. (detail)
    by rnk
  176. [LoopInterchange] Remove support for inner-only reductions.

    Inner-loop only reductions require additional checks to make sure they
    form a load-phi-store cycle across inner and outer loop. Otherwise the
    reduction value is not properly preserved. This patch disables
    interchanging such loops for now, as it causes miscompiles in some
    cases and it seems to apply only for a tiny amount of loops. Across the
    test-suite, SPEC2000 and SPEC2006, 61 instead of 62 loops are
    interchange with inner loop reduction support disabled. With
    -loop-interchange-threshold=-1000, 3256 instead of 3267.

    See the discussion and history of D53027 for an outline of how such legality
    checks could look like.

    Reviewers: efriedma, mcrosier, davide

    Reviewed By: efriedma

    Differential Revision: (detail)
    by fhahn
  177. Remove unnecessary fallthrough annotation after unreachable

    Clang's -Wimplicit-fallthrough implementation warns on this. I built
    clang with GCC 7.3 in +asserts and -asserts mode, and GCC doesn't warn
    on this in either configuration. I think it is unnecessary. I separated
    it from the large mechanical patch ( in
    case I am wrong and it has to be reverted. (detail)
    by rnk
  178. [GlobalISel] Fix a bug in LegalizeRuleSet::clampMaxNumElements

    This function was causing a crash when `MaxElements == 1` because
    it was trying to create a single element vector type.

    Reviewers: dsanders, aemerson, aditya_nandakumar

    Reviewed By: dsanders

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

    Differential Revision: (detail)
    by volkan
  179. Output "rule" information in SARIF exports.

    SARIF allows you to export descriptions about rules that are present in the SARIF log. Expose the help text table generated into as the rule's "full description" and export all of the rules present in the analysis output. This information is useful for analysis result viewers like CodeSonar. (detail)
    by aaronballman
  180. Add LLVM_FALLTHROUGH annotation after switch

    This silences a -Wimplicit-fallthrough warning from clang. GCC does not
    appear to warn when the case body ends in a switch.

    This is a somewhat surprising but intended fallthrough that I pulled out
    from my mechanical patch. The code intends to handle 'Yi' and related
    constraints as the 'x' constraint. (detail)
    by rnk
  181. Revert "[COFF, ARM64] Change setjmp for AArch64 Windows to use Intrinsic.sponentry"

    This reverts commit 619111f5ccf349b635e4987ec02d15777c571495. (detail)
    by mgrang
  182. Revert "Reapply Logging: make os_log buffer size an integer constant expression."

    Still more dependency hell. (detail)
    by Tim Northover
  183. Use C++11 fallthrough attribute syntax when available and add a break

    This silences the two -Wimplicit-fallthrough warnings clang finds in
    ItaniumDemangle.h in libc++abi.

    Clang does not have a GNU attribute spelling for this attribute, so this
    is necessary.

    I will commit the same change to the LLVM demangler soon.

    Reviewers: EricWF, ldionne

    Subscribers: christof, erik.pilkington, cfe-commits

    Differential Revision: (detail)
    by rnk
  184. [LegalizeDAG] Add generic vector CTPOP expansion (PR32655)

    This patch adds support for expanding vector CTPOP instructions and removes the x86 'bitmath' lowering which replicates the same expansion.

    Differential Revision: (detail)
    by rksimon
  185. [Hexagon] Fix MO_JumpTable const extender conversion

    Previously this case fell through to unreachable, so it is clearly not
    covered by any test case in LLVM. It may be dynamically unreachable, in
    fact. However, if it were to run, this is what it would logically do.
    The assert suggests that the intended behavior was not to allow folding
    offsets from jump table indices, which makes sense. (detail)
    by rnk
  186. Reapply Logging: make os_log buffer size an integer constant expression.

    The size of an os_log buffer is known at any stage of compilation, so making it
    a constant expression means that the common idiom of declaring a buffer for it
    won't result in a VLA. That allows the compiler to skip saving and restoring
    the stack pointer around such buffers.

    This also moves the OSLog helpers from libclangAnalysis to libclangAST
    to avoid a circular dependency. (detail)
    by Tim Northover
  187. [llvm-mca] Add extra counters for move elimination in view RegisterFileStatistics.

    This patch teaches view RegisterFileStatistics how to report events for
    optimizable register moves.

    For each processor register file, view RegisterFileStatistics reports the
    following extra information:
    - Number of optimizable register moves
    - Number of register moves eliminated
    - Number of zero moves (i.e. register moves that propagate a zero)
    - Max Number of moves eliminated per cycle.

    Differential Revision: (detail)
    by adibiagio
  188. [AArch64] Fix unintended fallthrough and strengthen cast

    This was added in r330630. GCC's -Wimplicit-fallthrough seems to not
    fire when the previous case contains a switch itself.

    This fallthrough was bening because the helper function implementing the
    case used dyn_cast to re-check the type of the node in question. After
    fixing the fallthrough, we can strengthen the cast. (detail)
    by rnk
  189. Revert "[COFF, ARM64] Implement Intrinsic.sponentry for AArch64"

    This reverts commit 585b6667b4712e3c7f32401e929855b3313b4ff2. (detail)
    by mgrang
  190. Replace two fallthrough annotations after covered switch with unreachable

    Both preceding switches handle all possible enumerators, so the
    fallthrough is actually unreachable. This strengthens that to an

    The first instance had a comment from 2010 indicating that fallthrough
    was possible, but that was back when we had a unary operator for
    offsetof. Now it is its own expression kind, so the annotation was
    stale. (detail)
    by rnk
  191. [llvm-strip] Support --keep and --strip-all-gnu from llvm-objcopy

    Summary: Add --keep and --strip-all-gnu from llvm-objcopy into llvm-strip.

    Reviewers: jakehehrlich, jhenderson, alexshap

    Reviewed By: jhenderson, alexshap

    Subscribers: llvm-commits

    Differential Revision: (detail)
    by rupprecht
  192. [llvm-objcopy] Support --{enable,disable}-deterministic-archives

    Summary: ar and objcopy/strip all support configuring whether archives are written deterministically (timestamps/UIDs/GIDs/etc zero'd). This has been ported to llvm-ar (the U/D modifiers) but not yet to llvm-objcopy/strip.

    Reviewers: jakehehrlich, jhenderson, alexshap

    Reviewed By: jhenderson

    Subscribers: ruiu, mgrang, llvm-commits

    Differential Revision: (detail)
    by rupprecht
  193. Fix the issue that not recognizing single acronym with prefix as ObjC property name.

    Summary: This will make clang-tidy accept property names like xyz_URL (URL is a common acronym).

    Reviewers: benhamilton, hokein

    Reviewed By: benhamilton

    Subscribers: jfb, cfe-commits

    Differential Revision: (detail)
    by wizard
  194. [llvm-objcopy] Don't apply --localize flags to common symbols

    --localize-symbol and --localize-hidden will currently localize common symbols. GNU objcopy will not localize these symbols even when explicitly requested, which seems reasonable; common symbols should always be global so they can be merged during linking.

    See PR39461

    Reviewers: jakehehrlich, jhenderson, alexshap, MaskRay, espindola

    Reviewed By: jakehehrlich, jhenderson, alexshap, MaskRay

    Subscribers: emaste, arichardson, alexshap, MaskRay, llvm-commits

    Differential Revision: (detail)
    by rupprecht
  195. [llvm-objcopy] For multiclass Eq, associate help text with --name= , not with --name

    % llvm-objcopy -help
    --weaken-symbol=symbol  Mark <symbol> as weak
    --weaken-symbol symbol  Mark <symbol> as weak

    % llvm-objcopy -help
    --weaken-symbol=symbol  Mark <symbol> as weak

    Reviewers: jhenderson, rupprecht, alexshap, jakehehrlich

    Reviewed By: jhenderson

    Subscribers: llvm-commits, kristina

    Differential Revision: (detail)
    by maskray
  196. [InstCombine] add test for ComputeNumSignBits on 2-input shuffle; NFC (detail)
    by spatel
  197. Fix whitespace in test/Assembler/fast-math-flags.ll

    Differential Revision: (detail)
    by mcinally
  198. [ARM] Attempt to fix ppc64be buildbot (detail)
    by sam_parker
  199. [NativePDB] Get LLDB types from PDB function types.

    This adds basic support for getting function signature types
    into LLDB's type system, including into clang's AST.  There are
    a few edge cases which are not correctly handled, mostly dealing
    with nested classes, but this isn't specific to functions and
    apply equally to variable types.  Note that no attempt has been
    made yet to deal with member function types, which will happen
    in subsequent patches.

    Differential Revision: (detail)
    by zturner
  200. [Diagnostics] Implement -Wsizeof-pointer-div

    void test(int *arr) {
        int arr_len = sizeof(arr) / sizeof(*arr);  // warn, incorrect way to compute number of array elements

    Enabled under -Wall (same behaviour as GCC)

    Reviewers: rsmith, MTC, aaron.ballman

    Reviewed By: aaron.ballman

    Subscribers: MTC, thakis, jfb, cfe-commits

    Differential Revision: (detail)
    by xbolva00
  201. Revert "Logging: make os_log buffer size an integer constant expression.

    This also reverts a couple of follow-up commits trying to fix the
    dependency issues. Latest revision added a cyclic dependency that can't
    just be patched up in 5 minutes. (detail)
    by Tim Northover
  202. [llvm-objcopy] Use proper cases

    Reviewers: jhenderson, alexshap, jakehehrlich, espindola, rupprecht

    Reviewed By: jhenderson, rupprecht

    Subscribers: emaste, arichardson, rupprecht, llvm-commits

    Differential Revision: (detail)
    by maskray
  203. [clang] Improve ctor initializer completions.

    Instead of providing generic "args" for member and base class
    initializers, tries to fetch relevant constructors and show their signatures.

    Reviewers: ilya-biryukov

    Reviewed By: ilya-biryukov

    Subscribers: ZaMaZaN4iK, eraman, arphaman, cfe-commits

    Differential Revision: (detail)
    by kadircet
  204. [DAGCombiner] make sure we have a whole-number extract before trying to narrow a vector op (PR39511)

    The test causes a crash because we were trying to extract v4f32 to v3f32, and the
    narrowing factor was then 4/3 = 1 producing a bogus narrow type.

    This should fix: (detail)
    by spatel
  205. [MC] Implement EmitRawText in MCNullStreamer

    This adds dummy implementation of `EmitRawText` in `MCNullStreamer`.

    This fixes the behavior of `AsmPrinter` with `MCNullStreamer` on targets
    on which no integrated assembler is used. An attempt to emit inline asm
    on such a target would previously lead to a crash, since `AsmPrinter` does not
    check for `hasRawTextSupport` in `EmitInlineAsm` and calls `EmitRawText`
    anyway if integrated assembler is disabled (the behavior has changed
    in D2686).

    Error message printed by MCStreamer:

    > EmitRawText called on an MCStreamer that doesn't support it, something
    > must not be fully mc'ized

    Patch by Eugene Sharygin

    Reviewers: dsanders, echristo

    Reviewed By: dsanders

    Subscribers: eraman, llvm-commits

    Differential Revision: (detail)
    by dsanders
  206. [ARM][CGP] Negative constant operand handling

    While mutating instructions, we sign extended negative constant
    operands for binary operators that can safely overflow. This was to
    allow instructions, such as add nuw i8 %a, -2, to still be able to
    perform a subtraction. However, the code to handle constants doesn't
    take into consideration that instructions, such as sub nuw i8 -2, %a,
    require the i8 -2 to be converted into i32 254.

    This is a relatively simple fix, but I've taken the time to
    reorganise the code a bit - mainly that instructions that can be
    promoted are cached and splitting up the Mutate function.

    Differential Revision: (detail)
    by sam_parker
  207. Multiversioning- Ensure all MV functions are emitted.

    Multiverson function versions are always used (by the resolver), so ensure that
    they are always emitted.

    Change-Id: I5d2e0841fddf0d18918b3fb92ae76814add7ee96 (detail)
    by erichkeane
  208. CPU-Dispatch- Fix type of a member function, prevent deferrals

    The member type creation for a cpu-dispatch function was not correctly
    including the 'this' parameter, so ensure that the type is properly
    determined. Also, disable defer in the cases of emitting the functoins,
    as it can end up resulting in the wrong version being emitted.

    Change-Id: I0b8fc5e0b0d1ae1a9d98fd54f35f27f6e5d5d083 (detail)
    by erichkeane
  209. [MS Demangler] Expose the Demangler AST publicly.

    LLDB would like to use this in order to build a clang AST from
    a mangled name.

    This is NFC otherwise. (detail)
    by zturner
  210. [X86][X86FixupLEA] Rename processInstructionForSLM to processInstructionForSlowLEA (NFCI)

    The function isn't SLM specific (its driven by the FeatureSlowLEA flag).

    Minor tidyup prior to PR38225. (detail)
    by rksimon
  211. Logging: put link against libclangAnalysis rather than libLLVMAnalysis for os_log (detail)
    by Tim Northover
  212. [libcxx] Fix usage of _C2, which is a "nasty macro" in some environments

    The problem was pointed out in (detail)
    by Louis Dionne
  213. Logging: add CMake dependency so libAST can use OSLog analysis.

    Should fix bots on platforms with slightly different symbol resolution
    semantics. (detail)
    by Tim Northover
  214. [InstSimplify] fold icmp based on range of abs/nabs (2nd try)

    This is retrying the fold from rL345717
    (reverted at rL347780)
    ...with a fix for the miscompile
    demonstrated by PR39510:

    Original commit message:

    This is a fix for PR39475:

    We managed to get some of these patterns using computeKnownBits in, but that
    can't be used for nabs(). Instead, put in some range-based logic, so we can fold
    both abs/nabs with icmp with a constant value.

    Alive proofs:

    Name: abs_nsw_is_positive

      %cmp = icmp slt i32 %x, 0
      %negx = sub nsw i32 0, %x
      %abs = select i1 %cmp, i32 %negx, i32 %x
      %r = icmp sgt i32 %abs, -1
      %r = i1 true

    Name: abs_nsw_is_not_negative

      %cmp = icmp slt i32 %x, 0
      %negx = sub nsw i32 0, %x
      %abs = select i1 %cmp, i32 %negx, i32 %x
      %r = icmp slt i32 %abs, 0
      %r = i1 false

    Name: nabs_is_negative_or_0

      %cmp = icmp slt i32 %x, 0
      %negx = sub i32 0, %x
      %nabs = select i1 %cmp, i32 %x, i32 %negx
      %r = icmp slt i32 %nabs, 1
      %r = i1 true

    Name: nabs_is_not_over_0

      %cmp = icmp slt i32 %x, 0
      %negx = sub i32 0, %x
      %nabs = select i1 %cmp, i32 %x, i32 %negx
      %r = icmp sgt i32 %nabs, 0
      %r = i1 false

    Differential Revision: (detail)
    by spatel
  215. [InstSimplify] add tests for icmp fold bug (PR39510); NFC

    Verify that set intersection/subset are not confused. (detail)
    by spatel
  216. [mips][micromips] Fix JmpLink to TargetExternalSymbol

    When matching MipsISD::JmpLink t9, TargetExternalSymbol:i32'...',
    wrong JALR16_MM is selected. This patch adds missing pattern for
    JmpLink, so that JAL instruction is selected.

    Differential Revision: (detail)
    by abeserminji
  217. [ADT] Clean up SparseBitVector copying and make it moveable (detail)
    by d0k
  218. Logging: make os_log buffer size an integer constant expression.

    The size of an os_log buffer is known at any stage of compilation, so making it
    a constant expression means that the common idiom of declaring a buffer for it
    won't result in a VLA. That allows the compiler to skip saving and restoring
    the stack pointer around such buffers. (detail)
    by Tim Northover
  219. [AArch64] Add support for ARMv8.4 in Saphira. (detail)
    by mcrosier
  220. CPU-Dispatch-- Fix conflict between 'generic' and 'pentium'

    When a dispatch function was being emitted that had both a generic and a
    pentium configuration listed, we would assert.  This is because neither
    configuration has any 'features' associated with it so they were both
    considered the 'default' version.  'pentium' lacks any features because
    we implement it in terms of __builtin_cpu_supports (instead of Intel
    proprietary checks), which is unable to decern between the two.

    The fix for this is to omit the 'generic' version from the dispatcher if
    both are present. This permits existing code to compile, and still will
    choose the 'best' version available (since 'pentium' is technically
    better than 'generic').

    Change-Id: I4b69f3e0344e74cbdbb04497845d5895dd05fda0 (detail)
    by erichkeane
  221. Allow clk_event_t comparisons

    Also rename `` to `` and
    repurpose it to include both positive and negative clk_event_t tests.

    Differential Revision: (detail)
    by svenvh
  222. [X86][SSE] Move 2-input limit up from getFauxShuffleMask to resolveTargetShuffleInputs (reapplied)

    Reapplying an updated version of rL345395 (reverted in rL345451), now the issues noticed in PR39483 have been fixed.

    This patch allows resolveTargetShuffleInputs to remove UNDEF inputs from cases where we have more than 2 inputs. (detail)
    by rksimon
  223. Update to the 10-10 SARIF spec.

    This removes the Step property (which can be calculated by consumers trivially), and updates the schema and version numbers accordingly. (detail)
    by aaronballman
  224. [NFC] Specialize public API of ICFLoopSafetyInfo for insertions and removals (detail)
    by mkazantsev
  225. [Mips] Conditionally remove successor block

    In MipsBranchExpansion::splitMBB, upon splitting
    a block with two direct branches, remove the successor
    of the newly created block (which inherits successors from
    the original block) which is pointed to by the last
    branch in the original block only if the targets of two
    branches differ.

    This is to fix the failing test when ran with
    -verify-machineinstrs enabled.

    Differential Revision: (detail)
    by smaksimovic
  226. [NFC] Reorganize code to prepare it for more transforms (detail)
    by mkazantsev
  227. [SystemZ::TTI]  Recognize the higher cost of scalar i1 -> fp conversion

    Scalar i1 to fp conversions are done with a branch sequence, so it should
    have a higher cost.

    Review: Ulrich Weigand (detail)
    by jonpa
  228. [SystemZ::TTI]  Accurate costs for i1->double vector conversions

    This factors out a new method getBoolVecToIntConversionCost() containing the
    code for vector sext/zext of i1, in order to reuse it for i1 to double vector

    Review: Ulrich Weigand (detail)
    by jonpa
  229. [clang][CodeGen] ImplicitIntegerSignChangeSanitizer: actually ignore NOP casts.

    I fully expected for that to be handled by the canonical type check,
    but it clearly wasn't. Sadly, somehow it hide until now.

    Reported by Eli Friedman. (detail)
    by lebedevri
  230. [IndVars] Smart hard uses detection

    When rewriting loop exit values, IndVars considers this transform not profitable if
    the loop instruction has a loop user which it believes cannot be optimized away.
    In current implementation only calls that immediately use the instruction are considered
    as such.

    This patch extends the definition of "hard" users to any side-effecting instructions
    (which usually cannot be optimized away from the loop) and also allows handling
    of not just immediate users, but use chains.

    Differentlai Revision:
    Reviewed By: etherzhhb (detail)
    by mkazantsev
  231. [SCEV] Avoid redundant computations when doing AddRec merge

    When we calculate a product of 2 AddRecs, we end up making quite massive
    computations to deduce the operands of resulting AddRec. This process can
    be optimized by computing all args of intermediate sum and then calling
    `getAddExpr` once rather than calling `getAddExpr` with intermediate
    result every time a new argument is computed.

    Differential Revision:
    Reviewed By: rtereshin (detail)
    by mkazantsev
  232. [CodeView] Emit the correct TypeIndex for std::nullptr_t.

    The TypeIndex used by cl.exe is 0x103, which indicates a SimpleTypeMode
    of NearPointer (note the absence of the bitness, normally pointers use a
    mode of NearPointer32 or NearPointer64) and a SimpleTypeKind of void.
    So this is basically a void*, but without a specified size, which makes
    sense given how std::nullptr_t is defined.

    clang-cl was actually not emitting *anything* for this. Instead, when we
    encountered std::nullptr_t in a DIType, we would actually just emit a
    TypeIndex of 0, which is obviously wrong.

    std::nullptr_t in DWARF is represented as a DW_TAG_unspecified_type with
    a name of "decltype(nullptr)", so we add that logic along with a test,
    as well as an update to the dumping code so that we no longer print
    void* when dumping 0x103 (which would previously treat Void/NearPointer
    no differently than Void/NearPointer64).

    Differential Revision: (detail)
    by zturner
  233. [PowerPC] Support constraint 'wi' in asm
      From the gcc manual, we can see that the specific limit of wi inline asm is “FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS”. The link is We should accept this constraint.

    Reviewed By: jsji

    Differential Revision: (detail)
    by helijia
  234. [Clang][PowerPC] Support constraint 'wi' in asm
      From the gcc manual, we can see that the specific limit of wi inline asm is “FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS”. The link is We should accept this constraint.

    Reviewed By: jsji

    Differential Revision: (detail)
    by helijia
  235. [COFF, ARM64] Implement llvm.addressofreturnaddress intrinsic (detail)
    by mgrang
  236. [analyzer] SARIF: Suppress version testing in a more downstream-friendly manner.

    No functional change intended. (detail)
    by dergachev
  237. Fix typo in comment. (detail)
    by rsmith
  238. [WebAssembly] Fix type names in truncation builtins

    Summary: Use the same convention as all the other WebAssembly builtin names.

    Reviewers: aheejin, dschuff

    Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits

    Differential Revision: (detail)
    by tlively
  239. Fix regression in behavior of clang -x c++-header -fmodule-name=XXX

    The driver accidentally stopped passing the input filenames on to -cc1
    in this mode due to confusion over what action was being requested.

    This change also fixes a couple of crashes I encountered when passing
    multiple files to such a -cc1 invocation. (detail)
    by rsmith
  240. [analyzer] pr39348: MallocChecker: Realize that sized delete isn't custom delete.

    MallocChecker no longer thinks that operator delete() that accepts the size of
    the object to delete (available since C++14 or under -fsized-deallocation)
    is some weird user-defined operator. Instead, it handles it like normal delete.

    Additionally, it exposes a regression in's
    testStandardPlacementNewAfterDelete() test, where the diagnostic is delayed
    from before the call of placement new into the code of placement new
    in the header. This happens because the check for pass-into-function-after-free
    for placement arguments is located in checkNewAllocator(), which happens after
    the allocator is inlined, which is too late. Move this use-after-free check
    into checkPreCall instead, where it works automagically because the guard
    that prevents it from working is useless and can be removed as well.

    This commit causes regressions under -analyzer-config
    c++-allocator-inlining=false but this option is essentially unsupported
    because the respective feature has been enabled by default quite a while ago.

    Differential Revision: (detail)
    by dergachev
  241. X86: Consistently declare pass initializers in X86.h; NFC

    This avoids declaring them twice: in X86TargetMachine.cpp and the file
    implementing the pass. (detail)
    by matze
  242. [XRay] Add CPU ID in Custom Event FDR Records

    This change cuts across compiler-rt and llvm, to increment the FDR log
    version number to 4, and include the CPU ID in the custom event records.

    This is a step towards allowing us to change the `llvm::xray::Trace`
    object to start representing both custom and typed events in the stream
    of records. Follow-on changes will allow us to change the kinds of
    records we're presenting in the stream of traces, to incorporate the
    data in custom/typed events.

    A follow-on change will handle the typed event case, where it may not
    fit within the 15-byte buffer for metadata records.

    This work is part of the larger effort to enable writing analysis and
    processing tools using a common in-memory representation of the events
    found in traces. The work will focus on porting existing tools in LLVM
    to use the common representation and informing the design of a
    library/framework for expressing trace event analysis as C++ programs.

    Reviewers: mboerger, eizan

    Subscribers: hiraditya, mgrang, llvm-commits

    Differential Revision: (detail)
    by dberris
  243. [WebAssembly] Lower vselect

    Reviewers: aheejin, dschuff

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

    Differential Revision: (detail)
    by tlively
  244. Compile and test i128 math builtins for Win64

    Windows has always been LLP64, not LP64, so the macros were incorrect.
    Check for _WIN64, since AArch64 sets that too.

    The tests have to be fixed up in two main ways:
    1. Use 'ULL' suffixes to avoid sign extension when passing hex literals
       with the sign bit set to signed 128 arguments. Clang
       -fms-compatibility makes such hex literals signed, not unsigned.
    2. Disable various tests for 80-bit long double interoperation with i128

    Reviewers: joerg, mstorsjo

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

    Differential Revision: (detail)
    by rnk
  245. [WebAssembly] Process p2align operands for SIMD loads and stores

    Reviewers: aheejin, dschuff

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

    Differential Revision: (detail)
    by tlively
  246. [WebAssembly] Handle vector IMPLICIT_DEFs.

    Also reduce the test case for implicit defs and test it with all
    register classes.

    Reviewers: aheejin, dschuff

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

    Differential Revision: (detail)
    by tlively
  247. [VFS] Add support for "no_push" to VFS recursive iterators.

    The "regular" file system has a useful feature that makes it possible to
    stop recursing when using the recursive directory iterators. This
    functionality was missing for the VFS recursive iterator and this patch
    adds that.

    Differential revision: (detail)
    by Jonas Devlieghere
  248. [COFF, ARM64] Change setjmp for AArch64 Windows to use Intrinsic.sponentry

    Summary: ARM64 setjmp expects sp on entry instead of framepointer.

    Reviewers: mgrang, rnk, TomTan, compnerd, mstorsjo, efriedma

    Reviewed By: mstorsjo

    Subscribers: javed.absar, kristof.beyls, chrib, cfe-commits

    Differential Revision: (detail)
    by mgrang
  249. [COFF, ARM64] Implement Intrinsic.sponentry for AArch64

    Summary: This patch adds Intrinsic.sponentry. This intrinsic is required to correctly support setjmp for AArch64 Windows platform.

    Reviewers: mgrang, TomTan, rnk, compnerd, mstorsjo, efriedma

    Reviewed By: efriedma

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

    Differential Revision: (detail)
    by mgrang
  250. [IR] Allow increasing the alignment of dso-local globals.

    I think this is the actual important property; the previous visibility
    check was an approximation.

    Differential Revision: (detail)
    by efriedma
  251. [InlineCost] Remove a dead constant; NFC

    My `grep`-fu indicates that this hasn't been used for years. It also no
    longer makes much sense to have this flavor of penalty in general, since
    a call to a noreturn should mean that we're in a BB that's terminated by
    `unreachable`. That case is accounted for by
    CallAnalyzer::allowSizeGrowth. (detail)
    by George Burgess IV
  252. [compiler-rt] Pass CMake C and C++ flags to the custom libc++

    When building the custom libc++ that's used by libFuzzer as well as
    MSan and TSan tests, passthrough the C and C++ flags that were passed
    to the compiler-rt CMake build. These may be needed to successfuly
    compile the library on a particular platform.

    Differential Revision: (detail)
    by phosek
  253. [AArch64] Sort switch cases (NFC) (detail)
    by evandro
  254. Revert r345165 "[X86] Bring back the MOV64r0 pseudo instruction"

    Google is reporting regressions on some benchmarks. (detail)
    by ctopper
  255. Revert "[ASTImporter][Structural Eq] Check for isBeingDefined"

    This reverts commit r345760

    because it caused an assertion in the lldb test suite. This is the log from the build bot: (detail)
    by shafik
  256. [ARM] Add missing pseudo-instruction for Thumb1 RSBS.

    Shows up rarely for 64-bit arithmetic, more frequently for the compare
    patterns added in r325323.

    Differential Revision: (detail)
    by efriedma
  257. [AArch64] [Windows] Emit unwind tables by default.

    Unwind tables are necessary even in code that doesn't support
    exceptions.  The tables are used for setjmp(), and by debuggers.

    Differential Revision: (detail)
    by efriedma
  258. revert rL345717 : [InstSimplify] fold icmp based on range of abs/nabs

    This can miscompile as shown in PR39510: (detail)
    by spatel
  259. [ARM64] [Windows] Implement _InterlockedExchangeAdd*_* builtins.

    These apparently need to be proper builtins to handle the Windows

    Differential Revision: (detail)
    by efriedma
  260. Check shouldReduceLoadWidth from SimplifySetCC

    SimplifySetCC could shrink a load without checking for
    profitability or legality of such shink with a target.

    Added checks to prevent shrinking of aligned scalar loads
    in AMDGPU below dword as scalar engine does not support it.

    Differential Revision: (detail)
    by rampitec
  261. [ValueTracking] add tests for fmin/fmax; NFC (detail)
    by spatel
  262. [DWARF][NFC] Refactor a function to return Optional<> instead of bool

    Minor refactor of DWARFUnit::getStringOffsetSectionItem().

    Differential Revision: (detail)
    by wolfgangp
  263. Part of PR39508: Emit an @llvm.invariant.start after storing to

    __tls_guard can only ever transition from 0 to 1, and only once. This
    permits LLVM to remove repeated checks for TLS initialization and
    repeated initialization code in cases like:

      int g();
      thread_local int n = g();
      int a = n + n;

    where we could not prove that __tls_guard was still 'true' when checking
    it for the second reference to 'n' in the initializer of 'a'. (detail)
    by rsmith
  264. Remove unused internal template parameter. (detail)
    by rsmith
  265. [adt] SparseBitVector::test() should be const

    Re-worked SparseBitVector's most-recently-used-word caching (CurrElementIter)
    such that SparseBitVector::test() can be made const. This came up when
    attempting to test individual bits in a SparseBitVector which was a member of a
    const object.

    The cached iterator has no bearing on the externally visible state, it's merely
    a performance optimization. Therefore it has been made mutable and
    FindLowerBound() has been split into a const and non-const function
    (FindLowerBound/FindLowerBoundConst) for the const/non-const

    Reviewers: rtereshin

    Reviewed By: rtereshin

    Subscribers: rtereshin, dexonsmith, kristina, llvm-commits

    Differential Revision: (detail)
    by dsanders
  266. [InstCombine] add tests for fmin/fmax pattern matching failure; NFC (detail)
    by spatel
  267. [SelectionDAG] Handle constant range [0,1) in lowerRangeToAssertZExt

    lowerRangeToAssertZExt currently relies on something like EarlyCSE having
    eliminated the constant range [0,1). At -O0 this leads to an assert.

    Differential Revision: (detail)
    by scott.linder
  268. [globalisel] Add comments indicating the operand order (detail)
    by dsanders
  269. Removing a reliance on system headers from this test; NFC. (detail)
    by aaronballman
  270. [compiler-rt][Fuzzer] Use the new C++ ABI namespace CMake support

    libc++ now supports customizing the ABI namespace directly from the
    CMake build so we no longer need to rely on custom CFLAGS.

    Differential Revision: (detail)
    by phosek
  271. Implement the readability-const-return-type check.

    This check flags function top-level const-qualified return types and suggests removing the mostly-superfluous const qualifier where possible.

    Patch by Yitzhak Mandelbaum. (detail)
    by aaronballman
  272. [AMDGPU] Remove FeatureVGPRSpilling

    This feature is only relevant to shaders, and is no longer used. When disabled,
    lowering of reserved registers for shaders causes a compiler crash.

    Remove the feature and add a test for compilation of shaders at OptNone.

    Differential Revision: (detail)
    by scott.linder
  273. [NFC] Replace C++1y and C++1z by C++14 and C++17, respectively (detail)
    by Louis Dionne
  274. [SelectionDAGISel] Suppress a -Wunused-but-set-variable warning in release builds. NFC (detail)
    by ctopper
  275. [ASTImporter][Structural Eq] Check for isBeingDefined

    If one definition is currently being defined, we do not compare for
    equality and we assume that the decls are equal.

    Reviewers: a_sidorin

    Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits

    Differential Revision: (detail)
    by martong
  276. [NFC] Mark "Splicing Maps and Sets" as done in LLVM 8.0 (detail)
    by Louis Dionne
  277. Fix comment typo. NFCI. (detail)
    by rksimon
  278. [InstCombine] regenerate test checks; NFC (detail)
    by spatel
  279. [SelectionDAG] SelectionDAGLegalize::ExpandBITREVERSE - ensure we use ShiftTy

    We should be using the getShiftAmountTy value type for shift amounts. (detail)
    by rksimon
  280. [globalisel][irtranslator] Fix test from r345743 on non-asserts builds. (detail)
    by dsanders
  281. [clang-format] tweaked another case of lambda formatting

    This is done in order to improve cases where the lambda's body is moved too far to the right. Consider the following snippet with column limit set to 79:

    void f() {
                               [this, liveness](const leader::ReadRecordReq& req,
                                                std::function<void()> done) {
                                     req, resp, std::move(done));

                          [this, liveness](const leader::ReadRecordReq& req,
                                           std::function<void()> done) {
                                req, resp, std::move(done), a);

    The tool favors extra indentation for the lambda body and so the code incurs extra wrapping and adjacent calls are indented to a different level. I find this behavior annoying and I'd like the tool to favor new lines and, thus, use the extra width.

    The fix, reduced, brings the following formatting.


                 [] {


            [] {

    Refer to the new tests in FormatTest.cpp

    Contributed by oleg.smolsky!

    Reviewers: djasper, klimek, krasimir

    Subscribers: cfe-commits, owenpan

    Tags: #clang

    Differential Revision: (detail)
    by krasimir
  282. [InstCombine] add tests for fcmp with -0.0; NFC

    From IEEE754: "Comparisons shall ignore the sign of zero (so +0 = −0)." (detail)
    by spatel
  283. [InstCombine] Combine nested min/max intrinsics with constants

    Reviewers: arsenm, spatel

    Reviewed By: spatel

    Subscribers: lebedev.ri, wdng, llvm-commits

    Differential Revision: (detail)
    by volkan
  284. [llvm-mca] Remove the verb 'assemble' from a few options in help. NFC.

    * MCA does not assemble anything.
    * Ran clang-format. (detail)
    by mattd
  285. TableGen: Fix ASAN error

    As a bonus, this arguably improves the code by making it simpler.

    gcc 8 on Ubuntu 18.10 reports the following:

    ==39667==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fffffff8ae0 at pc 0x555555dbfc68 bp 0x7fffffff8760 sp 0x7fffffff8750
    WRITE of size 8 at 0x7fffffff8ae0 thread T0
        #0 0x555555dbfc67 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, std::allocator<char>&&) /usr/include/c++/8/bits/basic_string.h:149
        #1 0x555555dbfc67 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) /usr/include/c++/8/bits/basic_string.h:542
        #2 0x555555dbfc67 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) /usr/include/c++/8/bits/basic_string.h:6009
        #3 0x555555dbfc67 in searchableFieldType /home/nha/amd/build/san/llvm-src/utils/TableGen/SearchableTableEmitter.cpp:168

    Address 0x7fffffff8ae0 is located in stack of thread T0 at offset 864 in frame
        #0 0x555555dbef3f in searchableFieldType /home/nha/amd/build/san/llvm-src/utils/TableGen/SearchableTableEmitter.cpp:148

    Reviewers: fhahn, simon_tatham, kparzysz

    Subscribers: llvm-commits

    Differential Revision: (detail)
    by nha
  286. Re-land r345676 "[Win64] Handle passing i128 by value"

    Fix the unintended switch/case fallthrough to avoid changing long double
    behavior. (detail)
    by rnk
  287. [analyzer] Re-add custom OSIterator rule for RetainCountChecker

    Turns out the rule is quite ubiquitous.

    Revert of (detail)
    by George Karpenkov
  288. [analyzer] RetainCountChecker: for now, do not trust the summaries of inlined code

    Trusting summaries of inlined code would require a more thorough work,
    as the current approach was causing too many false positives, as the new
    example in test.  The culprit lies in the fact that we currently escape
    all variables written into a field (but not passed off to unknown
    functions!), which can result in inconsistent behavior.


    Differential Revision: (detail)
    by George Karpenkov
  289. [analyzer] Enable retain count checking for OSObject by defa

    The FP rate seems to be good enough now.

    Differential Revision: (detail)
    by George Karpenkov
  290. Second half of C++17's splicing maps and sets

    This commit adds a merge member function to all the map and set containers,
    which splices nodes from the source container. This completes support for

    Differential revision: (detail)
    by epilk
  291. [globalisel][irtranslator] Verify that DILocations aren't lost in translation

    Also fix a couple bugs where DILocations are lost. EntryBuilder wasn't passing
    on debug locations for PHI's, constants, GLOBAL_VALUE, etc.

    Reviewers: aprantl, vsk, bogner, aditya_nandakumar, volkan, rtereshin, aemerson

    Reviewed By: aemerson

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

    Differential Revision: (detail)
    by dsanders
  292. [clang-tidy] add missing '--' in RUN-line, unbreak buildbot (detail)
    by jonastoth
  293. [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager

    I'm currently working on including macro expansions in the Static Analyzer's
    plist output, where I can only access a const SourceManager.

    Differential Revision: (detail)
    by szelethus
  294. MachineModuleInfo: Initialize DbgInfoAvailable depending on debug_cus existing

    Before this patch DbgInfoAvailable was set to true in
    DwarfDebug::beginModule() or CodeViewDebug::CodeViewDebug(). This made
    MIR testing weird since passes would suddenly stop dealing with debug
    info just because we stopped the pipeline before the debug printers.

    This patch changes the logic to initialize DbgInfoAvailable based on the
    fact that debug_compile_units exist in the llvm Module. The debug
    printers may then override it with false in case of debug printing being

    Differential Revision: (detail)
    by matze
  295. [clang-tidy] add -fexceptions to failing unit-test, unbreak buildbot (detail)
    by jonastoth
  296. [clang] try-fix broken documentation builder (detail)
    by jonastoth
  297. [clang-tools-extra] fix broken link in release notes (detail)
    by jonastoth
  298. [clang-tidy] new check 'readability-isolate-declaration'

    This patch introduces a new clang-tidy check that matches on all `declStmt` that declare more then one variable
    and transform them into one statement per declaration if possible.

    It currently only focusses on variable declarations but should be extended to cover more kinds of declarations in the future.
    It is related to and does use it's extensive test-suite. Thank you to firolino for his work!

    Reviewers: rsmith, aaron.ballman, alexfh, hokein, kbobyrev

    Reviewed By: aaron.ballman

    Subscribers: ZaMaZaN4iK, mgehre, nemanjai, kbarton, lebedev.ri, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits

    Tags: #clang-tools-extra

    Differential Revision: (detail)
    by jonastoth
  299. [InstCombine] refactor fabs+fcmp fold; NFC

    Also, remove/replace/minimize/enhance the tests for this fold.
    The code drops FMF, so it needs more tests and at least 1 fix. (detail)
    by spatel
  300. [Hexagon] Make sure not to use GP-relative addressing with PIC

    Make sure that -relocation-model=pic prevents use of GP-relative
    addressing modes. (detail)
    by kparzysz
  301. [llvm-mca] Remove namespace prefixes made redundant by r345612. NFC (detail)
    by adibiagio
  302. Delete dependency on config.h

    Since llvm/Config/config.h is not available on standalone builds,
    use __USE_POSIX instead of HAVE_PTHREAD_H and get rid of the include.

    Reviewers: sammccall

    Reviewed By: sammccall

    Subscribers: lebedev.ri, krytarowski, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits

    Differential Revision: (detail)
    by kadircet
  303. [InstSimplify] fold 'fcmp nnan ult X, 0.0' when X is not negative

    This is the inverted case for the transform added with D53874 / rL345725. (detail)
    by spatel
  304. [InstCombine] add assertion that InstSimplify has folded a fabs+fcmp; NFC

    The 'OLT' case was updated at rL266175, so I assume it was just an
    oversight that 'UGE' was not included because that patch handled
    both predicates in InstSimplify. (detail)
    by spatel
  305. Update ioctl(2) operations for NetBSD 8.99.25

    Eliminate dropped operations, add new operations.

    Update included headers for newer need.

    Add a fallback definition of nvlist_ref_t, becaue this type
    is internal to libnpf and the kernel, not exported into public
    headers. (detail)
    by kamil
  306. [InstSimplify] fold 'fcmp nnan oge X, 0.0' when X is not negative

    This re-raises some of the open questions about how to apply and use fast-math-flags in IR from PR38086:
    ...but given the current implementation (no FMF on casts), this is likely the only way to predicate the

    This is part of solving PR39475:

    Differential Revision: (detail)
    by spatel
  307. [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

    This is the first part of the implementation of the inclusion of macro
    expansions into the plist output. It adds a new flag that adds a new
    "macro_expansions" entry to each report that has PathDiagnosticPieces that were
    expanded from a macro. While there's an entry for each macro expansion, both
    the name of the macro and what it expands to is missing, and will be implemented
    in followup patches.

    Differential Revision: (detail)
    by szelethus
  308. [LoopUnroll] allow customization for new-pass-manager version of LoopUnroll

    Unlike its legacy counterpart new pass manager's LoopUnrollPass does
    not provide any means to select which flavors of unroll to run
    (runtime, peeling, partial), relying on global defaults.

    In some cases having ability to run a restricted LoopUnroll that
    does more than LoopFullUnroll is needed.

    Introduced LoopUnrollOptions to select optional unroll behaviors.
    Added 'unroll<peeling>' to PassRegistry mainly for the sake of testing.

    Reviewers: chandlerc, tejohnson
    Differential Revision: (detail)
    by fedor.sergeev
  309. [InstSimplify] add tests for fcmp and known positive; NFC (detail)
    by spatel
  310. [DAGCombiner] Fold 0 div/rem X to 0

    Reviewers: RKSimon, spatel, javed.absar, craig.topper, t.p.northover

    Reviewed By: RKSimon

    Subscribers: craig.topper, llvm-commits

    Differential Revision: (detail)
    by xbolva00
  311. AMDGPU: Rewrite SILowerI1Copies to always stay on SALU

    Instead of writing boolean values temporarily into 32-bit VGPRs
    if they are involved in PHIs or are observed from outside a loop,
    we use bitwise masking operations to combine lane masks in a way
    that is consistent with wave control flow.

    Move SIFixSGPRCopies to before this pass, since that pass
    incorrectly attempts to move SGPR phis to VGPRs.

    This should recover most of the code quality that was lost with
    the bug fix in "AMDGPU: Remove PHI loop condition optimization".

    There are still some relevant cases where code quality could be
    improved, in particular:

    - We often introduce redundant masks with EXEC. Ideally, we'd
      have a generic computeKnownBits-like analysis to determine
      whether masks are already masked by EXEC, so we can avoid this
      masking both here and when lowering uniform control flow.

    - The criterion we use to determine whether a def is observed
      from outside a loop is conservative: it doesn't check whether
      (loop) branch conditions are uniform.

    Change-Id: Ibabdb373a7510e426b90deef00f5e16c5d56e64b

    Reviewers: arsenm, rampitec, tpr

    Subscribers: kzhuravl, jvesely, wdng, mgorny, yaxunl, dstuttard, t-tye, eraman, llvm-commits

    Differential Revision: (detail)
    by nha
  312. AMDGPU: Remove PHI loop condition optimization

    The optimization to early break out of loops if all threads are dead was
    never fully implemented.

    But the PHI node analyzing is actually causing a number of problems, so
    remove all the extra code for it.

    (This does actually regress code quality in a few places because it
    ends up relying more heavily on phi's of i1, which we don't do a
    great job with. However, since it fixes real bugs in the wild, we
    should take this change. I have some prototype changes to improve
    i1 lowering in general -- not just for control flow -- which should
    help recover the code quality, I just need to make those changes
    fit for general consumption. -- Nicolai)

    Change-Id: I6fc6c6c8961857ac6009fcfb9f7e5e48dc23fbb1
    Patch-by: Christian König <>

    Reviewers: arsenm, rampitec, tpr

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

    Differential Revision: (detail)
    by nha
  313. [InstSimplify] fold icmp based on range of abs/nabs

    This is a fix for PR39475:

    We managed to get some of these patterns using computeKnownBits in D47041, but that
    can't be used for nabs(). Instead, put in some range-based logic, so we can fold
    both abs/nabs with icmp with a constant value.

    Alive proofs:

    Name: abs_nsw_is_positive
      %cmp = icmp slt i32 %x, 0
      %negx = sub nsw i32 0, %x
      %abs = select i1 %cmp, i32 %negx, i32 %x
      %r = icmp sgt i32 %abs, -1
      %r = i1 true

    Name: abs_nsw_is_not_negative
      %cmp = icmp slt i32 %x, 0
      %negx = sub nsw i32 0, %x
      %abs = select i1 %cmp, i32 %negx, i32 %x
      %r = icmp slt i32 %abs, 0
      %r = i1 false

    Name: nabs_is_negative_or_0
      %cmp = icmp slt i32 %x, 0
      %negx = sub i32 0, %x
      %nabs = select i1 %cmp, i32 %x, i32 %negx
      %r = icmp slt i32 %nabs, 1
      %r = i1 true

    Name: nabs_is_not_over_0
      %cmp = icmp slt i32 %x, 0
      %negx = sub i32 0, %x
      %nabs = select i1 %cmp, i32 %x, i32 %negx
      %r = icmp sgt i32 %nabs, 0
      %r = i1 false

    Differential Revision: (detail)
    by spatel
  314. [clang-tidy] Remove false decoupling in ClangTidyContext. NFC

    These getters/setters don't encapsulate any behavior, and can only be
    called by friends. (detail)
    by sammccall
  315. Update generate_netbsd_ioctls.awk for NetBSD 8.99.25

    Add dynamic detection of header files in /usr/include.
    Handle "nvlist_ref_t" needed by npf(4) ioctl(2) operations. (detail)
    by kamil
  316. [tblgen][PredicateExpander] Add the ability to describe more complex constraints on instruction operands.

    Before this patch, class PredicateExpander only knew how to expand simple
    predicates that performed checks on instruction operands.
    In particular, the new scheduling predicate syntax was not rich enough to
    express checks like this one:

      Foo(MI->getOperand(0).getImm()) == ExpectedVal;

    Here, the immediate operand value at index zero is passed in input to function
    Foo, and ExpectedVal is compared against the value returned by function Foo.

    While this predicate pattern doesn't show up in any X86 model, it shows up in
    other upstream targets. So, being able to support those predicates is
    fundamental if we want to be able to modernize all the scheduling models

    With this patch, we allow users to specify if a register/immediate operand value
    needs to be passed in input to a function as part of the predicate check. Now,
    register/immediate operand checks all derive from base class CheckOperandBase.

    This patch also changes where TIIPredicate definitions are expanded by the
    instructon info emitter. Before, definitions were expanded in class
    XXXGenInstrInfo (where XXX is a target name).
    With the introduction of this new syntax, we may want to have TIIPredicates
    expanded directly in XXXInstrInfo. That is because functions used by the new
    operand predicates may only exist in the derived class (i.e. XXXInstrInfo).

    This patch is a non functional change for the existing scheduling models.
    In future, we will be able to use this richer syntax to better describe complex
    scheduling predicates, and expose them to llvm-mca.

    Differential Revision: (detail)
    by adibiagio

Started by user Mike Edwards

This run spent:

  • 2 ms waiting;
  • 41 min build duration;
  • 41 min total from scheduled to completion.

Identified problems

Compile Error

This build failed because of a compile error. Below is a list of all errors in the build log:
Indication 1

Missing test results

The test result file Jenkins is looking for does not exist after the build.
Indication 2