collapse
0%
WDescription%
Build stability: All recent builds failed.0
Build History
x
#5554
(pending—Already running 1 builds across all nodes)
 
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems

Changes

#5553 (Oct 22, 2019 6:54:32 AM)

  1. [MIPS GlobalISel] Select MSA vector generic and builtin add

    Select vector G_ADD for MIPS32 with MSA. We have to set bank
    for vector operands to fprb and selectImpl will do the rest.
    __builtin_msa_addv_<format> will be transformed into G_ADD
    in legalizeIntrinsic and selected in the same way.
    __builtin_msa_addvi_<format> will be directly selected into
    ADDVI_<format> in legalizeIntrinsic. MIR tests for it have
    unnecessary additional copies. Capture current state of tests
    with run-pass=legalizer with a test in test/CodeGen/MIR/Mips.

    Differential Revision: https://reviews.llvm.org/D68984 — petar.avramovic / ViewSVN
  2. [ThinLTO] Add code comment. NFC — evgeny777 / ViewSVN
  3. [Alignment][NFC] Convert StoreInst to MaybeAlign

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, jfb, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69303 — gchatelet / ViewSVN
  4. [Alignment][NFC] Convert LoadInst to MaybeAlign

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, jfb, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69302 — gchatelet / ViewSVN
  5. [PowerPC] Turn on CR-Logical reducer pass

    This re-commits r375152 which was pulled in r375233 because it broke
    the EXPENSIVE_CHECKS bot on Windows.

    The reason for the failure was a bug in the pass that the commit turned
    on by default. This patch fixes that bug and turns the pass back on.
    This patch has been verified on the buildbot that originally failed
    thanks to Simon Pilgrim.

    Differential revision: https://reviews.llvm.org/D52431 — nemanjai / ViewSVN
  6. [Alignment][NFC] Use MaybeAlign in AttrBuilder

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69300 — gchatelet / ViewSVN
  7. [Alignment][NFC] Attributes use Align/MaybeAlign

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: jholewinski, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69278 — gchatelet / ViewSVN
  8. [ThinLTO] Don't internalize during promotion

    Differential revision: https://reviews.llvm.org/D69107 — evgeny777 / ViewSVN
  9. [LLVMDebugInfoPDB] - Use cantFail() instead of assert().

    Currently injected-sources-native.test fails with "Expected<T>
    value was in success state.
    (Note: Expected<T> values in success mode must still be checked
    prior to being destroyed)"
    when llvm is compiled with LLVM_ENABLE_ABI_BREAKING_CHECKS in Release.

    The problem is that getStringForID returns Expected<StringRef>
    and Expected value must always be checked, even if it is in success state.
    Checking with assert only helps in Debug and is wrong.

    Differential revision: https://reviews.llvm.org/D69251 — grimar / ViewSVN
  10. [FrontendTests] Try again to make test not write an output file

    Setting the output stream to nulls seems to work. — d0k / ViewSVN
  11. [builtins][test] Avoid unportable mmap call in clear_cache_test.c

    Within the last two weeks, the Builtins-*-sunos :: clear_cache_test.c started to FAIL
    on Solaris.  Running it under truss shows

      mmap(0x00000000, 128, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 0, 0) Err#22 EINVAL
      _exit(1)

    While there are several possible reasons mmap can return EINVAL on Solaris, it turns
    out it's this one (from mmap(2)):

      MAP_ANON  was  specified,  but the file descriptor was not
       -1.

    And indeed even the Linux mmap(2) documents this as unportable:

      MAP_ANONYMOUS
              The mapping is not backed by any file; its contents are initial‐
              ized to zero.  The fd argument is ignored; however, some  imple‐
              mentations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is
              specified, and portable applications should  ensure  this.   The

    This patch follows this advise.  Tested on x86_64-pc-linux-gnu, amd64-pc-solaris2.11
    and sparcv9-sun-solaris2.11.

    Differential Revision: https://reviews.llvm.org/D68455 — ro / ViewSVN
  12. Revert "[FrontendTests] Don't actually run the full compiler, parsing is sufficient."

    This reverts commit 375488. — d0k / ViewSVN
  13. [FrontendTests] Don't actually run the full compiler, parsing is sufficient. — d0k / ViewSVN
  14. [clang-fuzzer] Update proto fuzzer example for r375453. — d0k / ViewSVN
  15. [CMake] [WinMsvc] Look for includes and libs in ${MSVC_BASE}/atlmfc

    This is necessary if building with the DIA SDK enabled.

    Differential Revision: https://reviews.llvm.org/D69240 — mstorsjo / ViewSVN
  16. [CMake] Allow overriding MSVC_DIA_SDK_DIR via CMake

    This eases using it in cross-msvc setups.

    Differential Revision: https://reviews.llvm.org/D69239 — mstorsjo / ViewSVN
  17. gn build: Merge r375483 — gnsyncbot / ViewSVN
  18. Refactor DependencyScanningTool to its own file

    Summary:
    There's no behavior change - just moving DependencyScanningTool to its own file
    since this tool can be reused across both clang-scan-deps binary and an interface
    exposed as part of libClang APIs.

    Reviewers: arphaman, jkorous, Bigcheese, dexonsmith

    Subscribers: mgorny, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69186 — kousikk / ViewSVN
  19. Minor coding style fix. NFC. — hliao / ViewSVN
  20. [lit] Move increase_process_limit to ParallelRun

    Increasing the process limit only makes sense when we use multiple
    processes. — yln / ViewSVN
  21. Fix lld detection in standalone compiler-rt.

    Summary:
    Right now all hwasan tests on Android are silently disabled because they
    require "has_lld" and standalone compiler-rt can not (and AFAIK was
    never able to) set it.

    Reviewers: pcc, dyung

    Subscribers: dberris, mgorny, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D69196 — eugenis / ViewSVN
  22. [hwasan] Workaround unwinder issues in try-catch test.

    Android links the unwinder library to every DSO. The problem is,
    unwinder has global state, and hwasan implementation of personality
    function wrapper happens to rub it the wrong way.

    Switch the test to static libc++ as a temporary workaround. — eugenis / ViewSVN
  23. [X86][BMI] Pull out schedule classes from bmi_andn<> and bmi_bls<>

    Stop hardwiring classes — rksimon / ViewSVN
  24. [NFC] Fix typos in CMake comment — Louis Dionne / ViewSVN
  25. Fix -fuse-init-array decision logic on NetBSD

    For NetBSD 9 and later, it is the default. On older versions, only ARM
    and AArch64 use it by default. — joerg / ViewSVN
  26. [Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics.

    This is a recommit of r375322 and r375327 with a fix for the Windows test breakage. — mspencer / ViewSVN
  27. [X86][SSE] Add OR(EXTRACTELT(X,0),OR(EXTRACTELT(X,1))) -> MOVMSK+CMP reduction combine — rksimon / ViewSVN
  28. [X86][SSE] Add OR(EXTRACTELT(X,0),OR(EXTRACTELT(X,1))) movmsk v2X64 tests — rksimon / ViewSVN
  29. [examples] Add a dependency on ExecutionEngine to LLJITWithObjectCache example.

    ExecutionEngine.cpp contains the anchor() for the ObjectCache base class, so we
    need an explicit dependency on it.

    Patch by Stephen Neuendorffer. Thanks Stephen! — Lang Hames / ViewSVN
  30. AMDGPU/GlobalISel: Legalize fast unsafe FDIV

    Reviewers: arsenm

    Reviewed By: arsenm

    Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69231 — kerbowa / ViewSVN
  31. [lit] Simplify test scheduling via multiprocessing.Pool — yln / ViewSVN
  32. AMDGPU: Select basic interp directly from intrinsics — arsenm / ViewSVN
  33. [lit] Remove redundancy from names and comments — yln / ViewSVN
  34. [CVP] No-wrap deduction for `shl`

    Summary:
    This is the last `OverflowingBinaryOperator` for which we don't deduce flags.
    D69217 taught `ConstantRange::makeGuaranteedNoWrapRegion()` about it.

    The effect is better than of the `mul` patch (D69203):

    | statistic                              |     old |     new | delta | % change |
    | correlated-value-propagation.NumAddNUW |    7145 |    7144 |    -1 | -0.0140% |
    | correlated-value-propagation.NumAddNW  |   12126 |   12125 |    -1 | -0.0082% |
    | correlated-value-propagation.NumAnd    |     443 |     446 |     3 |  0.6772% |
    | correlated-value-propagation.NumNSW    |    5986 |    7158 |  1172 | 19.5790% |
    | correlated-value-propagation.NumNUW    |   10512 |   13304 |  2792 | 26.5601% |
    | correlated-value-propagation.NumNW     |   16498 |   20462 |  3964 | 24.0272% |
    | correlated-value-propagation.NumShlNSW |       0 |    1172 |  1172 |          |
    | correlated-value-propagation.NumShlNUW |       0 |    2793 |  2793 |          |
    | correlated-value-propagation.NumShlNW  |       0 |    3965 |  3965 |          |
    | instcount.NumAShrInst                  |   13824 |   13790 |   -34 | -0.2459% |
    | instcount.NumAddInst                   |  277584 |  277586 |     2 |  0.0007% |
    | instcount.NumAndInst                   |   66061 |   66056 |    -5 | -0.0076% |
    | instcount.NumBrInst                    |  709153 |  709147 |    -6 | -0.0008% |
    | instcount.NumICmpInst                  |  483709 |  483708 |    -1 | -0.0002% |
    | instcount.NumSExtInst                  |   79497 |   79496 |    -1 | -0.0013% |
    | instcount.NumShlInst                   |   40691 |   40654 |   -37 | -0.0909% |
    | instcount.NumSubInst                   |   61997 |   61996 |    -1 | -0.0016% |
    | instcount.NumZExtInst                  |   68208 |   68211 |     3 |  0.0044% |
    | instcount.TotalBlocks                  |  843916 |  843910 |    -6 | -0.0007% |
    | instcount.TotalInsts                   | 7387528 | 7387448 |   -80 | -0.0011% |

    Reviewers: nikic, reames, sanjoy, timshen

    Reviewed By: nikic

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69277 — lebedevri / ViewSVN
  35. [clang-fuzzer] Add new fuzzer target for Objective-C

    Summary:
    - Similar to that of `clang-fuzzer` itself but instead only
      targets Objective-C source files via cc1

    - Also adds an example corpus directory containing some
      input for Objective-C

    Subscribers: mgorny, jfb, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69171 — dgoldman / ViewSVN
  36. [GISel][CombinerHelper] Add a combine turning shuffle_vector into concat_vectors

    Teach the CombinerHelper how to turn shuffle_vectors, that
    concatenate vectors, into concat_vectors and add this combine
    to the AArch64 pre-legalizer combiner.

    Differential Revision: https://reviews.llvm.org/D69149 — qcolombet / ViewSVN
  37. AMDGPU: Use CopyToReg for interp intrinsic lowering

    This doesn't use the default value, so doesn't benefit from the hack
    to help optimize it. — arsenm / ViewSVN
  38. AMDGPU: Erase redundant redefs of m0 in SIFoldOperands

    Only handle simple inter-block redefs of m0 to the same value. This
    avoids interference from redefs of m0 in SILoadStoreOptimzer. I was
    initially teaching that pass to ignore redefs of m0, but having them
    not exist beforehand is much simpler.

    This is in preparation for deleting the current special m0 handling in
    SIFixSGPRCopies to allow the register coalescer to handle the
    difficult cases. — arsenm / ViewSVN
  39. AMDGPU: Stop adding m0 implicit def to SGPR spills

    r375293 removed the SGPR spilling with scalar stores path, so this is
    no longer necessary. This also always had the defect of adding the def
    even when this path wasn't in use. — arsenm / ViewSVN
  40. AMDGPU: Slightly restructure m0 init code

    This will allow using another operation to produce the glue in a
    future change. — arsenm / ViewSVN
  41. [AMDGPU] Select AGPR in PHI operand legalization

    If a PHI defines AGPR legalize its operands to AGPR.
    At the moment we can get an AGPR PHI with VGPR operands.
    I am not aware of any problems as it seems to be handled
    gracefully in RA, but this is not right anyway.

    It also slightly decreases VGPR pressure in some cases
    because we do not have to a copy via VGPR.

    Differential Revision: https://reviews.llvm.org/D69206 — rampitec / ViewSVN
  42. [X86] Rename matchBitOpReduction to matchScalarReduction. NFCI.

    This doesn't need to be just for bitops, but the ops do need to be fully associative. — rksimon / ViewSVN
  43. Reverted r375425 as it broke some buildbots. — s.desmalen / ViewSVN
  44. SemaTemplateDeduction - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  45. [Clang] Add VerboseOutputStream to CompilerInstance

    Remove one instance of a hardcoded output stream in
    CompilerInstance::ExecuteAction. There are still other cases of output
    being hard-coded to standard streams in ExecuteCompilerInvocation, but
    this patch covers the case when no flags like -version or -help are
    passed, namely the "X warnings and Y errors generated." diagnostic.

    Differential Revision: https://reviews.llvm.org/D53768 — scott.linder / ViewSVN
  46. [NFC][CVP] Add `shl` no-wrap deduction test coverage — lebedevri / ViewSVN
  47. SemaExceptionSpec - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  48. [test] Merge Driver/as-w-warnings.c into as-no-warnings.c

    For -integrated-as RUN lines we can remove -target. — maskray / ViewSVN
  49. Prune include of DataLayout.h from include/clang/Basic/TargetInfo.h. NFC

    Summary:
    Use a forward declaration of DataLayout instead of including
    DataLayout.h in clangs TargetInfo.h. This reduces include
    dependencies toward DataLayout.h (and other headers such as
    DerivedTypes.h, Type.h that is included by DataLayout.h).

    Needed to move implemantation of TargetInfo::resetDataLayout
    from TargetInfo.h to TargetInfo.cpp.

    Reviewers: rnk

    Reviewed By: rnk

    Subscribers: jvesely, nhaehnle, cfe-commits, llvm-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69262 — bjope / ViewSVN
  50. Prune Pass.h include from DataLayout.h. NFCI

    Summary:
    Reduce include dependencies by no longer including Pass.h from
    DataLayout.h. That include seemed irrelevant to DataLayout, as
    well as being irrelevant to several users of DataLayout.

    Reviewers: rnk

    Reviewed By: rnk

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

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D69261 — bjope / ViewSVN
  51. [PowerPC] Regenerate test for D52431 — rksimon / ViewSVN
  52. Fix Wdocumentation warning. NFCI. — rksimon / ViewSVN
  53. [NFC] Add missing include to fix modules build

    This header doesn't seem to be parsable on its own and breaks the module build therefore with
    the following error:

    While building module 'LLVM_Backend' imported from llvm-project/llvm/lib/CodeGen/MachineScheduler.cpp:14:
    In file included from <module-includes>:62:
    llvm-project/llvm/include/llvm/CodeGen/MachinePipeliner.h:91:20: error: declaration of 'AAResultsWrapperPass' must be imported from module 'LLVM_Analysis.AliasAnalysis' before it is required
        AU.addRequired<AAResultsWrapperPass>();
                       ^
    llvm-project/llvm/include/llvm/Analysis/AliasAnalysis.h:1157:7: note: previous declaration is here
    class AAResultsWrapperPass : public FunctionPass {
          ^
    llvm-project/llvm/lib/CodeGen/MachineScheduler.cpp:14:10: fatal error: could not build module 'LLVM_Backend'
    ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2 errors generated. — Raphael Isemann / ViewSVN
  54. SystemZISelLowering - supportedAddressingMode - silence static analyzer dyn_cast<> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. — rksimon / ViewSVN
  55. GVNHoist - silence static analyzer dyn_cast<> null dereference warning in hasEHOrLoadsOnPath call. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. — rksimon / ViewSVN
  56. GuardWidening - silence static analyzer null dereference warning with assertion. NFCI. — rksimon / ViewSVN
  57. CrossDSOCFI - silence static analyzer dyn_cast<> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. — rksimon / ViewSVN
  58. IndVarSimplify - silence static analyzer dyn_cast<> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. — rksimon / ViewSVN
  59. [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2)

    Commit message from D66935:

    This patch fixes a bug exposed by D65653 where a subsequent invocation
    of `determineCalleeSaves` ends up with a different size for the callee
    save area, leading to different frame-offsets in debug information.

    In the invocation by PEI, `determineCalleeSaves` tries to determine
    whether it needs to spill an extra callee-saved register to get an
    emergency spill slot. To do this, it calls 'estimateStackSize' and
    manually adds the size of the callee-saves to this. PEI then allocates
    the spill objects for the callee saves and the remaining frame layout
    is calculated accordingly.

    A second invocation in LiveDebugValues causes estimateStackSize to return
    the size of the stack frame including the callee-saves. Given that the
    size of the callee-saves is added to this, these callee-saves are counted
    twice, which leads `determineCalleeSaves` to believe the stack has
    become big enough to require spilling an extra callee-save as emergency
    spillslot. It then updates CalleeSavedStackSize with a larger value.

    Since CalleeSavedStackSize is used in the calculation of the frame
    offset in getFrameIndexReference, this leads to incorrect offsets for
    variables/locals when this information is recalculated after PEI.

    This patch fixes the lldb unit tests in `functionalities/thread/concurrent_events/*`

    Changes after D66935:

    Ensures AArch64FunctionInfo::getCalleeSavedStackSize does not return
    the uninitialized CalleeSavedStackSize when running `llc` on a specific
    pass where the MIR code has already been expected to have gone through PEI.

    Instead, getCalleeSavedStackSize (when passed the MachineFrameInfo) will try
    to recalculate the CalleeSavedStackSize from the CalleeSavedInfo. In debug
    mode, the compiler will assert the recalculated size equals the cached
    size as calculated through a call to determineCalleeSaves.

    This fixes two tests:
      test/DebugInfo/AArch64/asan-stack-vars.mir
      test/DebugInfo/AArch64/compiler-gen-bbs-livedebugvalues.mir
    that otherwise fail when compiled using msan.

    Reviewed By: omjavaid, efriedma

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68783 — s.desmalen / ViewSVN
  60. PCH debug info: Avoid appending the source directory to an absolute path

    When building a precompiled header in -fmodule-format=obj (i.e.,
    `-gmodules) in an absolute path, the locig in
    CGDebugInfo::createCompileUnit would unconditionally append the source
    directory to the -main-file-name. This patch avoids that behavior for
    absolute paths.

    rdar://problem/46045865

    Differential Revision: https://reviews.llvm.org/D69213 — Adrian Prantl / ViewSVN

#5552 (Oct 21, 2019 9:28:59 AM)

  1. [NFC] Cleanup with variable name IsPPC64 & IsDarwin

    Clean up PPCAsmPrinter with IsPPC64 and IsDarwin.

    Differential Revision: https://reviews.llvm.org/D69259 — xiangling_liao / ViewSVN
  2. [Alignment][NFC] Finish transition for `Loads`

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, asbirlea, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69253 — gchatelet / ViewSVN
  3. Pre-commit test cases for D64713. — foad / ViewSVN
  4. [Types] Define a getWithNewBitWidth for Types and make use of it

    This is designed to change the bitwidth of a type without altering the number
    of vector lanes. Also useful in D68651. Otherwise an NFC.

    Differential Revision: https://reviews.llvm.org/D69139 — dmgreen / ViewSVN
  5. [Alignment][NFC] Instructions::getLoadStoreAlignment

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69256 — gchatelet / ViewSVN
  6. [ARM] Extra qdadd patterns

    This adds some new qdadd patterns to go along with the other recently added
    qadd's.

    Differential Revision: https://reviews.llvm.org/D68999 — dmgreen / ViewSVN
  7. [Alignment][NFC] Add a helper function to DataLayout

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69258 — gchatelet / ViewSVN
  8. [docs][llvm-ar] Update llvm-ar command guide

    The llvm-ar command guide had not been updated in some time, it was
    missing current functionality and contained information that was out
    of date. This change:
    - Updates the use of reStructuredText directives, as seen in other tools
      command guides.
    - Updates the command synopsis.
    - Updates the descriptions of the tool behaviour.
    - Updates the options section.
    - Adds details of MRI script functionality.
    - Removes the sections "Standards" and "File Format"

    Differential Revision: https://reviews.llvm.org/D68998 — gbreynoo / ViewSVN
  9. [ARM] Add qadd lowering from a sadd_sat

    This lowers a sadd_sat to a qadd by treating it as legal. Also adds qsub at the
    same time.

    The qadd instruction sets the q flag, but we already have many cases where we
    do not model this in llvm.

    Differential Revision: https://reviews.llvm.org/D68976 — dmgreen / ViewSVN
  10. [Alignment][NFC] TargetCallingConv::setByValAlign

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69248 — gchatelet / ViewSVN
  11. Simplify usage of setFPAttrs.

    In some cases using the return value of setFPAttrs simplifies the code.
    In other cases it complicates the code with ugly casts, so stop doing
    it. NFC. — foad / ViewSVN
  12. [llvm/Object] - Make ELFObjectFile::getRelocatedSection return Expected<section_iterator>

    It returns just a section_iterator currently and have a report_fatal_error call inside.
    This change adds a way to return errors and handle them on caller sides.

    The patch also changes/improves current users and adds test cases.

    Differential revision: https://reviews.llvm.org/D69167 — grimar / ViewSVN
  13. [Alignment][NFC] TargetCallingConv::setOrigAlign and TargetLowering::getABIAlignmentForCallingConv

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69243 — gchatelet / ViewSVN
  14. Fix llvm signal tests build. — David CARLIER / ViewSVN
  15. [obj2yaml] - Fix a comment. NFC.

    I forgot to address this nit before committing.. — grimar / ViewSVN
  16. [obj2yaml] - Stop triggering UB when dumping corrupted strings.

    We have a following code to find quote type:

    if (isspace(S.front()) || isspace(S.back()))
    ...

    Problem is that:

    "int isspace( int ch ): The behavior is undefined if the value of
    ch is not representable as unsigned char and is not equal to EOF."
    (https://en.cppreference.com/w/cpp/string/byte/isspace)

    This patch shows how this UB can be triggered and fixes an issue.

    Differential revision: https://reviews.llvm.org/D69160 — grimar / ViewSVN
  17. [MemCpyOpt] Fixing Incorrect Code Motion while Handling Aggregate Type Values

    Summary:
    When MemCpyOpt is handling aggregate type values, if an instruction (let's call it P) between the targeting load (L) and store (S) clobbers the source pointer of L, it will try to hoist S before P. This process will also hoist S's data dependency instructions.

    However, the current implementation has a bug that if one of S's dependency instructions is //also// a user of P, MemCpyOpt will not prevent it from being hoisted above P and cause a use-before-define error. For example, in the newly added test file (i.e. `aggregate-type-crash.ll`), it will try to hoist both `store %my_struct %1, %my_struct* %3` and its dependent, `%3 = bitcast i8* %2 to %my_struct*`, above `%2 = call i8* @my_malloc(%my_struct* %0)`. Creating the following BB:
    ```
    entry:
      %1 = bitcast i8* %4 to %my_struct*
      %2 = bitcast %my_struct* %1 to i8*
      %3 = bitcast %my_struct* %0 to i8*
      call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %2, i8* align 4 %3, i64 8, i1 false)
      %4 = call i8* @my_malloc(%my_struct* %0)
      ret void
    ```
    Where there is a use-before-define error between `%1` and `%4`.

    Update: The compiler for the Pony Programming Language [also encounter the same bug](https://github.com/ponylang/ponyc/issues/3140)

    Patch by Min-Yih Hsu (myhsu)

    Reviewers: eugenis, pcc, dblaikie, dneilson, t.p.northover, lattner

    Reviewed By: eugenis

    Subscribers: lenary, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D66060 — lenary / ViewSVN
  18. [ARM] Lower sadd_sat to qadd8 and qadd16

    Lower the target independent signed saturating intrinsics to qadd8 and qadd16.
    This custom lowers them from a sadd_sat, catching the node early before it is
    promoted. It also adds a QADD8b and QADD16b node to mean the bottom "lane" of a
    qadd8/qadd16, so that we can call demand bits on it to show that it does not
    use the upper bits.

    Also handles QSUB8 and QSUB16.

    Differential Revision: https://reviews.llvm.org/D68974 — dmgreen / ViewSVN
  19. [ARM] Add and adjust saturation tests for upcoming qadd changes. NFC — dmgreen / ViewSVN
  20. Use Align for TFL::TransientStackAlignment

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: arsenm, dschuff, jyknight, sdardis, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, fedor.sergeev, jrtc27, atanasyan, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69216 — gchatelet / ViewSVN
  21. [NFC][InstCombine] Fixup comments

    As noted in post-commit review of rL375378375378. — lebedevri / ViewSVN
  22. [CVP] Deduce no-wrap on `mul`

    Summary:
    `ConstantRange::makeGuaranteedNoWrapRegion()` knows how to deal with `mul`
    since rL335646, there is exhaustive test coverage.
    This is already used by CVP's `processOverflowIntrinsic()`,
    and by SCEV's `StrengthenNoWrapFlags()`

    That being said, currently, this doesn't help much in the end:
    | statistic                              |     old |     new | delta | percentage |
    | correlated-value-propagation.NumMulNSW |       4 |     275 |   271 |   6775.00% |
    | correlated-value-propagation.NumMulNUW |       4 |    1323 |  1319 |  32975.00% |
    | correlated-value-propagation.NumMulNW  |       8 |    1598 |  1590 |  19875.00% |
    | correlated-value-propagation.NumNSW    |    5715 |    5986 |   271 |      4.74% |
    | correlated-value-propagation.NumNUW    |    9193 |   10512 |  1319 |     14.35% |
    | correlated-value-propagation.NumNW     |   14908 |   16498 |  1590 |     10.67% |
    | instcount.NumAddInst                   |  275871 |  275869 |    -2 |      0.00% |
    | instcount.NumBrInst                    |  708234 |  708232 |    -2 |      0.00% |
    | instcount.NumMulInst                   |   43812 |   43810 |    -2 |      0.00% |
    | instcount.NumPHIInst                   |  316786 |  316784 |    -2 |      0.00% |
    | instcount.NumTruncInst                 |   62165 |   62167 |     2 |      0.00% |
    | instcount.NumUDivInst                  |    2528 |    2526 |    -2 |     -0.08% |
    | instcount.TotalBlocks                  |  842995 |  842993 |    -2 |      0.00% |
    | instcount.TotalInsts                   | 7376486 | 7376478 |    -8 |      0.00% |
    (^ test-suite plain, tests still pass)

    Reviewers: nikic, reames, luqmana, sanjoy, timshen

    Reviewed By: reames

    Subscribers: hiraditya, javed.absar, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69203 — lebedevri / ViewSVN
  23. [InstCombine] Allow values with multiple users in SimplifyDemandedVectorElts

    Summary:
    Allow for ignoring the check for a single use in SimplifyDemandedVectorElts
    to be able to simplify operands if DemandedElts is known to contain
    the union of elements used by all users.
    It is a responsibility of a caller of SimplifyDemandedVectorElts to
    supply correct DemandedElts.

    Simplify a series of extractelement instructions if only a subset of
    elements is used.

    Reviewers: reames, arsenm, majnemer, nhaehnle

    Reviewed By: nhaehnle

    Subscribers: wdng, jvesely, nhaehnle, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67345 — Piotr Sobczak / ViewSVN
  24. gn build: Merge r375390 — gnsyncbot / ViewSVN
  25. [LLDB] [Windows] Initial support for ARM register contexts

    Differential Revision: https://reviews.llvm.org/D69226 — mstorsjo / ViewSVN
  26. [IR] Fix mayReadFromMemory() for writeonly calls

    Current implementation of Instruction::mayReadFromMemory()
    returns !doesNotAccessMemory() which is !ReadNone. This
    does not take into account that the writeonly attribute
    also indicates that the call does not read from memory.

    The patch changes the predicate to !doesNotReadMemory()
    that reflects the intended behavior.

    Differential Revision: https://reviews.llvm.org/D69086 — yrouban / ViewSVN
  27. [BPF] fix indirect call assembly code

    Currently, for indirect call, the assembly code printed out as
      callx <imm>
    This is not right, it should be
      callx <reg>

    Fixed the issue with proper format.

    Differential Revision: https://reviews.llvm.org/D69229 — yhs / ViewSVN
  28. [Attributor][FIX] Silence sign-compare warning — jdoerfert / ViewSVN
  29. [Attributor] Teach AANoCapture to use information in-flight more aggressively

    AAReturnedValues, AAMemoryBehavior, and AANoUnwind, can provide
    information that helps during the tracking or even justifies no-capture.
    We now use this information and enable no-capture in some test cases
    designed a long while a ago for these cases. — jdoerfert / ViewSVN
  30. [X86] Check Subtarget.hasSSE3() before calling shouldUseHorizontalOp and emitting X86ISD::FHADD in LowerUINT_TO_FP_i64.

    This was a regression from r375341.

    Fixes PR43729. — ctopper / ViewSVN
  31. [IndVars] Add a todo to reflect a further oppurtunity identified in D69009

    Nikita pointed out an oppurtunity, might as well document it in the code. — reames / ViewSVN
  32. [IndVars] Eliminate loop exits with equivalent exit counts

    We can end up with two loop exits whose exit counts are equivalent, but whose textual representation is different and non-obvious. For the sub-case where we have a series of exits which dominate one another (common), eliminate any exits which would iterate *after* a previous exit on the exiting iteration.

    As noted in the TODO being removed, I'd always thought this was a good idea, but I've now seen this in a real workload as well.

    Interestingly, in review, Nikita pointed out there's let another oppurtunity to leverage SCEV's reasoning.  If we kept track of the min of dominanting exits so far, we could discharge exits with EC >= MDE.  This is less powerful than the existing transform (since later exits aren't considered), but potentially more powerful for any case where SCEV can prove a >= b, but neither a == b or a > b.  I don't have an example to illustrate that oppurtunity, but won't be suprised if we find one and return to handle that case as well. 

    Differential Revision: https://reviews.llvm.org/D69009 — reames / ViewSVN

#5548 (Oct 19, 2019 6:12:35 AM)

  1. [X86][SSE] LowerUINT_TO_FP_i64 - only use HADDPD for size/fast-hops

    We were always generating a single source HADDPD, but really we should only do this if shouldUseHorizontalOp says its a good idea.

    Differential Revision: https://reviews.llvm.org/D69175 — rksimon / ViewSVN
  2. Refine check for `_LIBCPP_C_HAS_NO_GETS` on FreeBSD

    Summary:
    In D67316 we added `_LIBCPP_C_HAS_NO_GETS` to signal that the C library
    does not provide `gets()`, and added a test for FreeBSD 13 or higher,
    using the compiler-defined `__FreeBSD__` macro.

    Unfortunately this did not work that well for FreeBSD's own CI process,
    since the gcc compilers used for some architectures define `__FreeBSD__`
    to match the build host, not the target.

    Instead, we should use the `__FreeBSD_version` macro from the userland
    header `<osreldate.h>`, which is more fine-grained.  See also
    <https://reviews.freebsd.org/D22034>.

    Reviewers: EricWF, mclow.lists, emaste, ldionne

    Reviewed By: emaste, ldionne

    Subscribers: dexonsmith, bsdjhb, krytarowski, christof, ldionne, libcxx-commits

    Differential Revision: https://reviews.llvm.org/D69174 — dim / ViewSVN
  3. Explicit in the doc the current list of projects (with easy copy and paste) — sylvestre / ViewSVN
  4. Revert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics." and "[Docs] Fix header level."

    The test doesn't work on Windows. I'll fix it and recommit later. — mspencer / ViewSVN
  5. Make it clear in the doc that 'all' in LLVM_ENABLE_PROJECTS does install ALL projects — sylvestre / ViewSVN
  6. [analyzer] PR43551: Do not dereferce void* in UndefOrNullArgVisitor.

    Patch by Kristóf Umann!

    Differential Revision: https://reviews.llvm.org/D68591 — dergachev / ViewSVN
  7. [analyzer] Fix a crash on tracking Objective-C 'self' as a control dependency.

    'self' was previously never tracked, but now it can be tracked
    because it may be part of a condition. — dergachev / ViewSVN
  8. [Docs] Fix header level. — mspencer / ViewSVN
  9. Add -Wbitwise-conditional-parentheses to warn on mixing '|' and '&' with "?:"

    Extend -Wparentheses to cover mixing bitwise-and and bitwise-or with the
    conditional operator. There's two main cases seen with this:

    unsigned bits1 = 0xf0 | cond ? 0x4 : 0x1;
    unsigned bits2 = cond1 ? 0xf0 : 0x10 | cond2 ? 0x5 : 0x2;

    // Intended order of evaluation:
    unsigned bits1 = 0xf0 | (cond ? 0x4 : 0x1);
    unsigned bits2 = (cond1 ? 0xf0 : 0x10) | (cond2 ? 0x5 : 0x2);

    // Actual order of evaluation:
    unsigned bits1 = (0xf0 | cond) ? 0x4 : 0x1;
    unsigned bits2 = cond1 ? 0xf0 : ((0x10 | cond2) ? 0x5 : 0x2);

    Differential Revision: https://reviews.llvm.org/D66043 — rtrieu / ViewSVN
  10. Avoid including CodeView/SymbolRecord.h from MCStreamer.h

    Move the types needed out so they can be forward declared instead. — rnk / ViewSVN
  11. [Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics.

    Differential Revision: https://reviews.llvm.org/D68528 — mspencer / ViewSVN
  12. AMDGPU: Remove optnone from a test

    It's not clear why the test had this. I'm unable to break the original
    case with the original patch reverted with or without optnone.

    This avoids a failure in a future commit. — arsenm / ViewSVN
  13. Prune a LegacyDivergenceAnalysis and MachineLoopInfo include each

    Now X86ISelLowering doesn't depend on many IR analyses. — rnk / ViewSVN
  14. Prune Analysis includes from SelectionDAG.h

    Only forward declarations are needed here. Follow-on to r375311. — rnk / ViewSVN
  15. New tautological warning for bitwise-or with non-zero constant always true.

    Taking a value and the bitwise-or it with a non-zero constant will always
    result in a non-zero value. In a boolean context, this is always true.

    if (x | 0x4) {}  // always true, intended '&'

    This patch creates a new warning group -Wtautological-bitwise-compare for this
    warning. It also moves in the existing tautological bitwise comparisons into
    this group. A few other changes were needed to the CFGBuilder so that all bool
    contexts would be checked. The warnings in -Wtautological-bitwise-compare will
    be off by default due to using the CFG.

    Fixes: https://bugs.llvm.org/show_bug.cgi?id=42666
    Differential Revision: https://reviews.llvm.org/D66046 — rtrieu / ViewSVN
  16. [profile] Use -fPIC -shared in a test instead of -dynamiclib

    This is more portable than -dynamiclib. Also, fix the path to an input
    file that broke when the test was moved in r375315. — Vedant Kumar / ViewSVN
  17. Move endian constant from Host.h to SwapByteOrder.h, prune include

    Works on this dependency chain:
      ArrayRef.h ->
      Hashing.h -> --CUT--
      Host.h ->
      StringMap.h / StringRef.h

    ArrayRef is very popular, but Host.h is rarely needed. Move the
    IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are
    more likely to need it. — rnk / ViewSVN
  18. [profile] Disable instrprof-get-filename-merge-mode.c on Windows

    The Windows bots are failing with:

    clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument] — Vedant Kumar / ViewSVN
  19. Sema: Create a no-op implicit cast for lvalue function conversions.

    This fixes an assertion failure in the case where an implicit conversion for a
    function call involves an lvalue function conversion, and makes the AST for
    initializations involving implicit lvalue function conversions more accurate.

    Differential Revision: https://reviews.llvm.org/D66437 — pcc / ViewSVN
  20. Prune two MachineInstr.h includes, fix up deps

    MachineInstr.h included AliasAnalysis.h, which includes a world of IR
    constructs mostly unneeded in CodeGen. Prune it. Same for
    DebugInfoMetadata.h.

    Noticed with -ftime-trace. — rnk / ViewSVN
  21. [clang][driver] Print compilation phases with indentation.

    Reviewers: tra, sfantao, echristo

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69124 — hliao / ViewSVN
  22. [hip][cuda] Fix the extended lambda name mangling issue.

    Summary:
    - HIP/CUDA host side needs to use device kernel symbol name to match the
      device side binaries. Without a consistent naming between host- and
      device-side compilations, it's risky that wrong device binaries are
      executed. Consistent naming is usually not an issue until unnamed
      types are used, especially the lambda. In this patch, the consistent
      name mangling is addressed for the extended lambdas, i.e. the lambdas
      annotated with `__device__`.
    - In [Itanium C++ ABI][1], the mangling of the lambda is generally
      unspecified unless, in certain cases, ODR rule is required to ensure
      consisent naming cross TUs. The extended lambda is such a case as its
      name may be part of a device kernel function, e.g., the extended
      lambda is used as a template argument and etc. Thus, we need to force
      ODR for extended lambdas as they are referenced in both device- and
      host-side TUs. Furthermore, if a extended lambda is nested in other
      (extended or not) lambdas, those lambdas are required to follow ODR
      naming as well. This patch revises the current lambda mangle numbering
      to force ODR from an extended lambda to all its parent lambdas.
    - On the other side, the aforementioned ODR naming should not change
      those lambdas' original linkages, i.e., we cannot replace the original
      `internal` with `linkonce_odr`; otherwise, we may violate ODR in
      general. This patch introduces a new field `HasKnownInternalLinkage`
      in lambda data to decouple the current linkage calculation based on
      mangling number assigned.

    [1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html

    Reviewers: tra, rsmith, yaxunl, martong, shafik

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68818 — hliao / ViewSVN
  23. [analyzer] Specify the C++ standard in more tests.

    Makes life easier for downstream developers with different default standard. — dergachev / ViewSVN
  24. P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of is_invocable that would internally conjure up a deprecated function type.

    Summary: The implementation of P1152R4 in Clang has resulted in some deprecation warnings appearing in the libc++ and libc++abi test suite. Fix or suppress these warnings.

    Reviewers: mclow.lists, EricWF

    Subscribers: christof, ldionne, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D68879 — rsmith / ViewSVN
  25. [c++20] Add rewriting from comparison operators to <=> / ==.

    This adds support for rewriting <, >, <=, and >= to a normal or reversed
    call to operator<=>, for rewriting != to a normal or reversed call to
    operator==, and for rewriting <=> and == to reversed forms of those same
    operators.

    Note that this is a breaking change for various C++17 code patterns,
    including some in use in LLVM. The most common patterns (where an
    operator== becomes ambiguous with a reversed form of itself) are still
    accepted under this patch, as an extension (with a warning). I'm hopeful
    that we can get the language rules fixed before C++20 ships, and the
    extension warning is aimed primarily at providing data to inform that
    decision. — rsmith / ViewSVN
  26. [c++20] Add CXXRewrittenBinaryOperator to represent a comparison
    operator that is rewritten as a call to multiple other operators.

    No functionality change yet: nothing creates these expressions. — rsmith / ViewSVN
  27. DebugInfo: Render the canonical name of a class template specialization, even when nested in another class template specialization

    Differential Revision: https://reviews.llvm.org/D63031 — dblaikie / ViewSVN
  28. [profile] Do not cache __llvm_profile_get_filename result

    When the %m filename pattern is used, the filename is unique to each
    image, so the cached value is wrong.

    It struck me that the full filename isn't something that's recomputed
    often, so perhaps it doesn't need to be cached at all. David Li pointed
    out we can go further and just hide lprofCurFilename. This may regress
    workflows that depend on using the set-filename API to change filenames
    across all loaded DSOs, but this is expected to be very rare.

    rdar://55137071

    Differential Revision: https://reviews.llvm.org/D69137 — Vedant Kumar / ViewSVN
  29. LiveIntervals: Fix handleMoveUp with subreg def moving across a def

    If a subregister def was moved across another subregister def and
    another use, the main range was not correctly updated. The end point
    of the moved interval ended too early and missed the use from theh
    other lanes in the subreg def. — arsenm / ViewSVN
  30. gn build: Build compiler-rt code with -fvisibility=hidden.

    This matches the CMake build.

    Differential Revision: https://reviews.llvm.org/D69202 — pcc / ViewSVN
  31. hwasan: Add missing SANITIZER_INTERFACE_ATTRIBUTE on __hwasan_personality_wrapper.

    Differential Revision: https://reviews.llvm.org/D69201 — pcc / ViewSVN
  32. [AMDGPU] move PHI nodes to AGPR class

    If all uses of a PHI are in AGPR register class we should
    avoid unneeded copies via VGPRs.

    Differential Revision: https://reviews.llvm.org/D69200 — rampitec / ViewSVN
  33. [hwasan] Remove system allocator fallback.

    Summary:
    This has been an experiment with late malloc interposition, made
    possible by a non-standard feature of the Android dynamic loader.

    Reviewers: pcc, mmalcomson

    Subscribers: srhines, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D69199 — eugenis / ViewSVN
  34. [SampleFDO] Add profile remapping support for profile on-demand loading used
    by ExtBinary format profile

    Profile on-demand loading was added for ExtBinary format profile in rL374233,
    but currently profile on-demand loading doesn't work well with profile
    remapping. The patch adds the support.

    Suppose a function in the current module has outline instance in the profile.
    The function name in the module is different from the name of the outline
    instance, but remapper knows the two names are equal. When loading profile
    on-demand, the outline instance has to be loaded with remapper's help.

    At the same time SampleProfileReaderItaniumRemapper is changed from a proxy
    of SampleProfileReader to a helper member in SampleProfileReader.

    Differential Revision: https://reviews.llvm.org/D68901 — wmi / ViewSVN
  35. [AMDGPU] Remove -amdgpu-spill-sgpr-to-smem.

    Summary: The implementation was never completed and never used except in tests.

    Reviewers: arsenm, mareko

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69163 — foad / ViewSVN
  36. [CVP] setDeducedOverflowingFlags(): actually inc per-opcode stats

    This is really embarrassing. Those are pointers, so that offsets the
    pointers, not the statistics pointed-by the pointer... — lebedevri / ViewSVN
  37. gn build: Merge r375288 — gnsyncbot / ViewSVN
  38. Disable exit-on-SIGPIPE in lldb

    Occasionally, during test teardown, LLDB writes to a closed pipe.
    Sometimes the communication is inherently unreliable, so LLDB tries to
    avoid being killed due to SIGPIPE (it calls `signal(SIGPIPE, SIG_IGN)`).
    However, LLVM's default SIGPIPE behavior overrides LLDB's, causing it to
    exit with IO_ERR.

    Opt LLDB out of the default SIGPIPE behavior. I expect that this will
    resolve some LLDB test suite flakiness (tests randomly failing with
    IO_ERR) that we've seen since r344372.

    rdar://55750240

    Differential Revision: https://reviews.llvm.org/D69148 — Vedant Kumar / ViewSVN
  39. [X86] Fix register parsing in .seh_* in Intel syntax

    Previously, the parser checked for a '%' prefix to indicate a register.
    In Intel syntax mode, LLVM does not print a '%' prefix on registers, so
    LLVM could not parse its own assembly output. Instead, require that
    register numbers be integer literals, or at least start with an integer
    literal, which is consistent with .cfi_* directive register parsing. — rnk / ViewSVN
  40. [analyzer] exploded-graph-rewriter: Unforget to censor stmt_ids in the test.

    They're not stable across machines.

    Fixes buildbots after r375278. — dergachev / ViewSVN
  41. [NFC][CVP] Some tests for `mul` no-wrap deduction — lebedevri / ViewSVN
  42. Update global_symbols.txt. — pcc / ViewSVN
  43. [WebAssembly] Allow multivalue signatures in object files

    Summary:
    Also changes the wasm YAML format to reflect the possibility of having
    multiple return types and to put the returns after the params for
    consistency with the binary encoding.

    Reviewers: aheejin, sbc100

    Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69156 — tlively / ViewSVN
  44. [analyzer] exploded-graph-rewriter: Rename Environment to Expressions.

    It's less confusing for newcomers. — dergachev / ViewSVN
  45. [analyzer] Fix FieldRegion dumps.

    The '->' thing has always been confusing; the actual operation '->'
    translates to a pointer dereference together with adding a FieldRegion,
    but FieldRegion on its own doesn't imply an additional pointer
    dereference. — dergachev / ViewSVN
  46. [analyzer] Drop the logic for collapsing the state if it's same as in preds.

    One of the first attempts to reduce the size of the exploded graph dumps
    was to skip the state dump as long as the state is the same as in all of
    the predecessor nodes. With all the new facilities in place (node joining,
    diff dumps), this feature doesn't do much, and when it does,
    it's more harmful than useful. Let's remove it. — dergachev / ViewSVN
  47. [analyzer] exploded-graph-rewriter: Fix dump for state 0.

    It shouldn't say "unspecified" when the state is specified to be empty. — dergachev / ViewSVN
  48. [analyzer] Fix hidden node traversal in exploded graph dumps.

    The joined nodes now actually have the same state. That was intended
    from the start but the original implementation turned out to be buggy.

    Differential Revision: https://reviews.llvm.org/D69150 — dergachev / ViewSVN
  49. [GISel][CallLowering] Make isIncomingArgumentHandler a pure virtual method

    The default implementation of isIncomingArgumentHandler could lead
    to generating incorrect code.
    Make it a pure virtual method, so that targets know they have to
    override it to produce correct code.

    NFC

    Differential Revision: https://reviews.llvm.org/D69187 — qcolombet / ViewSVN
  50. scudo: Update TLS_SLOT_SANITIZER value.

    Android now allocates only 8 fixed TLS slots. Somehow we were getting away
    with using a non-existent slot until now, but in some cases the TLS slots
    were being placed at the end of a page, which led to a segfault at startup.

    Differential Revision: https://reviews.llvm.org/D69191 — pcc / ViewSVN
  51. [CVP] After proving that @llvm.with.overflow()/@llvm.sat() don't overflow, also try to prove other no-wrap

    Summary:
    CVP, unlike InstCombine, does not run till exaustion.
    It only does a single pass.

    When dealing with those special binops, if we prove that they can
    safely be demoted into their usual binop form,
    we do set the no-wrap we deduced. But when dealing with usual binops,
    we try to deduce both no-wraps.

    So if we convert e.g. @llvm.uadd.with.overflow() to `add nuw`,
    we won't attempt to check whether it can be `add nuw nsw`.

    This patch proposes to call `processBinOp()` on newly-created binop,
    which is identical to what we do for div/rem already.

    Reviewers: nikic, spatel, reames

    Reviewed By: nikic

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69183 — lebedevri / ViewSVN
  52. [examples] Fix some comments in the LLJITWithJITLink example — Lang Hames / ViewSVN
  53. AMDGPU: Relax 32-bit SGPR register class

    Mostly use SReg_32 instead of SReg_32_XM0 for arbitrary values. This
    will allow the register coalescer to do a better job eliminating
    copies to m0.

    For GlobalISel, as a terrible hack, use SGPR_32 for things that should
    use SCC until booleans are solved. — arsenm / ViewSVN
  54. [examples] Add an example of how to use JITLink and small-code-model with LLJIT.

    JITLink is LLVM's newer jit-linker. It is an alternative to (and hopefully
    eventually a replacement for) LLVM's older jit-linker, RuntimeDyld. Unlike
    RuntimeDyld which requries JIT'd code to be complied with the large code
    model, JITlink can link code compiled with the small code model, which is
    the native code model for a number of targets (including all supported MachO
    targets).

    This example shows how to:

    -- Create a JITLink InProcessMemoryManager
    -- Set the code model to small
    -- Use a JITLink backed ObjectLinkingLayer as the linking layer for LLJIT
       (rather than the default RTDyldObjectLinkingLayer).

    Note: This example will only work on platforms supported by JITLink. As of
    this commit that's MachO/x86-64 and MachO/arm64. — Lang Hames / ViewSVN
  55. AMDGPU: Fix SMEM WAR hazard for gfx10 readlane

    Summary: Hazard recognizer fails to see hazard with V_READLANE_B32_gfx10.

    Reviewers: rampitec

    Reviewed By: rampitec

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69172 — kerbowa / ViewSVN
  56. [lit] Reduce value of synthesized timeouts

    Large timeout values (one year, positive infinity) trip up Python on
    Windows with "OverflowError: timeout value is too large".  One week
    seems to work and is still large enough in practice.

    Thanks to Simon Pilgrim for helping me test this.
    https://reviews.llvm.org/rL375171 — yln / ViewSVN

#5547 (Oct 18, 2019 10:30:21 AM)

  1. [lit] Remove unnecessary tracking of test_index — yln / ViewSVN
  2. [lit] Only send back test result from worker process

    Avoid sending back the whole run.Test object (which needs to be pickled)
    from the worker process when we are only interested in the test result. — yln / ViewSVN
  3. [Codegen] Link MIRParser into CodeGenTests to fix MachineSizeOptsTest building — lebedevri / ViewSVN
  4. [NFC][CVP] Add @llvm.*.sat tests where we could prove both no-overflows — lebedevri / ViewSVN
  5. [Format] Add format check for throwing negative numbers

    Summary:
    The code `throw -1;` is currently formatted by clang-format as
    `throw - 1;`. This diff adds a fix for this edge case and a test to check
    for this in the future.

    For context, I am looking into a related bug in the clang-formatting of
    coroutine keywords: `co_yield -1;` is also reformatted in this manner
    as `co_yield - 1;`. A later diff will add these changes and tests for the
    `co_yield` and `co_return` keywords.

    Patch by Jonathan Thomas (jonathoma)!

    Reviewers: modocache, sammccall, Quuxplusone

    Reviewed By: sammccall

    Subscribers: cfe-commits

    Tags: #clang-format, #clang

    Differential Revision: https://reviews.llvm.org/D69144 — modocache / ViewSVN
  6. [DOCS]Update list of implemented constructs, NFC. — abataev / ViewSVN
  7. gn build: Merge r375254 — gnsyncbot / ViewSVN
  8. [OPENMP50]Add support for master taskloop simd.

    Added  trsing/semantics/codegen for combined construct master taskloop simd. — abataev / ViewSVN
  9. [PGO][PGSO] SizeOpts changes.

    Summary:
    (Split of off D67120)

    SizeOpts/MachineSizeOpts changes for profile guided size optimization.

    Reviewers: davidxl

    Subscribers: mgorny, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69070 — yamauchi / ViewSVN
  10. [X86] combineX86ShufflesRecursively - pull out isTargetShuffleVariableMask. NFCI. — rksimon / ViewSVN
  11. [IR] Reimplement FPMathOperator::classof as a whitelist.

    Summary:
    This makes it much easier to verify that the implementation matches the
    documentation. It uncovered a bug in the unit tests where we were
    accidentally setting fast math flags on a load instruction.

    Reviewers: spatel, wristow, arsenm, hfinkel, aemerson, efriedma, cameron.mcinally, mcberg2017, jmolloy

    Subscribers: wdng, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69176 — foad / ViewSVN
  12. Update docs for fast-math flags.

    This adds fneg, phi and select to the list of operations that may use
    fast-math flags. — foad / ViewSVN
  13. [clang-format] fix regression recognizing casts in Obj-C calls

    Summary:
    r373922 added checks for a few tokens that, following an `)` make it
    unlikely that the `)` is the closing paren of a cast expression. The
    specific check for `tok::l_square` there introduced a regression for
    casts of Obj-C calls, like:
    ```
    (cast)[func arg]
    ```
    From the tests added in r373922, I believe the `tok::l_square` case is added to
    capture the case where a non-cast `)` is directly followed by an
    attribute specifier, like:
    ```
    int f(int x) [[noreturn]];
    ```

    I've specialized the code to look for such attribute specifier instead
    of `tok::l_square` in general. Also, I added a regression test and moved
    the test cases added in r373922 to an already existing place documenting
    other instances of historically misidentified casts.

    Reviewers: MyDeveloperDay

    Reviewed By: MyDeveloperDay

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69164 — krasimir / ViewSVN
  14. [tooling] Relax an assert when multiple GPU targets are specified. — hliao / ViewSVN
  15. Update MinidumpYAML to use minidump::Exception for exception stream

    Reviewers: labath, jhenderson, clayborg, MaskRay, grimar

    Reviewed By: grimar

    Subscribers: lldb-commits, grimar, MaskRay, hiraditya, llvm-commits

    Tags: #llvm, #lldb

    Differential Revision: https://reviews.llvm.org/D68657 — josepht / ViewSVN
  16. [AMDGPU][MC][GFX10] Added sdwa/dpp versions of v_cndmask_b32

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

    Reviewers: arsenm, rampitec

    Differential Revision: https://reviews.llvm.org/D69096 — dpreobra / ViewSVN
  17. [DFAPacketizer] Fix large compile-time regression for VLIW targets

    D68992 / rL375086 refactored the packetizer and removed a bunch of logic. Unfortunately it creates an Automaton object whenever a DFAPacketizer is required. These objects have no longevity, and in particular on a debug build the population of the Automaton's transition map from the underlying table is very slow (because it is called ~10 times per MachineFunction, in the testcase I'm looking at).

    This patch changes Automaton to wrap its underlying constant data in std::shared_ptr, which allows trivial copy construction. The DFAPacketizer creation function now creates a static archetypical Automaton and copies that whenever a new DFAPacketizer is required.

    This takes a testcase down from ~20s to ~0.5s in debug mode. — jamesm / ViewSVN
  18. Add ExceptionStream to llvm::Object::minidump

    Summary:
    This will allow updating MinidumpYAML and LLDB to use this common
    definition.

    Reviewers: labath, jhenderson, clayborg

    Reviewed By: labath

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68656 — josepht / ViewSVN
  19. One more attempt to fix PS4 buildbot after r375219

    PS4 buildbot seems to be dropping variable names for some reason — evgeny777 / ViewSVN
  20. Attempt to fix PS4 buildbot after r375219 — evgeny777 / ViewSVN
  21. Revert r375152 as it is causing failures on EXPENSIVE_CHECKS bot — nemanjai / ViewSVN
  22. [SCEV] Removing deprecated comment in ScalarEvolutionExpander

    Removing a comment in the ScalarEvolutionExpander.cpp file that was about the
    class SCEVSDivExpr, which has been long gone from LLVM. — vhscampos / ViewSVN
  23. [AMDGPU][MC][GFX9] Corrected parsing of v_cndmask_b32_sdwa

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

    Reviewers: arsenm, rampitec

    Differential Revision: https://reviews.llvm.org/D69095 — dpreobra / ViewSVN
  24. [NFC][CVP] Count all the no-wraps we proved

    Summary:
    It looks like this is the only missing statistic in the CVP pass.
    Since we prove NSW and NUW separately i'd think we should count them separately too.

    Reviewers: nikic, spatel, reames

    Reviewed By: spatel

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68740 — lebedevri / ViewSVN
  25. [AArch64] Adding support for PMMIR_EL1 register

    Summary:
    The PMMIR_EL1 register is present in Armv8.4 with PMU extension.
    This patch adds support for it.

    Reviewers: t.p.northover, dnsampaio

    Reviewed By: dnsampaio

    Subscribers: kristof.beyls, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68940 — vhscampos / ViewSVN
  26. [clangd] Report declaration references in findExplicitReferences.

    Reviewers: ilya-biryukov

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

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68977 — hokein / ViewSVN
  27. [ThinLTOCodeGenerator] Add support for index-based WPD

    This is clang part of the patch. It adds -flto-unit flag for thin LTO
    builds on Mac and PS4

    Differential revision: https://reviews.llvm.org/D68950 — evgeny777 / ViewSVN
  28. [AArch64][SVE] Add SPLAT_VECTOR ISD Node

    Adds a new ISD node to replicate a scalar value across all elements of
    a vector. This is needed for scalable vectors, since BUILD_VECTOR cannot
    be used.

    Fixes up default type legalization for scalable vectors after the
    new MVT type ranges were introduced.

    At present I only use this node for scalable vectors. A DAGCombine has
    been added to transform a BUILD_VECTOR into a SPLAT_VECTOR if all
    elements are the same, but only if the default operation action of
    Expand has been overridden by the target.

    I've only added result promotion legalization for scalable vector
    i8/i16/i32/i64 types in AArch64 for now.

    Reviewers: t.p.northover, javed.absar, greened, cameron.mcinally, jmolloy

    Reviewed By: jmolloy

    Differential Revision: https://reviews.llvm.org/D47775 — huntergr / ViewSVN
  29. [Arm][libsanitizer] Fix arm libsanitizer failure with bleeding edge glibc

    Glibc has recently introduced changed to the mode field in ipc_perm in commit
    2f959dfe849e0646e27403f2e4091536496ac0f0. For Arm this means that the mode
    field no longer has the same size.

    This causes an assert failure against libsanitizer's internal copy of ipc_perm.
    Since this change can't be easily detected I am adding arm to the list of
    targets that are excluded from this check.

    Patch by: Tamar Christina

    Differential Revision: https://reviews.llvm.org/D69104 — sjoerdmeijer / ViewSVN
  30. [ThinLTOCodeGenerator] Add support for index-based WPD

    Differential revision: https://reviews.llvm.org/D68950 — evgeny777 / ViewSVN
  31. [AArch64] Don't combine callee-save and local stack adjustment when optimizing for size

    For arm64, D18619 introduced the ability to combine bumping the stack pointer
    upfront in case it needs to be bumped for both the callee-save area as well as
    the local stack area.

    That diff already remarks that "This change can cause an increase in
    instructions", but argues that even when that happens, it should be still be a
    performance benefit because the number of micro-ops is reduced.

    We have observed that this code-size increase can be significant in practice.
    This diff disables combining stack bumping for methods that are marked as
    optimize-for-size.

    Example of a prologue with the behavior before this diff (combining stack bumping when possible):
      sub        sp, sp, #0x40
      stp        d9, d8, [sp, #0x10]
      stp        x20, x19, [sp, #0x20]
      stp        x29, x30, [sp, #0x30]
      add        x29, sp, #0x30
      [... compute x8 somehow ...]
      stp        x0, x8, [sp]

    And after this  diff, if the method is marked as optimize-for-size:
      stp        d9, d8, [sp, #-0x30]!
      stp        x20, x19, [sp, #0x10]
      stp        x29, x30, [sp, #0x20]
      add        x29, sp, #0x20
      [... compute x8 somehow ...]
      stp        x0, x8, [sp, #-0x10]!

    Note that without combining the stack bump there are two auto-decrements,
    nicely folded into the stp instructions, whereas otherwise there is a single
    sub sp, ... instruction, but not folded.

    Patch by Nikolai Tillmann!

    Differential Revision: https://reviews.llvm.org/D68530 — dmgreen / ViewSVN
  32. [X86] Regenerate memcmp tests and add X64-AVX512 common prefix

    Should help make the changes in D69157 clearer — rksimon / ViewSVN
  33. Fix MSVC "not all control paths return a value" warning. NFCI. — rksimon / ViewSVN
  34. Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warnings. NFCI. — rksimon / ViewSVN
  35. [Codegen] Alter the default promotion for saturating adds and subs

    The default promotion for the add_sat/sub_sat nodes currently does:
        ANY_EXTEND iN to iM
        SHL by M-N
        [US][ADD|SUB]SAT
        L/ASHR by M-N

    If the promoted add_sat or sub_sat node is not legal, this can produce code
    that effectively does a lot of shifting (and requiring large constants to be
    materialised) just to use the overflow flag. It is simpler to just do the
    saturation manually, using the higher bitwidth addition and a min/max against
    the saturating bounds. That is what this patch attempts to do.

    Differential Revision: https://reviews.llvm.org/D68926 — dmgreen / ViewSVN
  36. [AArch64][SVE] Implement unpack intrinsics

    Summary:
    Implements the following intrinsics:
      - int_aarch64_sve_sunpkhi
      - int_aarch64_sve_sunpklo
      - int_aarch64_sve_uunpkhi
      - int_aarch64_sve_uunpklo

    This patch also adds AArch64ISD nodes for UNPK instead of implementing
    the intrinsics directly, as they are required for a future patch which
    implements the sign/zero extension of legal vectors.

    This patch includes tests for the Subdivide2Argument type added by D67549

    Reviewers: sdesmalen, SjoerdMeijer, greened, rengolin, rovka

    Reviewed By: greened

    Subscribers: tschuett, kristof.beyls, rkruppe, psnobl, cfe-commits, llvm-commits

    Differential Revision: https://reviews.llvm.org/D67550 — kmclaughlin / ViewSVN
  37. [InstCombine] Fix miscompile bug in canEvaluateShuffled

    Summary:
    Add restrictions in canEvaluateShuffled to prevent that we for example
    transform

      %0 = insertelement <2 x i16> undef, i16 %a, i32 0
      %1 = srem <2 x i16> %0, <i16 2, i16 1>
      %2 = shufflevector <2 x i16> %1, <2 x i16> undef, <2 x i32> <i32 undef, i32 0>

    into

       %1 = insertelement <2 x i16> undef, i16 %a, i32 1
       %2 = srem <2 x i16> %1, <i16 undef, i16 2>

    as having an undef denominator makes the srem undefined (for all
    vector elements).

    Fixes: https://bugs.llvm.org/show_bug.cgi?id=43689

    Reviewers: spatel, lebedev.ri

    Reviewed By: spatel, lebedev.ri

    Subscribers: lebedev.ri, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69038 — bjope / ViewSVN
  38. [InstCombine] Pre-commit of test case showing miscompile bug in canEvaluateShuffled

    Adding the reproducer from  https://bugs.llvm.org/show_bug.cgi?id=43689,
    showing that instcombine is doing a bad transform. It transforms

      %0 = insertelement <2 x i16> undef, i16 %a, i32 0
      %1 = srem <2 x i16> %0, <i16 2, i16 1>
      %2 = shufflevector <2 x i16> %1, <2 x i16> undef, <2 x i32> <i32 undef, i32 0>

    into

       %1 = insertelement <2 x i16> undef, i16 %a, i32 1
       %2 = srem <2 x i16> %1, <i16 undef, i16 2>

    The undef denominator makes the whole srem undefined. — bjope / ViewSVN
  39. [WebAssembly] -pthread implies -target-feature +sign-ext

    Summary:
    The sign extension proposal was motivated by a desire to not have
    separate sign-extending atomic operations, so it is meant to be
    enabled when threads are used.

    Reviewers: aheejin, dschuff

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

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69075 — tlively / ViewSVN
  40. [X86] Emit KTEST when possible

    https://reviews.llvm.org/D69111 — davezarzycki / ViewSVN
  41. [lit] Move resolving of XFAIL result codes out of Test.setResult

    This will allow us to serialize just the result object instead of the
    whole lit.Test object back from the worker to the main lit process. — yln / ViewSVN
  42. [lit] worker.py: Improve code for executing a single test — yln / ViewSVN
  43. [IndVars] Factor out some common code into a utility function

    As requested in review of D69009 — reames / ViewSVN
  44. [Test] Precommit test for D69006 — reames / ViewSVN
  45. [analyzer] exploded-graph-rewriter: Fix typo in r375186. Unbreaks tests. — dergachev / ViewSVN
  46. [analyzer] Assign truly stable identifiers to exploded nodes.

    ExplodedGraph nodes will now have a numeric identifier stored in them
    which will keep track of the order in which the nodes were created
    and it will be fully deterministic both accross runs and across machines.

    This is extremely useful for debugging as it allows reliably setting
    conditional breakpoints by node IDs. — dergachev / ViewSVN
  47. [analyzer] Display cast kinds in program point dumps.

    Because cast expressions have their own hierarchy, it's extremely useful
    to have some information about what kind of casts are we dealing with. — dergachev / ViewSVN
  48. [analyzer] exploded-graph-rewriter: Make node headers a bit lighter.

    The 50% grey color is too dark on some monitors. — dergachev / ViewSVN
  49. DebugInfo: Move loclist base address from DwarfFile to DebugLocStream

    There's no need to have more than one of these (there can be two
    DwarfFiles - one for the .o, one for the .dwo - but only one loc/loclist
    section (either in the .o or the .dwo) & certainly one per
    DebugLocStream, which is currently singular in DwarfDebug) — dblaikie / ViewSVN

#5546 (Oct 17, 2019 3:37:33 PM)

  1. DebugInfo: Remove unused parameter (from DwarfDebug.cpp:emitListsTableHeaderStart) — dblaikie / ViewSVN
  2. [ARM] Fix arm_neon.h with -flax-vector-conversions=none, part 3

    It's completely impossible to check that I've actually found all the
    issues, due to the use of macros in arm_neon.h, but hopefully this time
    it'll take more than a few hours for someone to find another issue.

    I have no idea why, but apparently there's a rule that some, but not
    all, builtins which should take an fp16 vector actually take an int8
    vector as an argument.  Fix this, and add test coverage.

    Differential Revision: https://reviews.llvm.org/D68838 — efriedma / ViewSVN
  3. Reland [llvm-objdump] Use a counter for llvm-objdump -h instead of the section index.

    This relands r374931 (reverted in r375088). It fixes 32-bit builds by using the right format string specifier for uint64_t (PRIu64) instead of `%d`.

    Original description:

    When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).

    While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.

    Reviewers: grimar, jhenderson, espindola

    Reviewed By: grimar

    Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68848 — rupprecht / ViewSVN
  4. [clang-offload-wrapper][NFC] Use captured name of the entry type in LIT test

    Differential Revision: https://reviews.llvm.org/D69140 — sdmitriev / ViewSVN
  5. [Error] Make llvm::cantFail include the original error messages

    Summary:
    The current implementation eats the current errors and just outputs
    the message parameter passed to llvm::cantFail.  This change appends
    the original error message(s), so the user can see exactly why
    cantFail failed.  New logic is conditional on NDEBUG.

    Reviewed By: lhames

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69057 — dhinton / ViewSVN
  6. [AMDGPU] drop getIsFP td helper

    We already have isFloatType helper, and they are out of sync.
    Drop one and merge the type list.

    Differential Revision: https://reviews.llvm.org/D69138 — rampitec / ViewSVN
  7. [lit] Move computation of deadline up into base class — yln / ViewSVN
  8. [llvm-objcopy] Add support for shell wildcards

    Summary: GNU objcopy accepts the --wildcard flag to allow wildcard matching on symbol-related flags. (Note: it's implicitly true for section flags).

    The basic syntax is to allow *, ?, \, and [] which work similarly to how they work in a shell. Additionally, starting a wildcard with ! causes that wildcard to prevent it from matching a flag.

    Use an updated GlobPattern in libSupport to handle these patterns. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).

    Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap

    Reviewed By: MaskRay

    Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D66613 — rupprecht / ViewSVN
  9. [OPENMP]Dow not emit warnings for uninitialized loop counters.

    In OpenMP constructs all counters are initialized and we should not emit
    warnings about uninitialized privatized loop control variables. — abataev / ViewSVN
  10. libhwasan initialisation include kernel syscall ABI relaxation

    Summary:
    Until now AArch64 development has been on patched kernels that have an always
    on relaxed syscall ABI where tagged pointers are accepted.
    The patches that have gone into the mainline kernel rely on each process opting
    in to this relaxed ABI.

    This commit adds code to choose that ABI into __hwasan_init.

    The idea has already been agreed with one of the hwasan developers
    (http://lists.llvm.org/pipermail/llvm-dev/2019-September/135328.html).

    The patch ignores failures of `EINVAL` for Android, since there are older versions of the Android kernel that don't require this `prctl` or even have the relevant values.  Avoiding EINVAL will let the library run on them.

    I've tested this on an AArch64 VM running a kernel that requires this
    prctl, having compiled both with clang and gcc.

    Patch by Matthew Malcomson.

    Reviewers: eugenis, kcc, pcc

    Reviewed By: eugenis

    Subscribers: srhines, kristof.beyls, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68794 — eugenis / ViewSVN
  11. Reland "[lit] Synthesize artificial deadline"

    We always want to use a deadline when calling `result.await`.  Let's
    synthesize an artificial deadline (now plus one year) to simplify code
    and do less busy waiting.

    Thanks to Reid Kleckner for diagnosing that a deadline for of "positive
    infinity" does not work with Python 3 anymore.  See commit:
    4ff1e34b606d9a9fcfd8b8b5449a558315af94e5

    I tested this patch with Python 2 and Python 3. — yln / ViewSVN
  12. [Builtins] Downgrade duplicate source file warning from a fatal error to a warning.

    This is a follow up to r375150 to unbreak the `clang-ppc64be-linux` bot.
    The commit caused running the tests to fail due to

    ```
    llvm-lit:
    /home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/llvm/projects/compiler-rt/test/builtins/Unit/lit.cfg.py:116:
    fatal: builtins_source_features contains duplicates:
    ['librt_has_divtc3']
    ```

    This commit should be reverted once the build system bug for powerpc is
    fixed. — delcypher / ViewSVN
  13. [x86] add test for setcc to shift transform; NFC — spatel / ViewSVN
  14. [cmake] Pass external project source directories to sub-configures

    We're passing LLVM_EXTERNAL_PROJECTS to cross-compilation configures, so
    we also need to pass the source directories of those projects, otherwise
    configuration can fail from not finding them.

    Differential Revision: https://reviews.llvm.org/D69076 — smeenai / ViewSVN
  15. [Object] Fix the return type of getOffset/getSize

    Header64.offset/Header64.size are uint64_t, thus we should not
    truncate them to unit32_t. Moreover, there are a number of places
    where we sum the offset and the size (e.g. in various checks in MachOUniversal.cpp),
    the truncation causes issues since the offset/size can perfectly fit into uint32_t,
    while the sum overflows.

    Differential revision: https://reviews.llvm.org/D69126

    Test plan: make check-all — alexshap / ViewSVN
  16. [NFC][InstCombine] Some more preparatory cleanup for dropRedundantMaskingOfLeftShiftInput() — lebedevri / ViewSVN
  17. [PowerPC] Turn on CR-Logical reducer pass

    Quite a while ago, we implemented a pass that will reduce the number of
    CR-logical operations we emit. It does so by converting a CR-logical operation
    into a branch. We have kept this off by default because it seemed to cause a
    significant regression with one benchmark.
    However, that regression turned out to be due to a completely unrelated
    reason - AADB introducing a self-copy that is a priority-setting nop and it was
    just exacerbated by this pass.

    Now that we understand the reason for the only degradation, we can turn this
    pass on by default. We have long since fixed the cause for the degradation.

    Differential revision: https://reviews.llvm.org/D52431 — nemanjai / ViewSVN
  18. [Builtins] Provide a mechanism to selectively disable tests based on whether an implementation is provided by a builtin library.

    Summary:
    If a platform removes some builtin implementations (e.g. via the
    Darwin-excludes mechanism) then this can lead to test failures because
    the test expects an implementation to be available.

    To solve this lit features are added for each configuration based
    on which sources are included in the builtin library. The features
    are of the form `librt_has_<name>` where `<name>` is the name of the
    source file with the file extension removed. This handles C and
    assembly sources.

    With the lit features in place it is possible to make certain tests
    require them.

    Example:

    ```
    REQUIRES: librt_has_comparedf2
    ```

    All top-level tests in `test/builtins/Unit` (i.e. not under
    `arm`, `ppc`, and `riscv`) have been annotated with the appropriate
    `REQUIRES: librt_has_*` statement.

    rdar://problem/55520987

    Reviewers: beanz, steven_wu, arphaman, dexonsmith, phosek, thakis

    Subscribers: mgorny, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D68064 — delcypher / ViewSVN
  19. Reapply r375051: [support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places

    Reland r375051 (reverted in r375052) after fixing lld tests on Windows in r375126 and r375131.

    Original description: Update GlobPattern in libSupport to handle a few more cases. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).

    This will be used to implement the `--wildcard` flag in llvm-objcopy to be more compatible with GNU objcopy.

    This is split off of D66613 to land the libSupport changes separately. The llvm-objcopy part will land soon.

    Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap

    Reviewed By: MaskRay

    Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D66613 — rupprecht / ViewSVN
  20. NFC: Fix variable only used in asserts by propagating the value.

    Summary:
    This fixes builds with assertions disabled that would otherwise
    fail with unused variable warnings

    Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69123 — saugustine / ViewSVN
  21. [asan] Update Windows test expectations for LLVM's MS demangler

    After r375041 llvm-symbolizer uses it for demangling instead of
    UnDecorateSymbolName. LLVM puts spaces after commas while Microsoft does
    not. — rnk / ViewSVN
  22. Revert [lit] Synthesize artificial deadline

    Python on Windows raises this OverflowError:
          gotit = waiter.acquire(True, timeout)
      OverflowError: timestamp too large to convert to C _PyTime_t

    So it seems this API behave the same way on every OS.

    Also reverts the dependent commit a660dc590a5e8dafa1ba6ed56447ede151d17bd9. — rnk / ViewSVN
  23. [PowerPC] add tests for popcount with zext; NFC — spatel / ViewSVN
  24. [IndVars] Split loop predication out of optimizeLoopExits [NFC]

    In the process of writing D69009, I realized we have two distinct sets of invariants within this single function, and basically no shared logic.  The optimize loop exit transforms (including the new one in D69009) only care about *analyzeable* exits.  Loop predication, on the other hand, has to reason about *all* exits.  At the moment, we have the property (due to the requirement for an exact btc) that all exits are analyzeable, but that will likely change in the future as we add widenable condition support. — reames / ViewSVN
  25. [codeview] Workaround for PR43479, don't re-emit instr labels

    Summary:
    In the long run we should come up with another mechanism for marking
    call instructions as heap allocation sites, and remove this workaround.
    For now, we've had two bug reports about this, so let's apply this
    workaround. SLH (the other client of instruction labels) probably has
    the same bug, but the solution there is more likely to be to mark the
    call instruction as not duplicatable, which doesn't work for debug info.

    Reviewers: akhuang

    Subscribers: aprantl, hiraditya, aganea, chandlerc, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69068 — rnk / ViewSVN
  26. Revert [Sanitizers] Add support for RISC-V 64-bit

    This reverts r375132 (git commit 00bbe990c5d4472d5413479a539b3d6edbb3ca7a) — lenary / ViewSVN
  27. [NFC][InstCombine] Tests for "fold variable mask before variable shift-of-trunc" (PR42563)

    https://bugs.llvm.org/show_bug.cgi?id=42563 — lebedevri / ViewSVN
  28. [OPENMP]Improve use of the global tid parameter.

    If we can determined, that the global tid parameter can be used in the
    function, better to use it rather than calling __kmpc_global_thread_num
    function. — abataev / ViewSVN
  29. [IndVars] Factor out a helper function for readability [NFC] — reames / ViewSVN
  30. [Sanitizers] Add support for RISC-V 64-bit

    Summary:
    This has been tested with gcc trunk on openSUSE Tumbleweed on the HiFive Unleashed.

    Patch by Andreas Schwab (schwab)

    Reviewers: luismarques

    Reviewed By: luismarques

    Subscribers: mhorne, emaste, luismarques, asb, mgorny, fedor.sergeev, simoncook, kito-cheng, shiva0217, rogfer01, rkruppe, lenary, s.egerton, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D66870 — lenary / ViewSVN
  31. [lit] Move computation of deadline up into base class — yln / ViewSVN
  32. [lit] Synthesize artificial deadline

    We always want to use a deadline when calling `result.await`.  Let's
    synthesize an artificial deadline (positive infinity) to simplify code
    and do less busy waiting. — yln / ViewSVN
  33. [lit] Create derived classes for serial/parallel test runs

    The hope is that with a little OO we can nicely factor out the
    differences. — yln / ViewSVN
  34. [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object
    pointer types.

    For example, in Objective-C mode, the initialization of 'x' in:
    ```
      @implementation MyType
      + (void)someClassMethod {
        MyType *x = self;
      }
      @end
    ```
    is correctly diagnosed with an incompatible-pointer-types warning, but
    in Objective-C++ mode, it is not diagnosed at all -- even though
    incompatible pointer conversions generally become an error in C++.

    This patch fixes that oversight, allowing implicit conversions
    involving Class only to/from unqualified-id, and between qualified and
    unqualified Class, where the protocols are compatible.

    Note that this does change some behaviors in Objective-C, as well, as
    shown by the modified tests.

    Of particular note is that assignment from from 'Class<MyProtocol>' to
    'id<MyProtocol>' now warns. (Despite appearances, those are not
    compatible types. 'Class<MyProtocol>' is not expected to have instance
    methods defined by 'MyProtocol', while 'id<MyProtocol>' is.)

    Differential Revision: https://reviews.llvm.org/D67983 — jyknight / ViewSVN
  35. [ObjC] Add some additional test cases around pointer conversions.

    This is especially important for Objective-C++, which is entirely
    missing this testing at the moment.

    This annotates with "FIXME" the cases which I change in the next
    patch -- I primarily wanted to document the current state of things so
    that the effect of the code change is made clear.

    Differential Revision: https://reviews.llvm.org/D67982 — jyknight / ViewSVN
  36. Revert r375114: "[lit] Make internal diff work in pipelines"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  37. Revert r375116: "[lit] Extend internal diff to support `-` argument"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  38. [OPENMP]Fix thread id passed to outlined region in sequential parallel
    regions.

    The real global thread id must be passed to the outlined region instead
    of the zero thread id. — abataev / ViewSVN
  39. [OpenCL] Preserve addrspace in CGClass (PR43145)

    PR43145 revealed two places where Clang was attempting to create a
    bitcast without considering the address space of class types during
    C++ class code generation.

    Differential Revision: https://reviews.llvm.org/D68403 — svenvh / ViewSVN
  40. [clangd] Use our own relation kind.

    Summary:
    Move the RelationKind from Serialization.h to Relation.h. This patch doesn't
    introduce any breaking changes.

    Reviewers: kadircet

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68981 — hokein / ViewSVN
  41. [lit] Extend internal diff to support `-` argument

    When using lit's internal shell, RUN lines like the following
    accidentally execute an external `diff` instead of lit's internal
    `diff`:

    ```
    # RUN: program | diff file -
    ```

    Such cases exist now, in `clang/test/Analysis` for example.  We are
    preparing patches to ensure lit's internal `diff` is called in such
    cases, which will then fail because lit's internal `diff` doesn't
    recognize `-` as a command-line option.  This patch adds support for
    `-` to mean stdin.

    Reviewed By: probinson, rnk

    Differential Revision: https://reviews.llvm.org/D67643 — jdenny / ViewSVN
  42. [lit] Make internal diff work in pipelines

    When using lit's internal shell, RUN lines like the following
    accidentally execute an external `diff` instead of lit's internal
    `diff`:

    ```
    # RUN: program | diff file -
    # RUN: not diff file1 file2 | FileCheck %s
    ```

    Such cases exist now, in `clang/test/Analysis` for example.  We are
    preparing patches to ensure lit's internal `diff` is called in such
    cases, which will then fail because lit's internal `diff` cannot
    currently be used in pipelines and doesn't recognize `-` as a
    command-line option.

    To enable pipelines, this patch moves lit's `diff` implementation into
    an out-of-process script, similar to lit's `cat` implementation.  A
    follow-up patch will implement `-` to mean stdin.

    Reviewed By: probinson, stella.stamenova

    Differential Revision: https://reviews.llvm.org/D66574 — jdenny / ViewSVN
  43. [AIX] TOC pseudo expansion for 64bit large + 64bit small + 32bit large models

    This patch provides support for peudo ops including ADDIStocHA8, ADDIStocHA, LWZtocL,
    LDtoc, LDtocL for AIX, lowering them from MIR to assembly.

    Differential Revision: https://reviews.llvm.org/D68341 — xiangling_liao / ViewSVN
  44. [OpenCL] Add doc to describe OpenCL support

    The idea of this page is to document work in progress functionality
    and also describe the plan of future development work.

    Patch by Anastasia Stulova.

    Differential Revision: https://reviews.llvm.org/D69072 — svenvh / ViewSVN
  45. [mips] [builtins] Remove clear_mips_cache
    Differential Revision: https://reviews.llvm.org/D69021 — zjovanovic / ViewSVN
  46. [AMDGPU] Improve code size cost model

    Summary:
    Added estimation for zero size insertelement, extractelement
    and llvm.fabs operators.
    Updated inline/unroll parameters default values.

    Reviewers: rampitec, arsenm

    Reviewed By: arsenm

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68881 — dfukalov / ViewSVN
  47. [ARM][MVE] Enable truncating masked stores

    Allow us to generate truncating masked store which take v4i32 and
    v8i16 vectors and can store to v4i8, v4i16 and v8i8 and memory.
    Removed support for unaligned masked stores.

    Differential Revision: https://reviews.llvm.org/D68461 — sam_parker / ViewSVN
  48. [docs][llvm-ar] Fix option:: O after r375106

    docs-llvm-html fails => unknown option: O

    There are lots of formatting issues in the file but they will be fixed by D68998. — maskray / ViewSVN
  49. [llvm-ar] Implement the O modifier: display member offsets inside the archive

    Since GNU ar 2.31, the 't' operation prints member offsets beside file
    names if the 'O' modifier is specified. 'O' is ignored for thin
    archives.

    Reviewed By: gbreynoo, ruiu

    Differential Revision: https://reviews.llvm.org/D69087 — maskray / ViewSVN
  50. [llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not exist

    Exposed by D69041. If SHT_SYMTAB does not exist, ELFObjcopy.cpp:handleArgs will crash due
    to a null pointer dereference.

      for (const NewSymbolInfo &SI : Config.ELF->SymbolsToAdd) {
        ...
        Obj.SymbolTable->addSymbol(

    Fix this by creating .symtab and .strtab on demand in ELFBuilder<ELFT>::readSections,
    if --add-symbol is specified.

    Reviewed By: grimar

    Differential Revision: https://reviews.llvm.org/D69093 — maskray / ViewSVN
  51. Include leading attributes in DeclStmt's SourceRange

    Differential Revision: https://reviews.llvm.org/D68581 — sberg / ViewSVN
  52. JumpThreadingPass::UnfoldSelectInstr - silence static analyzer dyn_cast<> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. — rksimon / ViewSVN
  53. clang-tidy - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  54. SemaExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  55. [LoopIdiom] BCmp: check, not assert that loop exits exit out of the loop (PR43687)

    We can't normally stumble into that assertion because a tautological
    *conditional* `br` in loop body is required, one that always
    branches to loop latch. But that should have been always folded
    to an unconditional branch before we get it.
    But that is not guaranteed if the pass is run standalone.
    So let's just promote the assertion into a proper check.

    Fixes https://bugs.llvm.org/show_bug.cgi?id=43687 — lebedevri / ViewSVN
  56. SemaDeclObjC - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  57. [llvm-readobj] - Refine the LLVM-style output to be consistent.

    Our LLVM-style output was inconsistent.
    This patch changes the output in the following way:

    SHT_GNU_verdef { -> VersionDefinitions [
    SHT_GNU_verneed { -> VersionRequirements [
    Version symbols [ -> VersionSymbols [
    EH_FRAME Header [ -> EHFrameHeader {

    Differential revision: https://reviews.llvm.org/D68636 — grimar / ViewSVN
  58. Reland: Dead Virtual Function Elimination

    Remove dead virtual functions from vtables with
    replaceNonMetadataUsesWith, so that CGProfile metadata gets cleaned up
    correctly.

    Original commit message:

    Currently, it is hard for the compiler to remove unused C++ virtual
    functions, because they are all referenced from vtables, which are referenced
    by constructors. This means that if the constructor is called from any live
    code, then we keep every virtual function in the final link, even if there
    are no call sites which can use it.

    This patch allows unused virtual functions to be removed during LTO (and
    regular compilation in limited circumstances) by using type metadata to match
    virtual function call sites to the vtable slots they might load from. This
    information can then be used in the global dead code elimination pass instead
    of the references from vtables to virtual functions, to more accurately
    determine which functions are reachable.

    To make this transformation safe, I have changed clang's code-generation to
    always load virtual function pointers using the llvm.type.checked.load
    intrinsic, instead of regular load instructions. I originally tried writing
    this using clang's existing code-generation, which uses the llvm.type.test
    and llvm.assume intrinsics after doing a normal load. However, it is possible
    for optimisations to obscure the relationship between the GEP, load and
    llvm.type.test, causing GlobalDCE to fail to find virtual function call
    sites.

    The existing linkage and visibility types don't accurately describe the scope
    in which a virtual call could be made which uses a given vtable. This is
    wider than the visibility of the type itself, because a virtual function call
    could be made using a more-visible base class. I've added a new
    !vcall_visibility metadata type to represent this, described in
    TypeMetadata.rst. The internalization pass and libLTO have been updated to
    change this metadata when linking is performed.

    This doesn't currently work with ThinLTO, because it needs to see every call
    to llvm.type.checked.load in the linkage unit. It might be possible to
    extend this optimisation to be able to use the ThinLTO summary, as was done
    for devirtualization, but until then that combination is rejected in the
    clang driver.

    To test this, I've written a fuzzer which generates random C++ programs with
    complex class inheritance graphs, and virtual functions called through object
    and function pointers of different types. The programs are spread across
    multiple translation units and DSOs to test the different visibility
    restrictions.

    I've also tried doing bootstrap builds of LLVM to test this. This isn't
    ideal, because only classes in anonymous namespaces can be optimised with
    -fvisibility=default, and some parts of LLVM (plugins and bugpoint) do not
    work correctly with -fvisibility=hidden. However, there are only 12 test
    failures when building with -fvisibility=hidden (and an unmodified compiler),
    and this change does not cause any new failures for either value of
    -fvisibility.

    On the 7 C++ sub-benchmarks of SPEC2006, this gives a geomean code-size
    reduction of ~6%, over a baseline compiled with "-O2 -flto
    -fvisibility=hidden -fwhole-program-vtables". The best cases are reductions
    of ~14% in 450.soplex and 483.xalancbmk, and there are no code size
    increases.

    I've also run this on a set of 8 mbed-os examples compiled for Armv7M, which
    show a geomean size reduction of ~3%, again with no size increases.

    I had hoped that this would have no effect on performance, which would allow
    it to awlays be enabled (when using -fwhole-program-vtables). However, the
    changes in clang to use the llvm.type.checked.load intrinsic are causing ~1%
    performance regression in the C++ parts of SPEC2006. It should be possible to
    recover some of this perf loss by teaching optimisations about the
    llvm.type.checked.load intrinsic, which would make it worth turning this on
    by default (though it's still dependent on -fwhole-program-vtables).

    Differential revision: https://reviews.llvm.org/D63932 — ostannard / ViewSVN
  59. Try to fix the assert in Alignment::alignAddr to work on 32-bit

    Hopefully fixing the AlignmentDeathTest.AlignAddr failures (e.g. at
    http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10925) — hans / ViewSVN
  60. [Analysis] Don't assume that unsigned overflow can't happen in EmitGEPOffset (PR42699)

    Summary:
    Currently when computing a GEP offset using the function EmitGEPOffset
    for the following instruction

      getelementptr inbounds i32, i32* %p, i64 %offs

    we get

      mul nuw i64 %offs, 4

    Unfortunately we cannot assume that unsigned wrapping won't happen
    here because %offs is allowed to be negative.

    Making such assumptions can lead to miscompilations: see the new test
    test24_neg_offs in InstCombine/icmp.ll. Without the patch InstCombine
    would generate the following comparison:

       icmp eq i64 %offs, 4611686018427387902; 0x3ffffffffffffffe

    Whereas the correct value to compare with is -2.

    This patch replaces the NUW flag with NSW in the multiplication
    instructions generated by EmitGEPOffset and adjusts the test suite.

    https://bugs.llvm.org/show_bug.cgi?id=42699

    Reviewers: chandlerc, craig.topper, ostannard, lebedev.ri, spatel, efriedma, nlopes, aqjune

    Reviewed By: lebedev.ri

    Subscribers: reames, lebedev.ri, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68342 — miyuki / ViewSVN
  61. Revert r374931 "[llvm-objdump] Use a counter for llvm-objdump -h instead of the section index."

    This broke llvm-objdump in 32-bit builds, see e.g.
    http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10925

    > Summary:
    > When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).
    >
    > While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.
    >
    > Reviewers: grimar, jhenderson, espindola
    >
    > Reviewed By: grimar
    >
    > Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay
    >
    > Tags: #llvm
    >
    > Differential Revision: https://reviews.llvm.org/D68848 — hans / ViewSVN
  62. [ARM][MVE] Change VPST to use, not def, VPR

    Unlike VPT, VPST just uses the current value of VPR.P0.

    Differential Revision: https://reviews.llvm.org/D69037 — sam_parker / ViewSVN
  63. [DFAPacketizer] Use DFAEmitter. NFC.

    Summary:
    This is a NFC change that removes the NFA->DFA construction and emission logic from DFAPacketizerEmitter and instead uses the generic DFAEmitter logic. This allows DFAPacketizer to use the Automaton class from Support and remove a bunch of logic there too.

    After this patch, DFAPacketizer is mostly logic for grepping Itineraries and collecting functional units, with no state machine logic. This will allow us to modernize by removing the 16-functional-unit limit and supporting non-itinerary functional units. This is all for followup patches.

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68992 — jamesm / ViewSVN
  64. [DAGCombine][ARM] Enable extending masked loads

    Add generic DAG combine for extending masked loads.

    Allow us to generate sext/zext masked loads which can access v4i8,
    v8i8 and v4i16 memory to produce v4i32, v8i16 and v4i32 respectively.

    Differential Revision: https://reviews.llvm.org/D68337 — sam_parker / ViewSVN
  65. [Alignment][NFC] Use Align for TargetFrameLowering/Subtarget

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68993 — gchatelet / ViewSVN
  66. [ThinLTO] Import virtual method with single implementation in hybrid mode

    Differential revision: https://reviews.llvm.org/D68782 — evgeny777 / ViewSVN
  67. [llvm-ar] Simplify and make two global variables static. NFC — maskray / ViewSVN
  68. Revert "Include sanitize blacklist and other extra deps as part of scan-deps output"

    This test is failing on Windows bots, revert for now (will check the right fix and retry the patch).

    Summary: This reverts commit 962ca076e51c25a7a08f4e0d329c65328a635bdb.

    Reviewers: Bigcheese, jkorous, arphaman

    Subscribers: dexonsmith, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69079 — kousikk / ViewSVN

#5545 (Oct 16, 2019 8:37:16 PM)

  1. Clang-formatting of some files in LiveRangeCalc header (LiveRangeCalc.h)

    NFC — mggm / ViewSVN
  2. Move LiveRangeCalc header to publicily available position. NFC

    Differential Revision: https://reviews.llvm.org/D69078 — mggm / ViewSVN
  3. Include sanitize blacklist and other extra deps as part of scan-deps output

    Summary:
    Clang's -M mode includes these extra dependencies in its output and clang-scan-deps
    should have equivalent behavior, so adding these extradeps to output just like
    how its being done for ".d" file generation mode.

    Reviewers: arphaman, dexonsmith, Bigcheese, jkorous

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69017 — kousikk / ViewSVN
  4. Correct placement of #ifndef NDEBUG in r375067 — dsanders / ViewSVN
  5. Fix unused variable in r375066 — dsanders / ViewSVN
  6. Revert Tag CFI-generated data structures with "#pragma clang section" attributes.

    This reverts r375022 (git commit e2692b3bc0327606748b6d291b9009d2c845ced5) — dmikulin / ViewSVN
  7. [gicombiner] Add the run-time rule disable option

    Summary:
    Each generated helper can be configured to generate an option that disables
    rules in that helper. This can be used to bisect rulesets.

    The disable bits are stored in a SparseVector as this is very cheap for the
    common case where nothing is disabled. It gets more expensive the more rules
    are disabled but you're generally doing that for debug purposes where
    performance is less of a concern.

    Depends on D68426

    Reviewers: volkan, bogner

    Reviewed By: volkan

    Subscribers: hiraditya, Petar.Avramovic, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68438 — dsanders / ViewSVN
  8. [GISel][CombinerHelper] Add concat_vectors(build_vector, build_vector) => build_vector

    Teach the combiner helper how to flatten concat_vectors of build_vectors
    into a build_vector.

    Add this combine as part of AArch64 pre-legalizer combiner.

    Differential Revision: https://reviews.llvm.org/D69071 — qcolombet / ViewSVN
  9. [lit] Improve lit.Run class

    * Push timing of overall test time into run module
    * Make lit.Run a proper class
    * Add a few TODO comments — yln / ViewSVN
  10. [Concepts] ConceptSpecializationExprs mangling

    Implement mangling for CSEs to match regular template-ids.
    Reviewed as part of D41569 <https://reviews.llvm.org/D41569>.

    Re-commit fixing failing test. — saar.raz / ViewSVN
  11. [lit] Fix another test case that r374652 missed — jdenny / ViewSVN
  12. [gicombiner] Hoist pure C++ combine into the tablegen definition

    Summary:
    This is just moving the existing C++ code around and will be NFC w.r.t
    AArch64. Renamed 'CombineBr' to something more descriptive
    ('ElideByByInvertingCond') at the same time.

    The remaining combines in AArch64PreLegalizeCombiner require features that
    aren't implemented at this point and will be hoisted as they are added.

    Depends on D68424

    Reviewers: bogner, volkan

    Subscribers: kristof.beyls, hiraditya, Petar.Avramovic, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68426 — dsanders / ViewSVN
  13. [lit] Remove unnecessary usage of lit.Run — yln / ViewSVN
  14. [lit] Do not create semaphores when we do not need them

    Parallelism groups and semaphores are only required for parallel
    execution. — yln / ViewSVN
  15. [lit] Factor out separate methods for parallel and serial execution — yln / ViewSVN
  16. [NFC] Fix unused var in release builds — rupprecht / ViewSVN
  17. Revert [support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places

    This reverts r375051 (git commit a409afaad64ce83ea44cc30ee5f96b6e613a6e98)

    The patch does not work on Windows due to `\` in filenames being interpreted as escaping rather than literal path separators when used by lld linker scripts. — rupprecht / ViewSVN
  18. [support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places

    Summary: Update GlobPattern in libSupport to handle a few more cases. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).

    This will be used to implement the `--wildcard` flag in llvm-objcopy to be more compatible with GNU objcopy.

    This is split off of D66613 to land the libSupport changes separately. The llvm-objcopy part will land soon.

    Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap

    Reviewed By: MaskRay

    Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits

    Tags: #llvm

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

    undo objcopy changes to make this libsupport only — rupprecht / ViewSVN
  19. [Utils] Cleanup similar cases to MergeBlockIntoPredecessor.

    Summary:
    There are two cases where a block is merged into its predecessor and the
    MergeBlockIntoPredecessor API is not used. Update the API so it can be
    reused in the other cases, in order to avoid code duplication.

    Cleanup motivated by D68659.

    Reviewers: chandlerc, sanjoy.google, george.burgess.iv

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68670 — asbirlea / ViewSVN
  20. [lit] Print warning if we fail to delete temp directory — yln / ViewSVN
  21. [lit] Skip creation of tmp dir if we don't actually run any tests — yln / ViewSVN
  22. [lit] Remove return value from print_summary function — yln / ViewSVN
  23. [lit] Small refactoring and cleanups in main.py

    * Remove outdated precautions for Python versions < 2.7
    * Remove dead code related to `maxIndividualTestTime` option
    * Move printing of test and result summary out of main into its own
      function

    Reviewed By: rnk

    Differential Revision: https://reviews.llvm.org/D68847 — yln / ViewSVN
  24. Update ReleaseNotes: expand the section on enabling MemorySSA — asbirlea / ViewSVN
  25. [dsymutil] Print warning/error for unknown/missing arguments.

    After changing dsymutil to use libOption, we lost error reporting for
    missing required arguments (input files). Additionally, we stopped
    complaining about unknown arguments. This patch fixes both and adds a
    test. — Jonas Devlieghere / ViewSVN
  26. [AArch64] Fix offset calculation

    r374772 changed Offset to be an int64_t but left NewOffset as an int.
    Scale is unsigned, so in the calculation `Offset - NewOffset * Scale`,
    `NewOffset * Scale` was promoted to unsigned and was then zero-extended
    to 64 bits, leading to an incorrect computation which manifested as an
    out-of-memory when building the Swift standard library for Android
    aarch64. Promote NewOffset to int64_t to fix this, and promote
    EmittableOffset as well, since its one user passes it to a function
    which takes an int64_t anyway.

    Test case based on a suggestion by Sander de Smalen!

    Differential Revision: https://reviews.llvm.org/D69018 — smeenai / ViewSVN
  27. GlobalISel: Implement lower for G_SADDO/G_SSUBO

    Port directly from SelectionDAG, minus the path using
    ISD::SADDSAT/ISD::SSUBSAT. — arsenm / ViewSVN
  28. [Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC.

    This allows making a couple llvm-symbolizer tests run in all
    environments.

    Differential Revision: https://reviews.llvm.org/D68133 — mstorsjo / ViewSVN
  29. Remove a stale comment, noted in post commit review for rL375038 — reames / ViewSVN
  30. [clangd] Add the missing dependency on `clangLex`. — hliao / ViewSVN
  31. [IndVars] Fix a miscompile in off-by-default loop predication implementation

    The problem is that we can have two loop exits, 'a' and 'b', where 'a' and 'b' would exit at the same iteration, 'a' precedes 'b' along some path, and 'b' is predicated while 'a' is not. In this case (see the previously submitted test case), we causing the loop to exit through 'b' whereas it should have exited through 'a'.

    This only applies to loop exits where the exit counts are not provably inequal, but that isn't as much of a restriction as it appears. If we could order the exit counts, we'd have already removed one of the two exits. In theory, we might be able to prove inequality w/o ordering, but I didn't really explore that piece. Instead, I went for the obvious restriction and ensured we didn't predicate exits following non-predicateable exits.

    Credit goes to Evgeny Brevnov for figuring out the problematic case. Fuzzing probably also found it (failures seen), but due to some silly infrastructure problems I hadn't gotten to the results before Evgeny hand reduced it from a benchmark (he manually enabled the transform). Once this is fixed, I'll try to filter through the fuzzer failures to see if there's anything additional lurking.

    Differential Revision https://reviews.llvm.org/D68956 — reames / ViewSVN
  32. [AMDGPU] Do not combine dpp mov reading physregs

    We cannot be sure physregs will stay unchanged.

    Differential Revision: https://reviews.llvm.org/D69065 — rampitec / ViewSVN
  33. Replace platform-dependent `stat` with `llvm::sys::fs::status`. NFC intended.

    Reviewers: bruno, sammccall

    Reviewed By: sammccall

    Subscribers: jkorous, dexonsmith, arphaman, ributzka, cfe-commits

    Differential Revision: https://reviews.llvm.org/D69011 — vsapsai / ViewSVN
  34. [AMDGPU] Do not combine dpp with physreg def

    We will remove dpp mov along with the physreg def otherwise.

    Differential Revision: https://reviews.llvm.org/D69063 — rampitec / ViewSVN
  35. [llvm-ar] Implement the V modifier as an alias for --version

    Summary: Also update the help modifier (h) so that it works as a modifier and not just as a standalone `h`. For example, `llvm-ar h` prints the help message, but `llvm-ar xh` currently prints `unknown option h`.

    Reviewers: MaskRay, gbreynoo

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69007 — rupprecht / ViewSVN
  36. Fix darwin-ld-lto test for some speical path

    Fix the test by not assuming the prefix path of the temp directory can
    be matched by a regex.

    rdar://problem/56259195 — steven_wu / ViewSVN
  37. [OPENMP]Allow priority clause in combined task-based directives.

    The expression of the priority clause must be captured in the combined
    task-based directives, like 'parallel master taskloop' directive. — abataev / ViewSVN
  38. [SLP] avoid reduction transform on patterns that the backend can load-combine (2nd try)

    The 1st attempt at this modified the cost model in a bad way to avoid the vectorization,
    but that caused problems for other users (the loop vectorizer) of the cost model.

    I don't see an ideal solution to these 2 related, potentially large, perf regressions:
    https://bugs.llvm.org/show_bug.cgi?id=42708
    https://bugs.llvm.org/show_bug.cgi?id=43146

    We decided that load combining was unsuitable for IR because it could obscure other
    optimizations in IR. So we removed the LoadCombiner pass and deferred to the backend.
    Therefore, preventing SLP from destroying load combine opportunities requires that it
    recognizes patterns that could be combined later, but not do the optimization itself (
    it's not a vector combine anyway, so it's probably out-of-scope for SLP).

    Here, we add a cost-independent bailout with a conservative pattern match for a
    multi-instruction sequence that can probably be reduced later.

    In the x86 tests shown (and discussed in more detail in the bug reports), SDAG combining
    will produce a single instruction on these tests like:

      movbe   rax, qword ptr [rdi]

    or:

      mov     rax, qword ptr [rdi]

    Not some (half) vector monstrosity as we currently do using SLP:

      vpmovzxbq       ymm0, dword ptr [rdi + 1] # ymm0 = mem[0],zero,zero,..
      vpsllvq ymm0, ymm0, ymmword ptr [rip + .LCPI0_0]
      movzx   eax, byte ptr [rdi]
      movzx   ecx, byte ptr [rdi + 5]
      shl     rcx, 40
      movzx   edx, byte ptr [rdi + 6]
      shl     rdx, 48
      or      rdx, rcx
      movzx   ecx, byte ptr [rdi + 7]
      shl     rcx, 56
      or      rcx, rdx
      or      rcx, rax
      vextracti128    xmm1, ymm0, 1
      vpor    xmm0, xmm0, xmm1
      vpshufd xmm1, xmm0, 78          # xmm1 = xmm0[2,3,0,1]
      vpor    xmm0, xmm0, xmm1
      vmovq   rax, xmm0
      or      rax, rcx
      vzeroupper
      ret

    Differential Revision: https://reviews.llvm.org/D67841 — spatel / ViewSVN
  39. [lit] Fix a test case that r374652 missed — jdenny / ViewSVN
  40. Tag CFI-generated data structures with "#pragma clang section" attributes.

    Differential Revision: https://reviews.llvm.org/D68808 — dmikulin / ViewSVN
  41. [NFC][XCOFF][AIX] Rename ControlSections to CsectGroup

    The name of ControlSections is not expressive enough to convey what they really are.
    CsectGroup can better communicate the concept of grouping csects together since they have similar property.

    Reviewer: daltenty

    Differential Revision: https://reviews.llvm.org/D69001 — jasonliu / ViewSVN
  42. [lit] Fix internal diff's --strip-trailing-cr and use it

    Using GNU diff, `--strip-trailing-cr` removes a `\r` appearing before
    a `\n` at the end of a line.  Without this patch, lit's internal diff
    only removes `\r` if it appears as the last character.  That seems
    useless.  This patch fixes that.

    This patch also adds `--strip-trailing-cr` to some tests that fail on
    Windows bots when D68664 is applied.  Based on what I see in the bot
    logs, I think the following is happening.  In each test there, lit
    diff is comparing a file with `\r\n` line endings to a file with `\n`
    line endings.  Without D68664, lit diff reads those files in text
    mode, which in Windows causes `\r\n` to be replaced with `\n`.
    However, with D68664, lit diff reads the files in binary mode instead
    and thus reports that every line is different, just as GNU diff does
    (at least under Ubuntu).  Adding `--strip-trailing-cr` to those tests
    restores the previous behavior while permitting the behavior of lit
    diff to be more like GNU diff.

    Reviewed By: rnk

    Differential Revision: https://reviews.llvm.org/D68839 — jdenny / ViewSVN
  43. CombinerHelper - silence dead assignment warnings. NFCI.

    Copy the NewAlignment value to Alignment first and then use that to update the stack frame object alignments. — rksimon / ViewSVN
  44. [lit] Clean up internal diff's encoding handling

    As suggested by rnk at D67643#1673043, instead of reading files
    multiple times until an appropriate encoding is found, read them once
    as binary, and then try to decode what was read.

    For Python >= 3.5, don't fail when attempting to decode the
    `diff_bytes` output in order to print it.

    Avoid failures for Python 2.7 used on some Windows bots by
    transforming diff output with `lit.util.to_string` before writing it
    to stdout.

    Finally, add some tests for encoding handling.

    Reviewed By: rnk

    Differential Revision: https://reviews.llvm.org/D68664 — jdenny / ViewSVN
  45. [OPENMP]Use different addresses for zeroed thread_id/bound_id.

    When the parallel region is called directly in the sequential region,
    the zeroed tid/bound id are used. But they must point to the different
    memory locations as the parameters are marked as noalias. — abataev / ViewSVN
  46. [AMDGPU] Supress unused sdwa insts generation

    Do not generate non-existing sdwa instructions. It reduces the
    number of generated instructions by 185.

    Differential Revision: https://reviews.llvm.org/D69010 — rampitec / ViewSVN
  47. [Remarks] Fix warning for ambigous `else` behind EXPECT macro

    http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/31902/steps/ninja%20check%201/logs/stdio — thegameg / ViewSVN
  48. [Remarks] Fix unit test by only checking for the path

    http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/39536/steps/ninja%20check%201/logs/FAIL%3A%20LLVM-Unit%3A%3AYAMLRemarks.ParsingBadMeta — thegameg / ViewSVN
  49. [SVE][IR] Small TypeSize improvements left out of initial commit

    The commit for D53137 left out the last round of improvements
    requested by reviewers. Adding those in now. — huntergr / ViewSVN
  50. [DWARF5] Added support for DW_AT_noreturn attribute to be emitted for
    C++ class member functions.

    Patch by Sourabh Singh Tomar!

    Differential Revision: https://reviews.llvm.org/D68697 — Adrian Prantl / ViewSVN
  51. [Remarks] Use StringRef::contains to avoid differences in error string

    Different OSs have different error strings:

    http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/39534/steps/ninja%20check%201/logs/FAIL%3A%20LLVM-Unit%3A%3AYAMLRemarks.ParsingBadMeta — thegameg / ViewSVN
  52. [AArch64,Assembler] Compiler support for ID_MMFR5_EL1

    Summary: Add read-only system register ID_MMFR5_EL1 and unit tests.

    Subscribers: kristof.beyls, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69039 — markrvmurray / ViewSVN
  53. [Codegen] Adjust saturation test. NFC.

    Add some extra sat tests and adjust some of the existing tests to use signext where it would naturally be. — dmgreen / ViewSVN
  54. [Remarks] Add support for prepending a path to external files

    This helps with testing and debugging for paths that are assumed
    absolute.

    It also uses a FileError to provide the file path it's trying to open. — thegameg / ViewSVN
  55. bpf: fix wrong truncation elimination when there is back-edge/loop

    Currently, BPF backend is doing truncation elimination. If one truncation
    is performed on a value defined by narrow loads, then it could be redundant
    given BPF loads zero extend the destination register implicitly.

    When the definition of the truncated value is a merging value (PHI node)
    that could come from different code paths, then checks need to be done on
    all possible code paths.

    Above described optimization was introduced as r306685, however it doesn't
    work when there is back-edge, for example when loop is used inside BPF
    code.

    For example for the following code, a zero-extended value should be stored
    into b[i], but the "and reg, 0xffff" is wrongly eliminated which then
    generates corrupted data.

    void cal1(unsigned short *a, unsigned long *b, unsigned int k)
    {
      unsigned short e;

      e = *a;
      for (unsigned int i = 0; i < k; i++) {
        b[i] = e;
        e = ~e;
      }
    }

    The reason is r306685 was trying to do the PHI node checks inside isel
    DAG2DAG phase, and the checks are done on MachineInstr. This is actually
    wrong, because MachineInstr is being built during isel phase and the
    associated information is not completed yet. A quick search shows none
    target other than BPF is access MachineInstr info during isel phase.

    For an PHI node, when you reached it during isel phase, it may have all
    predecessors linked, but not successors. It seems successors are linked to
    PHI node only when doing SelectionDAGISel::FinishBasicBlock and this
    happens later than PreprocessISelDAG hook.

    Previously, BPF program doesn't allow loop, there is probably the reason
    why this bug was not exposed.

    This patch therefore fixes the bug by the following approach:
    - The existing truncation elimination code and the associated
       "load_to_vreg_" records are removed.
    - Instead, implement truncation elimination using MachineSSA pass, this
       is where all information are built, and keep the pass together with other
       similar peephole optimizations inside BPFMIPeephole.cpp. Redundant move
       elimination logic is updated accordingly.
    - Unit testcase included + no compilation errors for kernel BPF selftest.

    Patch Review
    ===
    Patch was sent to and reviewed by BPF community at:

      https://lore.kernel.org/bpf

    Reported-by: David Beckett <david.beckett@netronome.com>
    Reviewed-by: Yonghong Song <yhs@fb.com>
    Signed-off-by: Jiong Wang <jiong.wang@netronome.com> — jiwang / ViewSVN
  56. [RISCV] Add MachineInstr immediate verification

    Summary:
    This patch implements the `TargetInstrInfo::verifyInstruction` hook for RISC-V. Currently the hook verifies the machine instruction's immediate operands, to check if the immediates are within the expected bounds. Without the hook invalid immediates are not detected except when doing assembly parsing, so they are silently emitted (including being truncated when emitting object code).

    The bounds information is specified in tablegen by using the `OperandType` definition, which sets the `MCOperandInfo`'s `OperandType` field. Several RISC-V-specific immediate operand types were created, which extend the `MCInstrDesc`'s `OperandType` `enum`.

    To have the hook called with `llc` pass it the `-verify-machineinstrs` option. For Clang add the cmake build config `-DLLVM_ENABLE_EXPENSIVE_CHECKS=True`, or temporarily patch `TargetPassConfig::addVerifyPass`.

    Review concerns:

    - The patch adds immediate operand type checks that cover at least the base ISA. There are several other operand types for the C extension and one type for the F/D extensions that were left out of this initial patch because they introduced further design concerns that I felt were best evaluated separately.

    - Invalid register classes (e.g. passing a GPR register where a GPRC is expected) are already caught, so were not included.

    - This design makes the more abstract `MachineInstr` verification depend on MC layer definitions, which arguably is not the cleanest design, but is in line with how things are done in other parts of the target and LLVM in general.

    - There is some duplication of logic already present in the `MCOperandPredicate`s. Since the `MachineInstr` and `MCInstr` notions of immediates are fundamentally different, this is currently necessary.

    Reviewers: asb, lenary

    Reviewed By: lenary

    Subscribers: hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67397 — luismarques / ViewSVN
  57. [AMDGPU] Fix-up cases where writelane has 2 SGPR operands

    Summary:
    Even though writelane doesn't have the same constraints as other valu
    instructions it still can't violate the >1 SGPR operand constraint

    Due to later register propagation (e.g. fixing up vgpr operands via
    readfirstlane) changing writelane to only have a single SGPR is tricky.

    This implementation puts a new check after SIFixSGPRCopies that prevents
    multiple SGPRs being used in any writelane instructions.

    The algorithm used is to check for trivial copy prop of suitable constants into
    one of the SGPR operands and perform that if possible. If this isn't possible
    put an explicit copy of Src1 SGPR into M0 and use that instead (this is
    allowable for writelane as the constraint is for SGPR read-port and not
    constant-bus access).

    Reviewers: rampitec, tpr, arsenm, nhaehnle

    Reviewed By: rampitec, arsenm, nhaehnle

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

    Tags: #llvm

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

    Change-Id: Ic7553fa57440f208d4dbc4794fc24345d7e0e9ea — dstuttard / ViewSVN
  58. [libTooling] Fix r374962: add more Transformer forwarding decls.

    Summary:
    The move to a new, single namespace in r374962 left out some type definitions
    from the old namespace and resulted in one naming conflict (`text`).  This
    revision adds aliases for those definitions and removes one of the `text`
    functions from the new namespace.

    Reviewers: alexfh

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69036 — ymandel / ViewSVN
  59. [llvm-ar] Make paths case insensitive when on windows

    When on windows gnu-ar treats member names as case insensitive. This
    commit implements the same behaviour.

    Differential Revision: https://reviews.llvm.org/D68033 — gbreynoo / ViewSVN
  60. [Driver,ARM] Make -mfloat-abi=soft turn off MVE.

    Since `-mfloat-abi=soft` is taken to mean turning off all uses of the
    FP registers, it should turn off the MVE vector instructions as well
    as NEON and scalar FP. But it wasn't doing so.

    So the options `-march=armv8.1-m.main+mve.fp+fp.dp -mfloat-abi=soft`
    would cause the underlying LLVM to //not// support MVE (because it
    knows the real target feature relationships and turned off MVE when
    the `fpregs` feature was removed), but the clang layer still thought
    it //was// supported, and would misleadingly define the feature macro
    `__ARM_FEATURE_MVE`.

    The ARM driver code already has a long list of feature names to turn
    off when `-mfloat-abi=soft` is selected. The fix is to add the missing
    entries `mve` and `mve.fp` to that list.

    Reviewers: dmgreen

    Subscribers: kristof.beyls, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D69025 — statham / ViewSVN
  61. [Alignment][NFC] Optimize alignTo

    Summary: A small optimization suggested by jakehehrlich@ in D64790.

    Reviewers: jakehehrlich, courbet

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69023 — gchatelet / ViewSVN
  62. RedirectingFileSystem::openFileForRead - replace bitwise & with boolean && to fix warning

    Seems to be just a typo - now matches other instances which do something similar — rksimon / ViewSVN
  63. RealFile - fix self-initialization warning in constructor. — rksimon / ViewSVN
  64. [InstCombine][AMDGPU] Fix crash with v3i16/v3f16 buffer intrinsics

    Summary:
    This is something of a workaround to avoid a crash later on in type
    legalizer (WidenVectorResult()).
    Also added some f16 tests, including a non-working v3f16 case with
    a FIXME.

    Reviewers: arsenm, tpr, nhaehnle

    Reviewed By: arsenm

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68865 — Piotr Sobczak / ViewSVN
  65. Revert "[HardwareLoops] Optimisation remarks"

    while I investigate the PPC build bot failures.

    This reverts commit ad763751565b9663bc338fa2ca5ade86c6ca22ec. — sjoerdmeijer / ViewSVN
  66. RewriteModernObjC - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  67. [ARM] Add a register class for GPR pairs without SP and use it. NFCI

    Summary:
    Currently Thumb2InstrInfo.cpp uses a register class which is
    auto-generated by tablegen. Such approach is fragile because
    auto-generated classes might change when other register classes are
    added. For example, before https://reviews.llvm.org/D62667
    we were using GPRPair_with_gsub_1_in_rGPRRegClass, but had to
    change it to GPRPair_with_gsub_1_in_GPRwithAPSRnospRegClass
    because the former class stopped being generated (this did not change
    the functionality though).

    This patch adds a register class consisting of even-odd GPR register
    pairs from (R0, R1) to (R10, R11), which excludes (R12, SP) and uses
    it in Thumb2InstrInfo.cpp instead of
    GPRPair_with_gsub_1_in_GPRwithAPSRnospRegClass.

    Reviewers: ostannard, simon_tatham, dmgreen, efriedma

    Reviewed By: simon_tatham

    Subscribers: kristof.beyls, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D69026 — miyuki / ViewSVN
  68. CGDebugInfo - silence static analyzer dyn_cast<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use cast<> directly and if not assert will fire for us. — rksimon / ViewSVN
  69. CGExprConstant - silence static analyzer getAs<> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  70. CGBuiltin - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  71. SimpleLoopUnswitch - fix uninitialized variable and null dereference warnings. NFCI. — rksimon / ViewSVN
  72. Revert 374967 "[Concepts] ConceptSpecializationExprs mangling"

    This reverts commit 5e34ad109ced8dbdea9500ee28180315b2aeba3d.

    The mangling test fails on Windows:
    http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15944

    It also fails on ppc64le:
    http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/21092

    Also revert follow-up  374971 "Fix failing mangle-concept.cpp test."
    (it did not help on Win/ppc64le). — nico / ViewSVN
  73. [AMDGPU] Extend the SI Load/Store optimizer

    Summary:
    Extend the SI Load/Store optimizer to merge MIMG load instructions. Handle
    different flavours of image_load and image_sample instructions.

    When the instructions of the same subclass differ only in dmask, merge
    them and update dmask accordingly.

    Reviewers: nhaehnle

    Reviewed By: nhaehnle

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D64911 — Piotr Sobczak / ViewSVN
  74. gn build: Merge r374982 — gnsyncbot / ViewSVN
  75. [clangd] Add RemoveUsingNamespace tweak.

    Summary:
    Removes the 'using namespace' under the cursor and qualifies all accesses in the current file.
    E.g.:
      using namespace std;
      vector<int> foo(std::map<int, int>);
    Would become:
      std::vector<int> foo(std::map<int, int>);

    Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68562 — usaxena95 / ViewSVN
  76. [ARM][ParallelDSP] Change smlad insertion order

    Instead of inserting everything after the 'root' of the reduction,
    insert all instructions as close to their operands as possible. This
    can help reduce register pressure.

    Differential Revision: https://reviews.llvm.org/D67392 — sam_parker / ViewSVN

#5544 (Oct 16, 2019 2:28:18 AM)

  1. [HardwareLoops] Optimisation remarks

    This adds the initial plumbing to support optimisation remarks in
    the IR hardware-loop pass.

    I have left a todo in a comment where we can improve the reporting,
    and will iterate on that now that we have this initial support in.

    Differential Revision: https://reviews.llvm.org/D68579 — sjoerdmeijer / ViewSVN
  2. [NFC] Replace a linked list in LiveDebugVariables pass with a DenseMap

    In LiveDebugVariables.cpp:
    Prior to this patch, UserValues were grouped into linked list chains. Each
    chain was the union of two sets: { A: Matching Source variable } or
    { B: Matching virtual register }. A ptr to the heads (or 'leaders')
    of each of these chains were kept in a map with the { Source variable } used
    as the key (set A predicate) and another with { Virtual register } as key
    (set B predicate).

    There was a search through the chains in the function getUserValue looking for
    UserValues with matching { Source variable, Complex expression, Inlined-at
    location }. Essentially searching for a subset of A through two interleaved
    linked lists of set A and B. Importantly, by design, the subset will only
    contain one or zero elements here. That is to say a UserValue can be uniquely
    identified by the tuple { Source variable, Complex expression, Inlined-at
    location } if it exists.

    This patch removes the linked list and instead uses a DenseMap to map
    the tuple { Source variable, Complex expression, Inlined-at location }
    to UserValue ptrs so that the getUserValue search predicate is this map key.
    The virtual register map now maps a vreg to a SmallVector<UserVal *> so that
    set B is still available for quick searches.

    Reviewers: aprantl, probinson, vsk, dblaikie

    Reviewed By: aprantl

    Subscribers: russell.gallop, gbedwell, bjope, hiraditya, llvm-commits

    Tags: #debug-info, #llvm

    Differential Revision: https://reviews.llvm.org/D68816 — orlandoch / ViewSVN
  3. [CMake] Disable building all Darwin libraries (except builtins) for macOS i386 when the SDK is >= 10.15.

    Summary:
    In the macOS 10.15 SDK the ability to link i386 binaries was removed and
    in the corresponding OS it is not possible to run macOS i386 binaries.

    The consequence of these changes meant that targets like `check-asan`
    would fail because:

    * Unit tests could not be linked for i386
    * Lit tests for i386 would fail due to not being able to execute
      compiled binaries.

    The simplest fix to this is to simply disable building for i386 for
    macOS when using the 10.15 SDK (or newer). This disables building the
    i386 slice for most compiler-rt libraries and consequently disables the
    unit and lit tests for macOS i386.

    Note that because the `DARWIN_osx_ARCHS` CMake variable is a cache
    variable this patch will have no affect on existing builds unless
    the existing cache variable is deleted. The simplest way to deal with
    this is delete existing builds and just do a fresh configure.

    Note this should not affect the builtins which are managed with
    the `DARWIN_osx_BUILTIN_ARCHS` CMake cache variable.

    For those who wish to force using a particular set of architectures when
    using newer SDKs passing `-DDARWIN_osx_ARCHS=i386;x86_64;x86_64h` to
    CMake should provide a usable (but completely unsupported) workaround.

    rdar://problem/55668535
    rdar://problem/47939978

    Reviewers: kubamracek, yln, azhar, kcc, dvyukov, vitalybuka, cryptoad, eugenis, thakis, phosek

    Subscribers: mgorny, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D68292 — delcypher / ViewSVN
  4. [LegalizeTypes] Don't use PromoteTargetBoolean in WidenVecOp_SETCC.

    Similar to r374970, but I don't have a test for this.

    PromoteTargetBoolean is intended to be use for legalizing an
    operand that needs to be promoted. It picks its type based on
    the return from getSetccResultType and is intended to be used
    when we have freedom to pick the new type. But the return type
    we need for WidenVecOp_SETCC is completely determined by the
    type of the input node. — ctopper / ViewSVN
  5. Fix failing mangle-concept.cpp test. — saar.raz / ViewSVN
  6. [LegalizeTypes] Don't call PromoteTargetBoolean from SplitVecOp_VSETCC.

    PromoteTargetBoolean calls getSetccResultType to get the return
    type. But we were passing it the setcc result type rather than the
    setcc input type. This causes an issue on X86 with avx512vl where
    the setcc result type for vXf16 vectors is vXi16 while the
    result type for vXi16 vectors is vXi1.

    There's really no guarantee that getSetccResultType is the type
    we need here. So now we just grab the extend type from
    getExtendForContent and extend to the original result VT of the
    node we're splitting. — ctopper / ViewSVN
  7. [Concepts] ConceptSpecializationExprs mangling

    Implement mangling for CSEs to match regular template-ids.
    Reviewed as part of D41569. — saar.raz / ViewSVN
  8. Revert "[ASan] Refine diagnoses messages"

    This reverts commit 4d1ecadda59ce82e5fa6e28dd15bf794eee88363. — yln / ViewSVN
  9. CodeExtractor: NFC: Use Range based loop

    Reviewers: vsk, tejohnson, fhahn

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68924 — hiraditya / ViewSVN
  10. [libTooling] Put all Transformer declarations in a single namespace.

    Summary:
    This revision introduces a new namespace, `clang::transformer`, to hold
    the declarations for the Transformer library.

    Reviewers: gribozavr

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68876 — ymandel / ViewSVN
  11. Fix an unused variable introduced in rL374955 / rG21703543.

    Even though this is a unit test, it still may be run under optimization. — dlj / ViewSVN
  12. [ASan] Refine diagnoses messages

    The provided PC is not reliable in every case, so don't suggest
    something that does not make sense. — yln / ViewSVN
  13. [dsymutil] Support and relocate base address selection entries for debug_loc

    Since r374600 clang emits base address selection entries. Currently
    dsymutil does not support these entries and incorrectly interprets them
    as location list entries.

    This patch adds support for base address selection entries in dsymutil
    and makes sure they are relocated correctly.

    Thanks to Dave for coming up with the test case!

    Differential revision: https://reviews.llvm.org/D69005 — Jonas Devlieghere / ViewSVN
  14. [Reland][VirtualFileSystem] Support virtual working directory in the RedirectingFS

    Before this patch, changing the working directory of the RedirectingFS
    would just forward to its external file system. This prevented us from
    having a working directory that only existed in the VFS mapping.

    This patch adds support for a virtual working directory in the
    RedirectingFileSystem. It now keeps track of its own WD in addition to
    updating the WD of the external file system. This ensures that we can
    still fall through for relative paths.

    This change was originally motivated by the reproducer infrastructure in
    LLDB where we want to deal transparently with relative paths.

    Differential revision: https://reviews.llvm.org/D65677 — Jonas Devlieghere / ViewSVN
  15. PR43674: fix incorrect constant evaluation of 'switch' where no case
    label corresponds to the condition. — rsmith / ViewSVN
  16. Remove unnecessary and inappropriate forward-declaration of Sema from
    AST. — rsmith / ViewSVN
  17. [Orc] Add a method for ObjectLinkingLayer to return ownership of object buffers.

    RTDyldObjectLinkingLayer allowed clients to register a NotifyEmitted function to
    reclaim ownership of object buffers once they had been linked. This patch adds
    similar functionality to ObjectLinkingLayer: Clients can now optionally call the
    ObjectLinkingLayer::setReturnObjectBuffer method to register a function that
    will be called when discarding object buffers. If set, this function will be
    called to return ownership of the object regardless of whether the link
    succeeded or failed.

    Use cases for this function include debug dumping (it provides a way to dump
    all objects linked into JIT'd code) and object re-use (e.g. storing an
    object in a cache). — Lang Hames / ViewSVN
  18. [Docs] Updates sidebar links and sets max-width property for div.body

    Updates the sidebar links for Getting Started. Also sets max-width on div.body to 1000px. — dr87 / ViewSVN
  19. [JITLink] Switch to slab allocation for InProcessMemoryManager, re-enable test.

    InProcessMemoryManager used to make separate memory allocation calls for each
    permission level (RW, RX, RO), which could lead to target-out-of-range errors
    if data and code were placed too far apart (this was the source of failures in
    the JITLink/AArch64 testcase when it was first landed).

    This patch updates InProcessMemoryManager to allocate a single slab which is
    subdivided between text and data. This should guarantee that accesses remain
    in-range provided that individual object files do not exceed 1Mb in size.
    This patch also re-enables the JITLink/AArch64 testcase. — Lang Hames / ViewSVN
  20. [lit] Add back LitTestCase

    This essentially reverts a commit [1] that removed the adaptor for
    Python unittests.  The code has been slightly refactored to make it more
    additive: all code is contained in LitTestCase.py.

    Usage sites will require a small adaption:
    ```
    [old]
      import lit.discovery
      ...
      test_suite = lit.discovery.load_test_suite(...)

    [new]
      import lit.LitTestCase
      ...
      test_suite = lit.LitTestCase.load_test_suite(...)
    ```

    This was put back on request by Daniel Dunbar, since I wrongly assumed
    that the functionality is unused.  At least llbuild still uses this [2].

    [1] 70ca752ccf6a8f362aea25ccd3ee2bbceca93b20
    [2] https://github.com/apple/swift-llbuild/blob/master/utils/Xcode/LitXCTestAdaptor/LitTests.py#L16

    Reviewed By: ddunbar

    Differential Revision: https://reviews.llvm.org/D69002 — yln / ViewSVN
  21. [XCOFF]implement parsing relocation information for 32-bit xcoff object file

    Summary:
        Parsing the relocation entry information for 32-bit xcoff object file
    including deal with the relocation overflow.

    Reviewers: hubert.reinterpretcast, jasonliu, sfertile, xingxue.

    Subscribers: hiraditya, rupprecht, seiya

    Differential Revision: https://reviews.llvm.org/D67008 — diggerlin / ViewSVN
  22. [llvm-lipo] Add missing cast

    Add missing cast (to correctly sum 32-bit integers).

    Test plan: make check-all — alexshap / ViewSVN
  23. AMDGPU: Fix infinite searches in SIFixSGPRCopies

    Summary:
    Two conditions could lead to infinite loops when processing PHI nodes in
    SIFixSGPRCopies.

    The first condition involves a REG_SEQUENCE that uses registers defined by both
    a PHI and a COPY.

    The second condition arises when a physical register is copied to a virtual
    register which is then used in a PHI node. If the same virtual register is
    copied to the same physical register, the result is an endless loop.

    %0:sgpr_64 = COPY $sgpr0_sgpr1
    %2 = PHI %0, %bb.0, %1, %bb.1
    $sgpr0_sgpr1 = COPY %0

    Reviewers: alex-t, rampitec, arsenm

    Reviewed By: rampitec

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68970 — kerbowa / ViewSVN
  24. [OPENMP]Fix comments/params, NFC. — abataev / ViewSVN
  25. [OPENMP]Allow final clause in combined task-based directives.
    The condition of the final clause must be captured in the combined
    task-based directives, like 'parallel master taskloop' directive. — abataev / ViewSVN
  26. [llvm-readobj][xcoff] implement parsing overflow section header.

    SUMMARY:
    in the xcoff, if the number of relocation entries or line number entries is
    overflow(large than or equal 65535) , there will be overflow section for it.
    The interpret of overflow section is different with generic section header,
    the patch implement parsing the overflow section.

    Reviewers: hubert.reinterpretcast,sfertile,jasonliu
    Subscribers: rupprecht, seiya

    Differential Revision: https://reviews.llvm.org/D68575 — diggerlin / ViewSVN
  27. [Concept] Associated Constraints Infrastructure

    Add code to correctly calculate the associated constraints of a template (no enforcement yet).
    D41284 on Phabricator. — saar.raz / ViewSVN
  28. [Clang][OpenMP Offload] Move offload registration code to the wrapper

    The final list of OpenMP offload targets becomes known only at the link time and since offload registration code depends on the targets list it makes sense to delay offload registration code generation to the link time instead of adding it to the host part of every fat object. This patch moves offload registration code generation from clang to the offload wrapper tool.

    This is the last part of the OpenMP linker script elimination patch https://reviews.llvm.org/D64943

    Differential Revision: https://reviews.llvm.org/D68746 — sdmitriev / ViewSVN
  29. Fix as-w-option.c on Windows where no assembler exists — rnk / ViewSVN
  30. Revert "[VirtualFileSystem] Support virtual working directory in the  RedirectingFS"

    This reverts the original commit and the follow up:

    Revert "[VirtualFileSystem] Support virtual working directory in the  RedirectingFS"
    Revert "[test] Update YAML mapping in VirtualFileSystemTest" — Jonas Devlieghere / ViewSVN
  31. Added support for "#pragma clang section relro=<name>"

    Differential Revision: https://reviews.llvm.org/D68806 — dmikulin / ViewSVN
  32. [WebAssembly] Allow multivalue types in block signature operands

    Summary:
    Renames `ExprType` to the more apt `BlockType` and adds a variant for
    multivalue blocks. Currently non-void blocks are only generated at the
    end of functions where the block return type needs to agree with the
    function return type, and that remains true for multivalue
    blocks. That invariant means that the actual signature does not need
    to be stored in the block signature `MachineOperand` because it can be
    inferred by `WebAssemblyMCInstLower` from the return type of the
    parent function. `WebAssemblyMCInstLower` continues to lower block
    signature operands to immediates when possible but lowers multivalue
    signatures to function type symbols. The AsmParser and Disassembler
    are updated to handle multivalue block types as well.

    Reviewers: aheejin, dschuff, aardappel

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68889 — tlively / ViewSVN
  33. [clang] refactor -Wa,-W test cases.

    Remove REQUIRES and only keep the clang driver tests, since the
    assembler are already tested with -Wa,--no-warn. This way we could run
    the test on non-linux platforms and catch breaks on them. — jcai19 / ViewSVN
  34. [llvm-objdump] Use a counter for llvm-objdump -h instead of the section index.

    Summary:
    When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).

    While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.

    Reviewers: grimar, jhenderson, espindola

    Reviewed By: grimar

    Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68848 — rupprecht / ViewSVN
  35. [test] Update YAML mapping in VirtualFileSystemTest

    The 'bar' directory should be part of the root rather than the file
    itself. — Jonas Devlieghere / ViewSVN
  36. Fix Driver/working-directory.c test

    Accidentally committed debug print. — Jan Korous / ViewSVN
  37. [X86] combineX86ShufflesRecursively - split the getTargetShuffleInputs call from the resolveTargetShuffleAndZeroables call.

    Exposes an issue in getFauxShuffleMask where the OR(SHUFFLE,SHUFFLE) decode should always resolve zero/undef elements.

    Part of the fix for PR43024 where ideally we shouldn't call resolveTargetShuffleAndZeroables for Depth == 0 — rksimon / ViewSVN
  38. [llvm-profdata] Reinstate tools/llvm-profdata/malformed-ptr-to-counter-array.test

    I removed this test to unblock the ARM bots while looking into failures
    (r374915), and am reinstating it now with a fix.

    I believe the problem was that counter ptr address I used,
    '\0\0\6\0\1\0\0\1', set the high bits of the pointer, not the low bits
    like I wanted. On x86_64 this superficially looks like it tests r370826,
    but it doesn't, as it would have been caught before r370826. However, on
    ARM (or, 32-bit hosts more generally), I suspect the high bits were
    cleared, and you get a 'valid' profile.

    I verified that setting the *low* bits of the pointer does trigger the
    new condition:

    -// Note: The CounterPtr here is off-by-one. This should trigger a malformed profile error.
    -RUN: printf '\0\0\6\0\1\0\0\1' >> %t.profraw
    +// Note: The CounterPtr here is off-by-one.
    +//
    +// Octal '\11' is 9 in decimal: this should push CounterOffset to 1. As there are two counters,
    +// the profile reader should error out.
    +RUN: printf '\11\0\6\0\1\0\0\0' >> %t.profraw

    This reverts commit c7cf5b3e4b918c9769fd760f28485b8d943ed968. — Vedant Kumar / ViewSVN
  39. Reland [Driver] Fix -working-directory issues

    Don't change the default VFS in Driver, update tests & reland.

    This reverts commit 999f8a7416f8edc54ef92e715fd23c532bcc74d4. — Jan Korous / ViewSVN
  40. [XCOFF] Output object text section header and symbol entry for program code.

    This is remaining part of  rG41ca91f2995b: [AIX][XCOFF] Output XCOFF
    object text section header and symbol entry for rogram code.

    SUMMARY:
    Original form of this patch is provided by Stefan Pintillie.

    1. The patch try to output program code section header , symbol entry for
    program code (PR) and Instruction into the raw text section.
    2. The patch include how to alignment and layout the CSection in the text
    section.
    3. The patch also reorganize the code , put some codes into a function.
    (XCOFFObjectWriter::writeSymbolTableEntryForControlSection)

    Additional: We can not add raw data of text section test in the patch, If want
    to output raw text section data,it need a function description patch first.

    Reviewers: hubert.reinterpretcast, sfertile, jasonliu, xingxue.
    Subscribers: wuzish, nemanjai, hiraditya, MaskRay, jsjji.

    Differential Revision: https://reviews.llvm.org/D66969 — diggerlin / ViewSVN
  41. [X86] Make memcmp() use PTEST if possible and also enable AVX1 — davezarzycki / ViewSVN
  42. Add more information to JSON AST dumping of source locations.

    This adds information about the offset within the source file to the given source location as well as information about the include file a location is from. These pieces of information allow for more efficient post-processing of JSON AST dumps. — aaronballman / ViewSVN
  43. [NewGVN] Check that call has an access.

    Check that a call has an attached MemoryAccess before calling
    getClobbering on the instruction.
    If no access is attached, the instruction does not access memory.

    Resolves PR43441. — asbirlea / ViewSVN
  44. [MemorySSA] Update DomTree before applying MSSA updates.

    Update on the fix in rL374850. — asbirlea / ViewSVN
  45. [VirtualFileSystem] Support virtual working directory in the  RedirectingFS

    Before this patch, changing the working directory of the RedirectingFS
    would just forward to its external file system. This prevented us from
    having a working directory that only existed in the VFS mapping.

    This patch adds support for a virtual working directory in the
    RedirectingFileSystem. It now keeps track of its own WD in addition to
    updating the WD of the external file system. This ensures that we can
    still fall through for relative paths.

    This change was originally motivated by the reproducer infrastructure in
    LLDB where we want to deal transparently with relative paths.

    Differential revision: https://reviews.llvm.org/D65677 — Jonas Devlieghere / ViewSVN
  46. [llvm-profdata] Remove tools/llvm-profdata/malformed-ptr-to-counter-array.test

    This test is still failing on the ARM bots and I need time to
    investigate. — Vedant Kumar / ViewSVN
  47. [AIX][XCOFF] Output XCOFF object text section header and symbol entry for program code.

    SUMMARY
    Original form of this patch is provided by Stefan Pintillie.

    The patch try to output program code section header , symbol entry for program code (PR) and Instruction into the raw text section.
    The patch include how to alignment and layout the CSection in the text section.
    The patch also reorganize the code , put some codes into a function(XCOFFObjectWriter::writeSymbolTableEntryForControlSection)
    Additional: We can not add raw data of text section test in the patch, If want to output raw text section data,it need a function description patch first.

    Reviewers: hubert.reinterpretcast, sfertile, jasonliu, xingxue.
    Subscribers: wuzish, nemanjai, hiraditya, MaskRay, jsjji.

    Differential Revision: https://reviews.llvm.org/D66969 — diggerlin / ViewSVN
  48. [AMDGPU] Support mov dpp with 64 bit operands

    We define mov/update dpp intrinsics as overloaded but do not
    support i64, which is a practically useful type. Fix the
    selection and lowering.

    Differential Revision: https://reviews.llvm.org/D68673 — rampitec / ViewSVN
  49. CFI: wrong type passed to llvm.type.test with multiple inheritance devirtualization.

    Differential Revision: https://reviews.llvm.org/D67985 — dmikulin / ViewSVN
  50. [AMDGPU] Allow DPP combiner to work with REG_SEQUENCE

    Differential Revision: https://reviews.llvm.org/D68828 — rampitec / ViewSVN
  51. [Concepts] Remove unused and illegal Sema includes from ExprCXX.cpp

    Fixing accidental includes introduced in 374903 — saar.raz / ViewSVN
  52. gn build: Merge r374903 — gnsyncbot / ViewSVN
  53. [DAGCombiner] fold select-of-constants based on sign-bit test

    Examples:
      i32 X > -1 ? C1 : -1 --> (X >>s 31) | C1
      i8 X < 0 ? C1 : 0 --> (X >>s 7) & C1

    This is a small generalization of a fold requested in PR43650:
    https://bugs.llvm.org/show_bug.cgi?id=43650

    The sign-bit of the condition operand can be used as a mask for the true operand:
    https://rise4fun.com/Alive/paT

    Note that we already handle some of the patterns (isNegative + scalar) because
    there's an over-specialized, yet over-reaching fold for that in foldSelectCCToShiftAnd().
    It doesn't use any TLI hooks, so I can't easily rip out that code even though we're
    duplicating part of it here. This fold is guarded by TLI.convertSelectOfConstantsToMath(),
    so it should not cause problems for targets that prefer select over shift.

    Also worth noting: I thought we could generalize this further to include the case where
    the true operand of the select is not constant, but Alive says that may allow poison to
    pass through where it does not in the original select form of the code.

    Differential Revision: https://reviews.llvm.org/D68949 — spatel / ViewSVN

#5540 (Oct 14, 2019 7:02:05 AM)

  1. [RISCV] enable LTO support, pass some options to linker.

    Summary:
    1. enable LTO need to pass target feature and abi to LTO code generation
       RISCV backend need the target feature to decide which extension used in
       code generation.
    2. move getTargetFeatures to CommonArgs.h and add ForLTOPlugin flag
    3. add general tools::getTargetABI in CommonArgs.h because different target uses different
       way to get the target ABI.

    Patch by Kuan Hsu Chen (khchen)

    Reviewers: lenary, lewis-revill, asb, MaskRay

    Reviewed By: lenary

    Subscribers: hiraditya, dschuff, aheejin, fedor.sergeev, mehdi_amini, inglorion, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D67409 — lenary / ViewSVN
  2. [Alignment][NFC] Move and type functions from MathExtras to Alignment

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68942 — gchatelet / ViewSVN
  3. [AArch64] Stackframe accesses to SVE objects.

    Materialize accesses to SVE frame objects from SP or FP, whichever is
    available and beneficial.

    This patch still assumes the objects are pre-allocated. The automatic
    layout of SVE objects within the stackframe will be added in a separate
    patch.

    Reviewers: greened, cameron.mcinally, efriedma, rengolin, thegameg, rovka

    Reviewed By: cameron.mcinally

    Differential Revision: https://reviews.llvm.org/D67749 — s.desmalen / ViewSVN
  4. [llvm-size] Tidy up error messages (PR42970)

    Clean up some formatting inconsistencies in the error messages and correctly exit with non-zero in all error cases.

    Differential Revision: https://reviews.llvm.org/D68906
    Patch by Alex Cameron — maskray / ViewSVN
  5. [DebugInfo] Fix truncation of call site immediates

    Summary:
    This addresses a bug in collectCallSiteParameters() where call site
    immediates would be truncated from int64_t to unsigned.

    This fixes PR43525.

    Reviewers: djtodoro, NikolaPrica, aprantl, vsk

    Reviewed By: aprantl

    Subscribers: hiraditya, llvm-commits

    Tags: #debug-info, #llvm

    Differential Revision: https://reviews.llvm.org/D68869 — dstenb / ViewSVN
  6. Revert "Add a pass to lower is.constant and objectsize intrinsics"

    This reverts commit r374743. It broke the build with Ocaml enabled:
    http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19218 — gribozavr / ViewSVN
  7. [AMDGPU] Come back patch for the 'Assign register class for cross block values according to the divergence.'

      Detailed description:

        After https://reviews.llvm.org/D59990 submit several issues were discovered.
        Changes in common code were preserved but AMDGPU specific part was reverted to keep the backend working correctly.

        Discovered issues were addressed in the following commits:

        https://reviews.llvm.org/D67662
        https://reviews.llvm.org/D67101
        https://reviews.llvm.org/D63953
        https://reviews.llvm.org/D63731

        This change brings back AMDGPU specific changes.

      Reviewed by: rampitec, arsenm

      Differential Revision: https://reviews.llvm.org/D68635 — alex-t / ViewSVN

#5539 (Oct 14, 2019 4:57:14 AM)

  1. Fixing typo in llvm/IR/Intrinsics.td

    Fixing typo in comment line. — vhscampos / ViewSVN
  2. [X86][BtVer2] Improved latency and throughput of float/vector loads and stores.

    This patch introduces the following changes to the btver2 scheduling model:

    - The number of micro opcodes for YMM loads and stores is now 2 (it was
      incorrectly set to 1 for both aligned and misaligned loads/stores).

    - Increased the number of AGU resource cycles for YMM loads and stores
      to 2cy (instead of 1cy).

    - Removed JFPU01 and JFPX from the list of resources consumed by pure
      float/vector loads (no MMX).

    I verified with llvm-exegesis that pure XMM/YMM loads are no-pipe. Those
    are dispatched to the FPU but not really issues on JFPU01.

    Differential Revision: https://reviews.llvm.org/D68871 — adibiagio / ViewSVN

#5538 (Oct 14, 2019 3:19:27 AM)

  1. [NFC][TTI] Add Alignment for isLegalMasked[Load/Store]

    Add an extra parameter so the backend can take the alignment into
    consideration.

    Differential Revision: https://reviews.llvm.org/D68400 — sam_parker / ViewSVN
  2. Fix D68936 — gchatelet / ViewSVN
  3. build_llvm_package.bat: Run check-clang-tools and check-clangd tests. — hans / ViewSVN
  4. [Alignment][NFC] Support compile time constants

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68936 — gchatelet / ViewSVN

#5537 (Oct 14, 2019 1:17:47 AM)

  1. [docs] loop pragmas: options implying transformations

    Following our discussion on the cfe dev list:
    http://lists.llvm.org/pipermail/cfe-dev/2019-August/063054.html,
    I have added a paragraph that is explicit about loop pragmas, and
    transformation options implying the corresponding transformation.

    Differential Revision: https://reviews.llvm.org/D66199 — sjoerdmeijer / ViewSVN
  2. [X86] Teach EmitTest to handle ISD::SSUBO/USUBO in order to use the Z flag from the subtract directly during isel.

    This prevents isel from emitting a TEST instruction that
    optimizeCompareInstr will need to remove later.

    In some of the modified tests, the SUB gets duplicated due to
    the flags being needed in two places and being clobbered in
    between. optimizeCompareInstr was able to optimize away the TEST
    that was using the result of one of them, but optimizeCompareInstr
    doesn't know to turn SUB into CMP after removing the TEST. It
    only knows how to turn SUB into CMP if the result was already
    dead.

    With this change the TEST never exists, so optimizeCompareInstr
    doesn't have to remove it. Then it can just turn the SUB into
    CMP immediately.

    Fixes PR43649. — ctopper / ViewSVN

#5536 (Oct 13, 2019 11:24:23 PM)

  1. [clang] [clang-offload-bundler] Fix finding installed llvm-objcopy

    Allow finding installed llvm-objcopy in PATH if it's not present
    in the directory containing clang-offload-bundler.  This is the case
    if clang is being built stand-alone, and llvm-objcopy is already
    installed while the c-o-b tool is still present in build directory.

    This is consistent with how e.g. llvm-symbolizer is found in LLVM.
    However, most of similar searches in LLVM and Clang are performed
    without special-casing the program directory.

    Fixes r369955.

    Differential Revision: https://reviews.llvm.org/D68931 — mgorny / ViewSVN

#5534 (Oct 13, 2019 9:01:45 PM)

  1. clangd tests: use extended regex with sed

    The escaped parens seem to confuse the combination of lit, cygwin
    quoting, and cygwin's sed. unxutils sed in cmd.exe is fine with both
    forms, so use the extended regex form that doesn't need an escaped
    paren. — nico / ViewSVN

#5533 (Oct 13, 2019 7:37:29 PM)

  1. convert another test to unix line endings — nico / ViewSVN
  2. convert a test to unix line endings — nico / ViewSVN

#5532 (Oct 13, 2019 6:47:48 PM)

  1. fix typo in 374747 — nico / ViewSVN
  2. Prefer 'env not' over 'not env' in tests.

    That way, lit's builtin 'env' command can be used for the 'env' bit.

    Also it's clearer that way that the 'not' shouldn't cover 'env'
    failures. — nico / ViewSVN
  3. [X86] Autogenerate complete checks. NFC — ctopper / ViewSVN
  4. Make symbols.test pass on Windows.

    See commit message of r374746 for details.

    Hopefully final bit of PR43592. — nico / ViewSVN
  5. Make code-action-request.test and request-reply.test pass on Windows.

    clangd's test:// scheme expands to /clangd-test on non-Win and to
    C:/clang-test on Win, so it can't be mixed freely with
    file:///clangd-test since that's wrong on Windows. This makes both
    tests consistenly use the test:// scheme. (Alternatively, we could use
    the //INPUT_DIR pattern used in a few other tests.)

    Part of PR43592. — nico / ViewSVN

#5531 (Oct 13, 2019 5:48:14 PM)

  1. Don't run background-index.test on Windows.

    The test had a "UNSUPPORTED: win32" line, but the spelling of that
    changed in r339307 a year ago. Finally update this test too.

    Part of PR43592. — nico / ViewSVN
  2. [NewGVN] Use m_Br to simplify code a bit. (NFC) — fhahn / ViewSVN
  3. Add a pass to lower is.constant and objectsize intrinsics

    This pass lowers is.constant and objectsize intrinsics not simplified by
    earlier constant folding, i.e. if the object given is not constant or if
    not using the optimized pass chain. The result is recursively simplified
    and constant conditionals are pruned, so that dead blocks are removed
    even for -O0. This allows inline asm blocks with operand constraints to
    work all the time.

    The new pass replaces the existing lowering in the codegen-prepare pass
    and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert
    on the intrinsics.

    Differential Revision: https://reviews.llvm.org/D65280 — joerg / ViewSVN
  4. Improve __builtin_constant_p lowering

    __builtin_constant_p used to be short-cut evaluated to false when
    building with -O0. This is undesirable as it means that constant folding
    in the front-end can give different results than folding in the back-end.
    It can also create conditional branches on constant conditions that don't
    get folded away. With the pending improvements to the llvm.is.constant
    handling on the LLVM side, the short-cut is no longer useful.

    Adjust various codegen tests to not depend on the short-cut or the
    backend optimisations.

    Differential Revision: https://reviews.llvm.org/D67638 — joerg / ViewSVN
  5. merge-request.sh: Update 9.0 metabug for 9.0.1 — atanasyan / ViewSVN
  6. [Attributor] Shortcut no-return through will-return

    No-return and will-return are exclusive, assuming the latter is more
    prominent we can avoid updates of the former unless will-return is not
    known for sure. — jdoerfert / ViewSVN
  7. [Attributor][FIX] NullPointerIsDefined needs the pointer AS (AANonNull)

    Also includes a shortcut via AADereferenceable if possible. — jdoerfert / ViewSVN
  8. [Attributor][MemBehavior] Fallback to the function state for arguments

    Even if an argument is captured, we cannot have an effect the function
    does not have. This is fine except for the special case of `inalloca` as
    it does not behave by the rules.

    TODO: Maybe the special rule for `inalloca` is wrong after all. — jdoerfert / ViewSVN
  9. [Attributor][FIX] Use check prefix that is actually tested

    Summary:
    This changes "CHECK" check lines to "ATTRIBUTOR" check lines where
    necessary and also fixes the now exposed, mostly minor, problems.

    Reviewers: sstefan1, uenoku

    Subscribers: hiraditya, bollu, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68929 — jdoerfert / ViewSVN
  10. [NFC][InstCombine] Some preparatory cleanup in dropRedundantMaskingOfLeftShiftInput() — lebedevri / ViewSVN
  11. [Docs] Moves Control Flow Document to User Guides

    Moves Control Flow document from Reference docs page to User guides page. — dr87 / ViewSVN
  12. [X86] getTargetShuffleInputs - Control KnownUndef mask element resolution as well as KnownZero.

    We were already controlling whether the KnownZero elements were being written to the target mask, this extends it to the KnownUndef elements as well so we can prevent the target shuffle mask being manipulated at all. — rksimon / ViewSVN
  13. [X86] Enable use of avx512 saturating truncate instructions in more cases.

    This enables use of the saturating truncate instructions when the
    result type is less than 128 bits. It also enables the use of
    saturating truncate instructions on KNL when the input is less
    than 512 bits. We can do this by widening the input and then
    extracting the result. — ctopper / ViewSVN

#5530 (Oct 13, 2019 10:54:07 AM)

  1. Add missing "REQUIRES: shell" to system-include-extractor.test

    Part of PR43592. — nico / ViewSVN
  2. [ConstantFold] fix inconsistent handling of extractelement with undef index (PR42689)

    Any constant other than zero was already folded to undef if the index is undef.
    https://bugs.llvm.org/show_bug.cgi?id=42689 — spatel / ViewSVN
  3. [InstCombine] don't assume 'inbounds' for bitcast deref or null pointer in non-default address space

    Follow-up to D68244 to account for a corner case discussed in:
    https://bugs.llvm.org/show_bug.cgi?id=43501

    Add one more restriction: if the pointer is deref-or-null and in a non-default
    (non-zero) address space, we can't assume inbounds.

    Differential Revision: https://reviews.llvm.org/D68706 — spatel / ViewSVN
  4. Make the last to clangd unit tests pass on Windows.

    (Some lit tests still fail.)

    See FIXME in diff for details.

    Part of PR43592. — nico / ViewSVN
  5. [NFC][InstCombine] More test for "sign bit test via shifts" pattern (PR43595)

    While that pattern is indirectly handled via
    reassociateShiftAmtsOfTwoSameDirectionShifts(),
    that incursme one-use restriction on truncation,
    which is pointless since we know that we'll produce a single instruction.

    Additionally, *if* we are only looking for sign bit,
    we don't need shifts to be identical,
    which isn't the case in general,
    and is the blocker for me in bug in question:

    https://bugs.llvm.org/show_bug.cgi?id=43595 — lebedevri / ViewSVN
  6. [X86] SimplifyMultipleUseDemandedBitsForTargetNode - use getTargetShuffleInputs with KnownUndef/Zero results. — rksimon / ViewSVN
  7. [X86] getTargetShuffleInputs - add KnownUndef/Zero output support

    Adjust SimplifyDemandedVectorEltsForTargetNode to use the known elts masks instead of recomputing it locally. — rksimon / ViewSVN
  8. [libc++][test] std::variant test cleanup

    * Add the conventional `return 0` to `main` in `variant.assign/conv.pass.cpp` and `variant.ctor/conv.pass.cpp`

    * Fix some MSVC signed-to-unsigned conversion warnings by replacing `int` literarls with `unsigned int` literals — caseycarter / ViewSVN
  9. [libc++][test] <=> now has a feature-test macro

    ...which `test/support/test_macros.h` can use to detect compiler support. — caseycarter / ViewSVN

#5529 (Oct 13, 2019 9:01:27 AM)

  1. gn build: (manually) merge r374720 — nico / ViewSVN
  2. [clang-format] Proposal for clang-format to give compiler style warnings

    relanding {D68554} with fixed lit tests, checked on Windows and MacOS — paulhoad / ViewSVN

#5528 (Oct 13, 2019 6:56:32 AM)

  1. [X86][AVX] Add i686 avx splat tests — rksimon / ViewSVN
  2. Make most clangd unittests pass on Windows

    The Windows triple currently turns on delayed template parsing, which
    confuses several unit tests that use templates.

    For now, just explicitly disable delayed template parsing. This isn't
    ideal, but:

    - the Windows triple will soon no longer use delayed template parsing
      by default

    - there's precedent for this in the clangd unit tests already

    - let's get the clangd tests pass on Windows first before making
      behavioral changes

    Part of PR43592. — nico / ViewSVN
  3. BlockInCriticalSectionChecker - silence static analyzer dyn_cast null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. — rksimon / ViewSVN
  4. IRTranslator - silence static analyzer null dereference warnings. NFCI.

    The CmpInst::getType() calls can be replaced by just using User::getType() that it was dyn_cast from, and we then need to assert that any default predicate cases came from the CmpInst. — rksimon / ViewSVN
  5. [clang-tidy] bugprone-not-null-terminated-result: checker adjustments 4 — charusso / ViewSVN
  6. [clang-tidy] bugprone-not-null-terminated-result: checker adjustments 3

    On Windows the signed/unsigned int conversions of APInt seems broken, so that
    two of the test files marked as unsupported on Windows, as a hotfix. — charusso / ViewSVN

#5527 (Oct 13, 2019 3:30:39 AM)

  1. [clang-tidy] bugprone-not-null-terminated-result: checker adjustments 2 — charusso / ViewSVN
  2. [clang-tidy] bugprone-not-null-terminated-result: checker adjustments — charusso / ViewSVN
  3. [clang-tidy] bugprone-not-null-terminated-result: Sphinx adjustments 2 — charusso / ViewSVN
  4. [clang-tidy] bugprone-not-null-terminated-result: Sphinx adjustments — charusso / ViewSVN
  5. gn build: Merge r374707 — gnsyncbot / ViewSVN
  6. [clang-tidy] New checker for not null-terminated result caused by strlen(), size() or equal length

    Summary:
    New checker called bugprone-not-null-terminated-result. This checker finds
    function calls where it is possible to cause a not null-terminated result.
    Usually the proper length of a string is `strlen(src) + 1` or equal length
    of this expression, because the null terminator needs an extra space.
    Without the null terminator it can result in undefined behaviour when the
    string is read.

    The following and their respective `wchar_t` based functions are checked:

    `memcpy`, `memcpy_s`, `memchr`, `memmove`, `memmove_s`, `strerror_s`,
    `strncmp`, `strxfrm`

    The following is a real-world example where the programmer forgot to
    increase the passed third argument, which is `size_t length`.
    That is why the length of the allocated memory is not enough to hold the
    null terminator.

    ```
        static char *stringCpy(const std::string &str) {
          char *result = reinterpret_cast<char *>(malloc(str.size()));
          memcpy(result, str.data(), str.size());
          return result;
        }
    ```

    In addition to issuing warnings, fix-it rewrites all the necessary code.
    It also tries to adjust the capacity of the destination array:

    ```
        static char *stringCpy(const std::string &str) {
          char *result = reinterpret_cast<char *>(malloc(str.size() + 1));
          strcpy(result, str.data());
          return result;
        }
    ```

    Note: It cannot guarantee to rewrite every of the path-sensitive memory
    allocations.

    Reviewed By: JonasToth, aaron.ballman, whisperity, alexfh

    Tags: #clang-tools-extra, #clang

    Differential Revision: https://reviews.llvm.org/D45050 — charusso / ViewSVN

#5526 (Oct 13, 2019 12:24:39 AM)

  1. [X86] Add a one use check on the setcc to the min/max canonicalization code in combineSelect.

    This seems to improve std::midpoint code where we have a min and
    a max with the same condition. If we split the setcc we can end
    up with two compares if the one of the operands is a constant.
    Since we aggressively canonicalize compares with constants.
    For non-constants it can interfere with our ability to share
    control flow if we need to expand cmovs into control flow.

    I'm also not sure I understand this min/max canonicalization code.
    The motivating case talks about comparing with 0. But we don't
    check for 0 explicitly.

    Removes one instruction from the codegen for PR43658. — ctopper / ViewSVN
  2. [X86] Enable v4i32->v4i16 and v8i16->v8i8 saturating truncates to use pack instructions with avx512. — ctopper / ViewSVN
  3. [X86] Add v2i64->v2i32/v2i16/v2i8 test cases to the trunc packus/ssat/usat tests. NFC — ctopper / ViewSVN
  4. [Attributor][FIX] Avoid splitting blocks if possible

    Before, we eagerly split blocks even if it was not necessary, e.g., they
    had a single unreachable instruction and only a single predecessor. — jdoerfert / ViewSVN
  5. [Attributor][FIX] Remove leftover, now unused, variable — jdoerfert / ViewSVN
  6. [Attributor] Remove unused verification flag

    We use the verify max iteration now which is more reliable. — jdoerfert / ViewSVN
  7. [Attributor][NFC] Expose call site traversal without QueryingAA — jdoerfert / ViewSVN
  8. [Attributor][FIX] Ensure h2s doesn't trigger on escaped pointers

    We do not yet perform h2s because we know something is free'ed but we do
    it because we know the pointer does not escape. Storing the pointer
    allows it to escape so we have to prevent that. — jdoerfert / ViewSVN

#5525 (Oct 12, 2019 9:09:25 PM)

  1. [Attributor][FIX] Do not apply h2s for arbitrary mallocs

    H2S did apply to mallocs of non-constant sizes if the uses were OK. This
    is now forbidden through reording of the "good" and "bad" cases in the
    conditional. — jdoerfert / ViewSVN
  2. [Attributor][FIX] Add missing function declaration in test case — jdoerfert / ViewSVN
  3. [Attributor][FIX] Avoid modifying naked/optnone functions

    The check for naked/optnone was insufficient for different reasons. We
    now check before we initialize an abstract attribute and we do it for
    all abstract attributes. — jdoerfert / ViewSVN
  4. [SROA] Reuse existing lifetime markers if possible

    Summary:
    If the underlying alloca did not change, we do not necessarily need new
    lifetime markers. This patch adds a check and reuses the old ones if
    possible.

    Reviewers: reames, ssarda, t.p.northover, hfinkel

    Subscribers: hiraditya, bollu, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68900 — jdoerfert / ViewSVN
  5. Revert r374663 "[clang-format] Proposal for clang-format to give compiler style warnings"

    The test fails on macOS and looks a bit wrong, see comments on the review.

    Also revert follow-up r374686. — nico / ViewSVN
  6. gn build: (manually) merge r374663 — nico / ViewSVN
  7. [libc++][test] Silence MSVC warning in std::optional test

    `make_optional<string>(4, 'X')` passes `4` (an `int`) as the first argument to `string`'s `(size_t, charT)` constructor, triggering a signed/unsigned mismatch warning when compiling with MSVC at `/W4`. The incredibly simple fix is to instead use an unsigned literal (`4u`). — caseycarter / ViewSVN
  8. Revert r374648: "Reland r374388: [lit] Make internal diff work in pipelines"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  9. Revert r374649: "Reland r374389: [lit] Clean up internal diff's encoding handling"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  10. Revert r374650: "Reland r374390: [lit] Extend internal diff to support `-` argument"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  11. Revert 374651: "Reland r374392: [lit] Extend internal diff to support -U"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  12. Revert r374652: "[lit] Fix internal diff's --strip-trailing-cr and use it"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  13. Revert r374653: "[lit] Fix a few oversights in r374651 that broke some bots"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  14. Revert r374665: "[lit] Try yet again to fix new tests that fail on Windows bots"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  15. Revert r374666: "[lit] Adjust error handling for decode introduced by r374665"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  16. Revert r374671: "[lit] Try errors="ignore" for decode introduced by r374665"

    This series of patches still breaks a Windows bot. — jdenny / ViewSVN
  17. [X86] scaleShuffleMask - use size_t Scale to avoid overflow warnings — rksimon / ViewSVN

#5524 (Oct 12, 2019 11:12:27 AM)

  1. SymbolRecord - consistently use explicit for single operand constructors — rksimon / ViewSVN
  2. SymbolRecord - fix uninitialized variable warnings. NFCI. — rksimon / ViewSVN
  3. [lit] Try errors="ignore" for decode introduced by r374665

    Still trying to fix the same error as in r374666. — jdenny / ViewSVN

#5523 (Oct 12, 2019 10:19:01 AM)

  1. [NFC][LoopIdiom] Adjust FIXME to be self-explanatory — lebedevri / ViewSVN
  2. Replace for-loop of SmallVector::push_back with SmallVector::append. NFCI. — rksimon / ViewSVN
  3. Fix cppcheck shadow variable name warnings. NFCI. — rksimon / ViewSVN
  4. [X86] Use any_of/all_of patterns in shuffle mask pattern recognisers. NFCI. — rksimon / ViewSVN
  5. [lit] Adjust error handling for decode introduced by r374665

    On that decode, Windows bots fail with:

    ```
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
    ```

    That's the same error as before r374665 except it's now at the decode
    before the write to stdout. — jdenny / ViewSVN
  6. [lit] Try yet again to fix new tests that fail on Windows bots

    I seem to have misread the bot logs on my last attempt.  When lit's
    internal diff runs on Windows under Python 2.7, it's text diffs not
    binary diffs that need decoding to avoid this error when writing the
    diff to stdout:

    ```
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
    ```

    There is no `decode` attribute in this case under Python 3.6.8 under
    Ubuntu, so this patch checks for the `decode` attribute before using
    it here.  Hopefully nothing else is needed when `decode` isn't
    available.

    It might take a couple more attempts to figure out what error
    handling, if any, is needed for this decoding. — jdenny / ViewSVN
  7. Revert r374657: "[lit] Try again to fix new tests that fail on Windows bots" — jdenny / ViewSVN

#5522 (Oct 12, 2019 8:42:20 AM)

  1. [clang-format] Proposal for clang-format to give compiler style warnings

    Summary:
    Related somewhat to {D29039}

    On seeing a quote on twitter by @invalidop

    > If it's not formatted with clang-format it's a build error.

    This made me want to change the way I use clang-format into a tool that could optionally show me where my source code violates clang-format syle.

    When I'm making a change to clang-format itself, one thing I like to do to test the change is to ensure I didn't cause a huge wave of changes, what I want to do is simply run this on a known formatted directory and see if any new differences arrive in a manner I'm used to.

    This started me thinking that we should allow build systems to run clang-format on a whole tree and emit compiler style warnings about files that fail clang-format in a form that would make them as a warning in most build systems and because those build systems range in their construction I don't think its unreasonable to NOT expect them to have to do the directory searching or parsing the output replacements themselves, but simply transform that into an error code when there are changes required.

    I am starting this by suggesing adding a -n or -dry-run command line argument which would emit a warning/error of the form

    Support for various common compiler command line argumuments like '-Werror' and '-ferror-limit' could make this very flexible to be integrated into build systems and CI systems.

    ```
    > $ /usr/bin/clang-format --dry-run ClangFormat.cpp -ferror-limit=3 -fcolor-diagnostics
    > ClangFormat.cpp:54:29: warning: code should be clang-formatted [-Wclang-format-violations]
    > static cl::list<std::string>
    >                             ^
    > ClangFormat.cpp:55:20: warning: code should be clang-formatted [-Wclang-format-violations]
    > LineRanges("lines", cl::desc("<start line>:<end line> - format a range of\n"
    >                    ^
    > ClangFormat.cpp:55:77: warning: code should be clang-formatted [-Wclang-format-violations]
    > LineRanges("lines", cl::desc("<start line>:<end line> - format a range of\n"
    >                                                                             ^
    ```

    Reviewers: mitchell-stellar, klimek, owenpan

    Reviewed By: klimek

    Subscribers: mgorny, cfe-commits

    Tags: #clang-format, #clang-tools-extra, #clang

    Differential Revision: https://reviews.llvm.org/D68554 — paulhoad / ViewSVN
  2. [LoopIdiomRecognize] Recommit: BCmp loop idiom recognition

    Summary:
    This is a recommit, this originally landed in rL370454 but was
    subsequently reverted in  rL370788 due to
    https://bugs.llvm.org/show_bug.cgi?id=43206
    The reduced testcase was added to bcmp-negative-tests.ll
    as @pr43206_different_loops - we must ensure that the SCEV's
    we got are both for the same loop we are currently investigating.

    Original commit message:

    @mclow.lists brought up this issue up in IRC.
    It is a reasonably common problem to compare some two values for equality.
    Those may be just some integers, strings or arrays of integers.

    In C, there is `memcmp()`, `bcmp()` functions.
    In C++, there exists `std::equal()` algorithm.
    One can also write that function manually.

    libstdc++'s `std::equal()` is specialized to directly call `memcmp()` for
    various types, but not `std::byte` from C++2a. https://godbolt.org/z/mx2ejJ

    libc++ does not do anything like that, it simply relies on simple C++'s
    `operator==()`. https://godbolt.org/z/er0Zwf (GOOD!)

    So likely, there exists a certain performance opportunities.
    Let's compare performance of naive `std::equal()` (no `memcmp()`) with one that
    is using `memcmp()` (in this case, compiled with modified compiler). {F8768213}

    ```
    #include <algorithm>
    #include <cmath>
    #include <cstdint>
    #include <iterator>
    #include <limits>
    #include <random>
    #include <type_traits>
    #include <utility>
    #include <vector>

    #include "benchmark/benchmark.h"

    template <class T>
    bool equal(T* a, T* a_end, T* b) noexcept {
      for (; a != a_end; ++a, ++b) {
        if (*a != *b) return false;
      }
      return true;
    }

    template <typename T>
    std::vector<T> getVectorOfRandomNumbers(size_t count) {
      std::random_device rd;
      std::mt19937 gen(rd());
      std::uniform_int_distribution<T> dis(std::numeric_limits<T>::min(),
                                           std::numeric_limits<T>::max());
      std::vector<T> v;
      v.reserve(count);
      std::generate_n(std::back_inserter(v), count,
                      [&dis, &gen]() { return dis(gen); });
      assert(v.size() == count);
      return v;
    }

    struct Identical {
      template <typename T>
      static std::pair<std::vector<T>, std::vector<T>> Gen(size_t count) {
        auto Tmp = getVectorOfRandomNumbers<T>(count);
        return std::make_pair(Tmp, std::move(Tmp));
      }
    };

    struct InequalHalfway {
      template <typename T>
      static std::pair<std::vector<T>, std::vector<T>> Gen(size_t count) {
        auto V0 = getVectorOfRandomNumbers<T>(count);
        auto V1 = V0;
        V1[V1.size() / size_t(2)]++;  // just change the value.
        return std::make_pair(std::move(V0), std::move(V1));
      }
    };

    template <class T, class Gen>
    void BM_bcmp(benchmark::State& state) {
      const size_t Length = state.range(0);

      const std::pair<std::vector<T>, std::vector<T>> Data =
          Gen::template Gen<T>(Length);
      const std::vector<T>& a = Data.first;
      const std::vector<T>& b = Data.second;
      assert(a.size() == Length && b.size() == a.size());

      benchmark::ClobberMemory();
      benchmark::DoNotOptimize(a);
      benchmark::DoNotOptimize(a.data());
      benchmark::DoNotOptimize(b);
      benchmark::DoNotOptimize(b.data());

      for (auto _ : state) {
        const bool is_equal = equal(a.data(), a.data() + a.size(), b.data());
        benchmark::DoNotOptimize(is_equal);
      }
      state.SetComplexityN(Length);
      state.counters["eltcnt"] =
          benchmark::Counter(Length, benchmark::Counter::kIsIterationInvariant);
      state.counters["eltcnt/sec"] =
          benchmark::Counter(Length, benchmark::Counter::kIsIterationInvariantRate);
      const size_t BytesRead = 2 * sizeof(T) * Length;
      state.counters["bytes_read/iteration"] =
          benchmark::Counter(BytesRead, benchmark::Counter::kDefaults,
                             benchmark::Counter::OneK::kIs1024);
      state.counters["bytes_read/sec"] = benchmark::Counter(
          BytesRead, benchmark::Counter::kIsIterationInvariantRate,
          benchmark::Counter::OneK::kIs1024);
    }

    template <typename T>
    static void CustomArguments(benchmark::internal::Benchmark* b) {
      const size_t L2SizeBytes = []() {
        for (const benchmark::CPUInfo::CacheInfo& I :
             benchmark::CPUInfo::Get().caches) {
          if (I.level == 2) return I.size;
        }
        return 0;
      }();
      // What is the largest range we can check to always fit within given L2 cache?
      const size_t MaxLen = L2SizeBytes / /*total bufs*/ 2 /
                            /*maximal elt size*/ sizeof(T) / /*safety margin*/ 2;
      b->RangeMultiplier(2)->Range(1, MaxLen)->Complexity(benchmark::oN);
    }

    BENCHMARK_TEMPLATE(BM_bcmp, uint8_t, Identical)
        ->Apply(CustomArguments<uint8_t>);
    BENCHMARK_TEMPLATE(BM_bcmp, uint16_t, Identical)
        ->Apply(CustomArguments<uint16_t>);
    BENCHMARK_TEMPLATE(BM_bcmp, uint32_t, Identical)
        ->Apply(CustomArguments<uint32_t>);
    BENCHMARK_TEMPLATE(BM_bcmp, uint64_t, Identical)
        ->Apply(CustomArguments<uint64_t>);

    BENCHMARK_TEMPLATE(BM_bcmp, uint8_t, InequalHalfway)
        ->Apply(CustomArguments<uint8_t>);
    BENCHMARK_TEMPLATE(BM_bcmp, uint16_t, InequalHalfway)
        ->Apply(CustomArguments<uint16_t>);
    BENCHMARK_TEMPLATE(BM_bcmp, uint32_t, InequalHalfway)
        ->Apply(CustomArguments<uint32_t>);
    BENCHMARK_TEMPLATE(BM_bcmp, uint64_t, InequalHalfway)
        ->Apply(CustomArguments<uint64_t>);
    ```
    {F8768210}
    ```
    $ ~/src/googlebenchmark/tools/compare.py --no-utest benchmarks build-{old,new}/test/llvm-bcmp-bench
    RUNNING: build-old/test/llvm-bcmp-bench --benchmark_out=/tmp/tmpb6PEUx
    2019-04-25 21:17:11
    Running build-old/test/llvm-bcmp-bench
    Run on (8 X 4000 MHz CPU s)
    CPU Caches:
      L1 Data 16K (x8)
      L1 Instruction 64K (x4)
      L2 Unified 2048K (x4)
      L3 Unified 8192K (x1)
    Load Average: 0.65, 3.90, 4.14
    ---------------------------------------------------------------------------------------------------
    Benchmark                                         Time             CPU   Iterations UserCounters...
    ---------------------------------------------------------------------------------------------------
    <...>
    BM_bcmp<uint8_t, Identical>/512000           432131 ns       432101 ns         1613 bytes_read/iteration=1000k bytes_read/sec=2.20706G/s eltcnt=825.856M eltcnt/sec=1.18491G/s
    BM_bcmp<uint8_t, Identical>_BigO               0.86 N          0.86 N
    BM_bcmp<uint8_t, Identical>_RMS                   8 %             8 %
    <...>
    BM_bcmp<uint16_t, Identical>/256000          161408 ns       161409 ns         4027 bytes_read/iteration=1000k bytes_read/sec=5.90843G/s eltcnt=1030.91M eltcnt/sec=1.58603G/s
    BM_bcmp<uint16_t, Identical>_BigO              0.67 N          0.67 N
    BM_bcmp<uint16_t, Identical>_RMS                 25 %            25 %
    <...>
    BM_bcmp<uint32_t, Identical>/128000           81497 ns        81488 ns         8415 bytes_read/iteration=1000k bytes_read/sec=11.7032G/s eltcnt=1077.12M eltcnt/sec=1.57078G/s
    BM_bcmp<uint32_t, Identical>_BigO              0.71 N          0.71 N
    BM_bcmp<uint32_t, Identical>_RMS                 42 %            42 %
    <...>
    BM_bcmp<uint64_t, Identical>/64000            50138 ns        50138 ns        10909 bytes_read/iteration=1000k bytes_read/sec=19.0209G/s eltcnt=698.176M eltcnt/sec=1.27647G/s
    BM_bcmp<uint64_t, Identical>_BigO              0.84 N          0.84 N
    BM_bcmp<uint64_t, Identical>_RMS                 27 %            27 %
    <...>
    BM_bcmp<uint8_t, InequalHalfway>/512000      192405 ns       192392 ns         3638 bytes_read/iteration=1000k bytes_read/sec=4.95694G/s eltcnt=1.86266G eltcnt/sec=2.66124G/s
    BM_bcmp<uint8_t, InequalHalfway>_BigO          0.38 N          0.38 N
    BM_bcmp<uint8_t, InequalHalfway>_RMS              3 %             3 %
    <...>
    BM_bcmp<uint16_t, InequalHalfway>/256000     127858 ns       127860 ns         5477 bytes_read/iteration=1000k bytes_read/sec=7.45873G/s eltcnt=1.40211G eltcnt/sec=2.00219G/s
    BM_bcmp<uint16_t, InequalHalfway>_BigO         0.50 N          0.50 N
    BM_bcmp<uint16_t, InequalHalfway>_RMS             0 %             0 %
    <...>
    BM_bcmp<uint32_t, InequalHalfway>/128000      49140 ns        49140 ns        14281 bytes_read/iteration=1000k bytes_read/sec=19.4072G/s eltcnt=1.82797G eltcnt/sec=2.60478G/s
    BM_bcmp<uint32_t, InequalHalfway>_BigO         0.40 N          0.40 N
    BM_bcmp<uint32_t, InequalHalfway>_RMS            18 %            18 %
    <...>
    BM_bcmp<uint64_t, InequalHalfway>/64000       32101 ns        32099 ns        21786 bytes_read/iteration=1000k bytes_read/sec=29.7101G/s eltcnt=1.3943G eltcnt/sec=1.99381G/s
    BM_bcmp<uint64_t, InequalHalfway>_BigO         0.50 N          0.50 N
    BM_bcmp<uint64_t, InequalHalfway>_RMS             1 %             1 %
    RUNNING: build-new/test/llvm-bcmp-bench --benchmark_out=/tmp/tmpQ46PP0
    2019-04-25 21:19:29
    Running build-new/test/llvm-bcmp-bench
    Run on (8 X 4000 MHz CPU s)
    CPU Caches:
      L1 Data 16K (x8)
      L1 Instruction 64K (x4)
      L2 Unified 2048K (x4)
      L3 Unified 8192K (x1)
    Load Average: 1.01, 2.85, 3.71
    ---------------------------------------------------------------------------------------------------
    Benchmark                                         Time             CPU   Iterations UserCounters...
    ---------------------------------------------------------------------------------------------------
    <...>
    BM_bcmp<uint8_t, Identical>/512000            18593 ns        18590 ns        37565 bytes_read/iteration=1000k bytes_read/sec=51.2991G/s eltcnt=19.2333G eltcnt/sec=27.541G/s
    BM_bcmp<uint8_t, Identical>_BigO               0.04 N          0.04 N
    BM_bcmp<uint8_t, Identical>_RMS                  37 %            37 %
    <...>
    BM_bcmp<uint16_t, Identical>/256000           18950 ns        18948 ns        37223 bytes_read/iteration=1000k bytes_read/sec=50.3324G/s eltcnt=9.52909G eltcnt/sec=13.511G/s
    BM_bcmp<uint16_t, Identical>_BigO              0.08 N          0.08 N
    BM_bcmp<uint16_t, Identical>_RMS                 34 %            34 %
    <...>
    BM_bcmp<uint32_t, Identical>/128000           18627 ns        18627 ns        37895 bytes_read/iteration=1000k bytes_read/sec=51.198G/s eltcnt=4.85056G eltcnt/sec=6.87168G/s
    BM_bcmp<uint32_t, Identical>_BigO              0.16 N          0.16 N
    BM_bcmp<uint32_t, Identical>_RMS                 35 %            35 %
    <...>
    BM_bcmp<uint64_t, Identical>/64000            18855 ns        18855 ns        37458 bytes_read/iteration=1000k bytes_read/sec=50.5791G/s eltcnt=2.39731G eltcnt/sec=3.3943G/s
    BM_bcmp<uint64_t, Identical>_BigO              0.32 N          0.32 N
    BM_bcmp<uint64_t, Identical>_RMS                 33 %            33 %
    <...>
    BM_bcmp<uint8_t, InequalHalfway>/512000        9570 ns         9569 ns        73500 bytes_read/iteration=1000k bytes_read/sec=99.6601G/s eltcnt=37.632G eltcnt/sec=53.5046G/s
    BM_bcmp<uint8_t, InequalHalfway>_BigO          0.02 N          0.02 N
    BM_bcmp<uint8_t, InequalHalfway>_RMS             29 %            29 %
    <...>
    BM_bcmp<uint16_t, InequalHalfway>/256000       9547 ns         9547 ns        74343 bytes_read/iteration=1000k bytes_read/sec=99.8971G/s eltcnt=19.0318G eltcnt/sec=26.8159G/s
    BM_bcmp<uint16_t, InequalHalfway>_BigO         0.04 N          0.04 N
    BM_bcmp<uint16_t, InequalHalfway>_RMS            29 %            29 %
    <...>
    BM_bcmp<uint32_t, InequalHalfway>/128000       9396 ns         9394 ns        73521 bytes_read/iteration=1000k bytes_read/sec=101.518G/s eltcnt=9.41069G eltcnt/sec=13.6255G/s
    BM_bcmp<uint32_t, InequalHalfway>_BigO         0.08 N          0.08 N
    BM_bcmp<uint32_t, InequalHalfway>_RMS            30 %            30 %
    <...>
    BM_bcmp<uint64_t, InequalHalfway>/64000        9499 ns         9498 ns        73802 bytes_read/iteration=1000k bytes_read/sec=100.405G/s eltcnt=4.72333G eltcnt/sec=6.73808G/s
    BM_bcmp<uint64_t, InequalHalfway>_BigO         0.16 N          0.16 N
    BM_bcmp<uint64_t, InequalHalfway>_RMS            28 %            28 %
    Comparing build-old/test/llvm-bcmp-bench to build-new/test/llvm-bcmp-bench
    Benchmark                                                  Time             CPU      Time Old      Time New       CPU Old       CPU New
    ---------------------------------------------------------------------------------------------------------------------------------------
    <...>
    BM_bcmp<uint8_t, Identical>/512000                      -0.9570         -0.9570        432131         18593        432101         18590
    <...>
    BM_bcmp<uint16_t, Identical>/256000                     -0.8826         -0.8826        161408         18950        161409         18948
    <...>
    BM_bcmp<uint32_t, Identical>/128000                     -0.7714         -0.7714         81497         18627         81488         18627
    <...>
    BM_bcmp<uint64_t, Identical>/64000                      -0.6239         -0.6239         50138         18855         50138         18855
    <...>
    BM_bcmp<uint8_t, InequalHalfway>/512000                 -0.9503         -0.9503        192405          9570        192392          9569
    <...>
    BM_bcmp<uint16_t, InequalHalfway>/256000                -0.9253         -0.9253        127858          9547        127860          9547
    <...>
    BM_bcmp<uint32_t, InequalHalfway>/128000                -0.8088         -0.8088         49140          9396         49140          9394
    <...>
    BM_bcmp<uint64_t, InequalHalfway>/64000                 -0.7041         -0.7041         32101          9499         32099          9498
    ```

    What can we tell from the benchmark?
    * Performance of naive equality check somewhat improves with element size,
      maxing out at eltcnt/sec=1.58603G/s for uint16_t, or bytes_read/sec=19.0209G/s
      for uint64_t. I think, that instability implies performance problems.
    * Performance of `memcmp()`-aware benchmark always maxes out at around
      bytes_read/sec=51.2991G/s for every type. That is 2.6x the throughput of the
      naive variant!
    * eltcnt/sec metric for the `memcmp()`-aware benchmark maxes out at
      eltcnt/sec=27.541G/s for uint8_t (was: eltcnt/sec=1.18491G/s, so 24x) and
      linearly decreases with element size.
      For uint64_t, it's ~4x+ the elements/second.
    * The call obvious is more pricey than the loop, with small element count.
      As it can be seen from the full output {F8768210}, the `memcmp()` is almost
      universally worse, independent of the element size (and thus buffer size) when
      element count is less than 8.

    So all in all, bcmp idiom does indeed pose untapped performance headroom.
    This diff does implement said idiom recognition. I think a reasonable test
    coverage is present, but do tell if there is anything obvious missing.

    Now, quality. This does succeed to build and pass the test-suite, at least
    without any non-bundled elements. {F8768216} {F8768217}
    This transform fires 91 times:
    ```
    $ /build/test-suite/utils/compare.py -m loop-idiom.NumBCmp result-new.json
    Tests: 1149
    Metric: loop-idiom.NumBCmp

    Program                                         result-new

    MultiSourc...Benchmarks/7zip/7zip-benchmark    79.00
    MultiSource/Applications/d/make_dparser         3.00
    SingleSource/UnitTests/vla                      2.00
    MultiSource/Applications/Burg/burg              1.00
    MultiSourc.../Applications/JM/lencod/lencod     1.00
    MultiSource/Applications/lemon/lemon            1.00
    MultiSource/Benchmarks/Bullet/bullet            1.00
    MultiSourc...e/Benchmarks/MallocBench/gs/gs     1.00
    MultiSourc...gs-C/TimberWolfMC/timberwolfmc     1.00
    MultiSourc...Prolangs-C/simulator/simulator     1.00
    ```
    The size changes are:
    I'm not sure what's going on with SingleSource/UnitTests/vla.test yet, did not look.
    ```
    $ /build/test-suite/utils/compare.py -m size..text result-{old,new}.json --filter-hash
    Tests: 1149
    Same hash: 907 (filtered out)
    Remaining: 242
    Metric: size..text

    Program                                        result-old result-new diff
    test-suite...ingleSource/UnitTests/vla.test   753.00     833.00     10.6%
    test-suite...marks/7zip/7zip-benchmark.test   1001697.00 966657.00  -3.5%
    test-suite...ngs-C/simulator/simulator.test   32369.00   32321.00   -0.1%
    test-suite...plications/d/make_dparser.test   89585.00   89505.00   -0.1%
    test-suite...ce/Applications/Burg/burg.test   40817.00   40785.00   -0.1%
    test-suite.../Applications/lemon/lemon.test   47281.00   47249.00   -0.1%
    test-suite...TimberWolfMC/timberwolfmc.test   250065.00  250113.00   0.0%
    test-suite...chmarks/MallocBench/gs/gs.test   149889.00  149873.00  -0.0%
    test-suite...ications/JM/lencod/lencod.test   769585.00  769569.00  -0.0%
    test-suite.../Benchmarks/Bullet/bullet.test   770049.00  770049.00   0.0%
    test-suite...HMARK_ANISTROPIC_DIFFUSION/128    NaN        NaN        nan%
    test-suite...HMARK_ANISTROPIC_DIFFUSION/256    NaN        NaN        nan%
    test-suite...CHMARK_ANISTROPIC_DIFFUSION/64    NaN        NaN        nan%
    test-suite...CHMARK_ANISTROPIC_DIFFUSION/32    NaN        NaN        nan%
    test-suite...ENCHMARK_BILATERAL_FILTER/64/4    NaN        NaN        nan%
    Geomean difference                                                   nan%
             result-old    result-new       diff
    count  1.000000e+01  10.00000      10.000000
    mean   3.152090e+05  311695.40000  0.006749
    std    3.790398e+05  372091.42232  0.036605
    min    7.530000e+02  833.00000    -0.034981
    25%    4.243300e+04  42401.00000  -0.000866
    50%    1.197370e+05  119689.00000 -0.000392
    75%    6.397050e+05  639705.00000 -0.000005
    max    1.001697e+06  966657.00000  0.106242
    ```

    I don't have timings though.

    And now to the code. The basic idea is to completely replace the whole loop.
    If we can't fully kill it, don't transform.
    I have left one or two comments in the code, so hopefully it can be understood.

    Also, there is a few TODO's that i have left for follow-ups:
    * widening of `memcmp()`/`bcmp()`
    * step smaller than the comparison size
    * Metadata propagation
    * more than two blocks as long as there is still a single backedge?
    * ???

    Reviewers: reames, fhahn, mkazantsev, chandlerc, craig.topper, courbet

    Reviewed By: courbet

    Subscribers: miyuki, hiraditya, xbolva00, nikic, jfb, gchatelet, courbet, llvm-commits, mclow.lists

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D61144 — lebedevri / ViewSVN
  3. [NFC][LoopIdiom] Add bcmp loop idiom miscompile test from PR43206.

    The transform forgot to check SCEV loop scopes.

    https://bugs.llvm.org/show_bug.cgi?id=43206 — lebedevri / ViewSVN
  4. [NFC][LoopIdiom] Move one bcmp test into the proper place — lebedevri / ViewSVN
  5. remove an useless allocation found by scan-build - the new Dead nested assignment check — sylvestre / ViewSVN
  6. [X86][SSE] Avoid unnecessary PMOVZX in v4i8 sum reduction

    This should go away once D66004 has landed and we can simplify shuffle chains using demanded elts. — rksimon / ViewSVN
  7. [lit] Try again to fix new tests that fail on Windows bots

    Based on the bot logs, when lit's internal diff runs on Windows, it
    looks like binary diffs must be decoded also for Python 2.7.
    Otherwise, writing the diff to stdout fails with:

    ```
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
    ```

    I did not need to decode using Python 2.7.15 under Ubuntu.  When I do
    it anyway in that case, `errors="backslashreplace"` fails for me:

    ```
    TypeError: don't know how to handle UnicodeDecodeError in error callback
    ```

    However, `errors="ignore"` works, so this patch uses that, hoping
    it'll work on Windows as well.

    This patch leaves `errors="backslashreplace"` for Python >= 3.5 as
    there's no evidence yet that doesn't work and it produces more
    informative binary diffs.  This patch also adjusts some lit tests to
    succeed for either error handler.

    This patch adjusts changes introduced by D68664. — jdenny / ViewSVN
  8. Revert r374654: "[lit] Try to fix new tests that fail on Windows bots" — jdenny / ViewSVN
  9. [CostModel][X86] Improve sum reduction costs.

    I can't see any notable differences in costs between SSE2 and SSE42 arches for FADD/ADD reduction, so I've lowered the target to just SSE2.

    I've also added vXi8 sum reduction costs in line with the PSADBW codegen and discussions on PR42674. — rksimon / ViewSVN
  10. [lit] Try to fix new tests that fail on Windows bots — jdenny / ViewSVN
  11. [lit] Fix a few oversights in r374651 that broke some bots — jdenny / ViewSVN

#5519 (Oct 11, 2019 11:04:24 PM)

  1. Revert 374629 "[sancov] Accommodate sancov and coverage report server for use under Windows"

    http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/27650/steps/ninja%20check%201/logs/stdio
    http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/31759
    http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/15095
    http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/21075
    http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/31759 — Vitaly Buka / ViewSVN
  2. NFC: clang-format rL374420 and adjust comment wording

    The commit of rL374420 had various formatting issues, including lines
    that exceed 80 columns. This patch applies `git clang-format` on the
    changes from commit 13bd3ef40d8b1586f26a022e01b21e56c91e05bd.

    It further adjusts a comment to clarify the domain of inputs upon which
    a newly added function is meant to operate. The adjustment to the
    comment was suggested in a post-commit comment on D68721 and discussed
    off-list with @sfertile. — hubert.reinterpretcast / ViewSVN

#5518 (Oct 11, 2019 8:52:45 PM)

  1. recommit: [LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop-vectorize

    In loop-vectorize, interleave count and vector factor depend on target register number. Currently, it does not
    estimate different register pressure for different register class separately(especially for scalar type,
    float type should not be on the same position with int type), so it's not accurate. Specifically,
    it causes too many times interleaving/unrolling, result in too many register spills in loop body and hurting performance.

    So we need classify the register classes in IR level, and importantly these are abstract register classes,
    and are not the target register class of backend provided in td file. It's used to establish the mapping between
    the types of IR values and the number of simultaneous live ranges to which we'd like to limit for some set of those types.

    For example, POWER target, register num is special when VSX is enabled. When VSX is enabled, the number of int scalar register is 32(GPR),
    float is 64(VSR), but for int and float vector register both are 64(VSR). So there should be 2 kinds of register class when vsx is enabled,
    and 3 kinds of register class when VSX is NOT enabled.

    It runs on POWER target, it makes big(+~30%) performance improvement in one specific bmk(503.bwaves_r) of spec2017 and no other obvious degressions.

    Differential revision: https://reviews.llvm.org/D67148 — wuzish / ViewSVN
  2. [clang][IFS] Updating tests to pass on -fvisibility=hidden builds (NFCi).

    Special thanks to JamesNagurne who got to the bottom of this; landing this on
    his behalf.

    Differential Revision: https://reviews.llvm.org/D68897 — zer0 / ViewSVN

#5517 (Oct 11, 2019 7:39:27 PM)

  1. [sancov] Accommodate sancov and coverage report server for use under Windows

    Summary:
    This patch makes the following changes to SanCov and its complementary Python script in order to resolve issues pertaining to non-UNIX file paths in JSON symbolization information:
    * Convert all paths to use forward slash.
    * Update `coverage-report-server.py` to correctly handle paths to sources which contain spaces.
    * Remove Linux platform restriction for all SanCov unit tests. All SanCov tests passed when ran on my local Windows machine.

    Patch by Douglas Gliner.

    Reviewers: kcc, filcab, phosek, morehouse, vitalybuka, metzman

    Reviewed By: vitalybuka

    Subscribers: vsk, Dor1s, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D51018 — Vitaly Buka / ViewSVN
  2. [sancov] Use LLVM Support library JSON writer in favor of individual implementation

    Summary:
    In this diff, I've replaced the individual implementation of `JSONWriter` with `json::OStream` provided by `llvm/Support/JSON.h`.

    Important Note: The output format of the JSON is considerably different compared to the original implementation. Important differences include:
    * New line for each entry in an array (should make diffs cleaner)
    * No space between keys and colon in attributed object entries.
    * Attributes with empty strings will now print the attribute name and a quote pair rather than excluding the attribute altogether

    Examples of these differences can be seen in the changes to the sancov tests which compare the JSON output.

    Patch by Douglas Gliner.

    Reviewers: kcc, filcab, phosek, morehouse, vitalybuka, metzman

    Subscribers: mehdi_amini, dexonsmith, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68752 — Vitaly Buka / ViewSVN
  3. Slightly relax restriction on exact order arguments must appear. — dyung / ViewSVN
  4. [asan] Return true from instrumentModule

    createSanitizerCtorAndInitFunctions always change the module. — Vitaly Buka / ViewSVN

#5516 (Oct 11, 2019 6:30:59 PM)

  1. DebugInfo: Fix msan use-of-uninitialized exposed by r374600 — dblaikie / ViewSVN
  2. [llvm-profdata] Make "malformed-ptr-to-counter-array.test" textual

    As pointed out in https://reviews.llvm.org/D66979 post-commit, making
    this test textual would make it more maintainable.

    Differential Revision: https://reviews.llvm.org/D68718 — Vedant Kumar / ViewSVN
  3. [X86] Fold a VTRUNCS/VTRUNCUS+store into a saturating truncating store.

    We already did this for VTRUNCUS with a specific combination of
    types. This extends this to VTRUNCS and handles any types where
    a truncating store is legal. — ctopper / ViewSVN
  4. [X86] Add test case showing missing opportunity to fold vmovsdb into a store after type legalization. NFC — ctopper / ViewSVN

#5515 (Oct 11, 2019 4:53:34 PM)

  1. DebugInfo: Reduce the scope of some variables related to debug_ranges emission

    Minor tidy up/NFC — dblaikie / ViewSVN
  2. [libFuzzer] Don't prefix absolute paths in fuchsia.

    The ExecuteCommand function in fuchsia used to prefix the
    getOutputFile for each command run with the artifact_prefix flag if
    it was available, because fuchsia components don't have a writable working
    directory. However, if a file with a global path is provided, fuchsia
    should honor that.

    An example of this is using the global /tmp directory to store stuff.
    In fuchsia it ended up being translated to data///tmp, whereas we want
    to make sure it is using /tmp (which is available to components using the
    isolated-temp feature).

    To test this I made the change, compiled fuchsia with this toolchain and
    ran a fuzzer with the -fork=1 flag (that mode makes use of the /tmp
    directory). I also tested that normal fuzzing workflow was not affected
    by this.

    Author: charco (Marco Vanotti)
    Differential Revision: https://reviews.llvm.org/D68774 — jakehehrlich / ViewSVN
  3. gn build: (manually) merge r374606 better — nico / ViewSVN
  4. gn build: Merge r235758 — gnsyncbot / ViewSVN
  5. gn build: Cmanually) merge r374590 — nico / ViewSVN

#5514 (Oct 11, 2019 3:56:04 PM)

  1. [AMDGPU] Use GCN prefix in dpp_combine.mir. NFC. — rampitec / ViewSVN
  2. [AMDGPU] link dpp pseudos and real instructions on gfx10

    This defaults to zero fi operand, but we do not expose it
    anyway. Should we expose it later it needs to be added to
    the pseudo.

    This enables dpp combining on gfx10.

    Differential Revision: https://reviews.llvm.org/D68888 — rampitec / ViewSVN

#5513 (Oct 11, 2019 2:56:16 PM)

  1. [lit] Small cleanups in main.py

    * Extract separate function for running tests from main
    * Push single-usage imports to point of usage
    * Remove unnecessary sys.exit(0) calls

    Reviewed By: rnk

    Differential Revision: https://reviews.llvm.org/D68836 — yln / ViewSVN
  2. [lit] Change regex filter to ignore case

    Make regex filter `--filter=REGEX` option more lenient via
    `re.IGNORECASE`.

    Reviewed By: yln

    Differential Revision: https://reviews.llvm.org/D68834 — yln / ViewSVN
  3. DebugInfo: Use base address selection entries for debug_loc

    Unify the range and loc emission (for both DWARFv4 and DWARFv5 style lists) and take advantage of that unification to use strategic base addresses for loclists.

    Differential Revision: https://reviews.llvm.org/D68620 — dblaikie / ViewSVN
  4. [mips] Remove unused local variables. NFC — atanasyan / ViewSVN
  5. [mips] Store 64-bit `li.d' operand as a single 8-byte value

    Now assembler generates two consecutive `.4byte` directives to store
    64-bit `li.d' operand. The first directive stores high 4-byte of the
    value. The second directive stores low 4-byte of the value. But on
    64-bit system we load this value at once and get wrong result if the
    system is little-endian.

    This patch fixes the bug. It stores the `li.d' operand as a single
    8-byte value.

    Differential Revision: https://reviews.llvm.org/D68778 — atanasyan / ViewSVN
  6. [mips] Use less instruction to load zero into FPR by li.s / li.d pseudos

    If `li.s` or `li.d` loads zero into a FPR, it's not necessary to load
    zero into `at` GPR register and then move its value into a floating
    point register. We can use as a source register the `zero / $0` one.

    Differential Revision: https://reviews.llvm.org/D68777 — atanasyan / ViewSVN
  7. [ObjC] Remove default parameter no caller was providing. NFC intended.

    Currently there is no need to make ObjCTypeParamType have a canonical type
    different from the one in corresponding ObjCTypeParamDecl. So remove the
    corresponding unused API. — vsapsai / ViewSVN
  8. [GISel][UnitTest] Fix a bunch of tests that were not doing anything

    After r368065, all the tests using GISelMITest must call setUp() before
    doing anything, otherwise the TargetMachine is not going to be set up.
    A few tests added after that commit were not doing that and ended up
    testing effectively nothing.

    Fix the setup of all the tests and fix the failing tests. — qcolombet / ViewSVN

#5512 (Oct 11, 2019 1:40:51 PM)

  1. Release notes: Add the option WarnForDeadNestedAssignments
    https://reviews.llvm.org/D66733 — sylvestre / ViewSVN
  2. Revert 374373: [Codegen] Alter the default promotion for saturating adds and subs

    This commit is not extending the promoted integers as it should. Reverting
    whilst I look into the details. — dmgreen / ViewSVN
  3. [Mips][llvm-exegesis] Add a Mips target

    The target does just enough to be able to run llvm-exegesis in latency
    mode for at least some opcodes.

    Patch by Miloš Stojanović.

    Differential Revision: https://reviews.llvm.org/D68649 — atanasyan / ViewSVN
  4. [GISel][CallLowering] Enable vector support in argument lowering

    The exciting code is actually already enough to handle the splitting
    of vector arguments but we were lacking a test case.

    This commit adds a test case for vector argument lowering involving
    splitting and enable the related support in call lowering. — qcolombet / ViewSVN
  5. [MachineIRBuilder] Fix an assertion failure with buildMerge

    Teach buildMerge how to deal with scalar to vector kind of requests.

    Prior to this patch, buildMerge would issue either a G_MERGE_VALUES
    when all the vregs are scalars or a G_CONCAT_VECTORS when the destination
    vreg is a vector.
    G_CONCAT_VECTORS was actually not the proper instruction when the source
    vregs were scalars and the compiler would assert that the sources must
    be vectors. Instead we want is to issue a G_BUILD_VECTOR when we are
    in this situation.

    This patch fixes that. — qcolombet / ViewSVN

#5511 (Oct 11, 2019 12:41:28 PM)

  1. llvm-dwarfdump: Add verbose printing for debug_loclists — dblaikie / ViewSVN
  2. [Stats] Convert some ad-hoc header search stats to ALWAYS_ENABLED_STATISTIC.

    rdar://problem/55715134

    Reviewers: dsanders, bogner, rtereshin

    Reviewed By: dsanders

    Subscribers: hiraditya, jkorous, dexonsmith, ributzka, cfe-commits, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68252 — vsapsai / ViewSVN
  3. Suppress false-positive -Wdeprecated-volatile warning from __is_*_assignable(volatile T&, U). — rsmith / ViewSVN
  4. [X86][SSE] Add support for v4i8 add reduction — rksimon / ViewSVN
  5. gn build: (manually) merge r374110 — nico / ViewSVN
  6. [clang][IFS] Fixing assert in clang interface stubs for enums, records, typedefs

    The clang IFS ASTConsumer was asserting on enums, records (struct definitions in
    C), and typedefs. All it needs to do is skip them because the stub just needs to
    expose global object instances and functions.

    Differential Revision: https://reviews.llvm.org/D68859 — zer0 / ViewSVN
  7. Update clang module map for new excluded .def file. — rsmith / ViewSVN
  8. Fix test failure with 374562 on Hexagon

    __builtin_assume_aligned takes a size_t which is a 32 bit int on
    hexagon.  Thus, the constant gets converted to a 32 bit value, resulting
    in 0 not being a power of 2.  This patch changes the constant being
    passed to 2**30 so that it fails, but doesnt exceed 30 bits. — erichkeane / ViewSVN
  9. [AArch64] add tests for (v)select-of-constants; NFC

    These are copied from existing test files in x86/PPC. — spatel / ViewSVN
  10. [AArch64][SVE] Implement sdot and udot (lane) intrinsics

    Summary:
    Implements the following arithmetic intrinsics:
      - int_aarch64_sve_sdot
      - int_aarch64_sve_sdot_lane
      - int_aarch64_sve_udot
      - int_aarch64_sve_udot_lane

    This patch includes tests for the Subdivide4Argument type added by D67549

    Reviewers: sdesmalen, SjoerdMeijer, greened, rengolin, rovka

    Reviewed By: sdesmalen

    Subscribers: tschuett, kristof.beyls, rkruppe, psnobl, cfe-commits, llvm-commits

    Differential Revision: https://reviews.llvm.org/D67551 — kmclaughlin / ViewSVN
  11. [VPlan] Add moveAfter to VPRecipeBase.

    This patch adds a moveAfter method to VPRecipeBase, which can be used to
    move elements after other elements, across VPBasicBlocks, if necessary.

    Reviewers: dcaballe, hsaito, rengolin, hfinkel

    Reviewed By: dcaballe

    Differential Revision: https://reviews.llvm.org/D46825 — fhahn / ViewSVN
  12. [AIX] Use .space instead of .zero in assembly

    Summary:
    The AIX system assembler does not understand .zero, so we should prefer
    emitting .space.

    Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68815 — daltenty / ViewSVN
  13. Reland r374450 with Richard Smith's comments and test fixed.

    The behavior from the original patch has changed, since we're no longer
    allowing LLVM to just ignore the alignment.  Instead, we're just
    assuming the maximum possible alignment.

    Differential Revision: https://reviews.llvm.org/D68824 — erichkeane / ViewSVN
  14. [AMDGPU][MC][GFX9][GFX10] Corrected number of src operands for ds_[read/write]_addtid_b32

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

    Reviewers: arsenm, rampitec

    Differential Revision: https://reviews.llvm.org/D68787 — dpreobra / ViewSVN
  15. gn build: Merge r374558 — gnsyncbot / ViewSVN
  16. [AMDGPU][MC][GFX6][GFX7][GFX10] Added instructions buffer_atomic_[fcmpswap/fmin/fmax]*

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

    Reviewers: arsenm, rampitec

    Differential Revision: https://reviews.llvm.org/D68788 — dpreobra / ViewSVN
  17. [libTooling] Move `RewriteRule` abstraction into its own header and impl.

    Summary: Move the `RewriteRule` class and related declarations into its own set
    of files (header, implementation). Only the `Transformer` class is left in the
    Transformer-named files. This change clarifies the distinction between the
    `RewriteRule` class, which is essential to the Transformer library, and the
    `Transformer` class, which is only one possible `RewriteRule` interpreter
    (compare to `TransformerClangTidyCheck`, a clang-tidy based interpreter).

    Reviewers: gribozavr

    Subscribers: jfb, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68795 — ymandel / ViewSVN
  18. [AMDGPU][MC][GFX10] Enabled null for 64-bit dst operands

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

    Reviewers: arsenm, rampitec

    Differential Revision: https://reviews.llvm.org/D68785 — dpreobra / ViewSVN
  19. [llvm] [ocaml] Support linking against dylib

    Support linking OCaml modules against LLVM dylib when requested,
    rather than against static libs that might not be installed at all.

    Differential Revision: https://reviews.llvm.org/D68452 — mgorny / ViewSVN
  20. [DAGCombiner] fold vselect-of-constants to shift

    The diffs suggest that we are missing some more basic
    analysis/transforms, but this keeps the vector path in
    sync with the scalar (rL374397). This is again a
    preliminary step for introducing the reverse transform
    in IR as proposed in D63382. — spatel / ViewSVN
  21. Fix compilation warnings. NFC. — hliao / ViewSVN
  22. [AMDGPU][MC] Corrected parsing of optional operands

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

    Reviewers: artem.tamazov, arsenm

    Differential Revision: https://reviews.llvm.org/D68350 — dpreobra / ViewSVN
  23. [libTooling] Change Stencil equality to use `toString()`

    Summary:
    Removes the `isEqual` method from StencilPartInterface and modifies equality to
    use the string representation returned by the `toString` method for comparison.

    This means the `run` and `selection` stencils return true by default, and
    clients should be cautious in relying on equality operator for comparison of
    stencils containing parts generated by these functions.

    It also means we no longer need the custom RTTI support (typeId() and
    down_cast()), so it has been removed.

    Patch by Harshal T. Lehri.

    Reviewers: gribozavr

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68825 — ymandel / ViewSVN
  24. Updated add_new_check.py to create checker tests in the new directory — gribozavr / ViewSVN
  25. [ClangTidy] Separate tests for infrastructure and checkers, fixup

    Renamed a file that I missed in r374540. — gribozavr / ViewSVN
  26. [mips] Follow-up to r374544. Fix test case. — atanasyan / ViewSVN
  27. [Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).

    The command `od -t x` is used to dump data in hex format.
    The LIT tests assumes that the hex characters are in lowercase.
    However, there are also platforms which use uppercase letter.

    To solve this issue the tests are updated to use the new
    `--ignore-case` option of FileCheck.

    Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson

    Differential Revision: https://reviews.llvm.org/D68693 — redstar / ViewSVN
  28. [mips] Fix loading "double" immediate into a GPR and FPR

    If a "double" (64-bit) value has zero low 32-bits, it's possible to load
    such value into a GP/FP registers as an instruction immediate. But now
    assembler loads only high 32-bits of the value.

    For example, if a target register is GPR the `li.d $4, 1.0` instruction
    converts into the `lui $4, 16368` one. As a result, we get `0x3FF00000`
    in the register. While a correct representation of the `1.0` value is
    `0x3FF0000000000000`. The patch fixes that.

    Differential Revision: https://reviews.llvm.org/D68776 — atanasyan / ViewSVN
  29. [MS ABI]: Fix mangling function arguments for template types to be compatible with MSVC

    MS name mangling supports cache for first 10 distinct function
    arguments.  The error was when non cached template type occurred twice
    (e.g. 11th and 12th).  For such case in code there is another cache
    table TemplateArgStrings (for performance reasons).  Then one '@'
    character at the end of the mangled name taken from this table was
    missing.  For other cases the missing '@' character was added in
    the call to mangleSourceName(TemplateMangling) in the cache miss code,
    but the cache hit code didn't add it.

    This fixes a regression from r362560.

    Patch by Adam Folwarczny <adamf88@gmail.com>!

    Differential Revision: https://reviews.llvm.org/D68099 — nico / ViewSVN
  30. [llvm-readobj] - Remove excessive fields when dumping "Version symbols".

    This removes a few fields that are not useful:
    "Section Name", "Address", "Offset" and "Link"
    (they duplicated the information available under
    the "Sections [" tag).

    Differential revision: https://reviews.llvm.org/D68704 — grimar / ViewSVN
  31. [ClangTidy] Separate tests for infrastructure and checkers

    Summary:
    This change moves tests for checkers and infrastructure into separate
    directories, making it easier to find infrastructure tests. Tests for
    checkers are already easy to find because they are named after the
    checker. Tests for infrastructure were difficult to find because they
    were outnumbered by tests for checkers. Now they are in a separate
    directory.

    Reviewers: jfb, jdoerfert, lebedev.ri

    Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68807 — gribozavr / ViewSVN
  32. Dead Virtual Function Elimination

    Currently, it is hard for the compiler to remove unused C++ virtual
    functions, because they are all referenced from vtables, which are referenced
    by constructors. This means that if the constructor is called from any live
    code, then we keep every virtual function in the final link, even if there
    are no call sites which can use it.

    This patch allows unused virtual functions to be removed during LTO (and
    regular compilation in limited circumstances) by using type metadata to match
    virtual function call sites to the vtable slots they might load from. This
    information can then be used in the global dead code elimination pass instead
    of the references from vtables to virtual functions, to more accurately
    determine which functions are reachable.

    To make this transformation safe, I have changed clang's code-generation to
    always load virtual function pointers using the llvm.type.checked.load
    intrinsic, instead of regular load instructions. I originally tried writing
    this using clang's existing code-generation, which uses the llvm.type.test
    and llvm.assume intrinsics after doing a normal load. However, it is possible
    for optimisations to obscure the relationship between the GEP, load and
    llvm.type.test, causing GlobalDCE to fail to find virtual function call
    sites.

    The existing linkage and visibility types don't accurately describe the scope
    in which a virtual call could be made which uses a given vtable. This is
    wider than the visibility of the type itself, because a virtual function call
    could be made using a more-visible base class. I've added a new
    !vcall_visibility metadata type to represent this, described in
    TypeMetadata.rst. The internalization pass and libLTO have been updated to
    change this metadata when linking is performed.

    This doesn't currently work with ThinLTO, because it needs to see every call
    to llvm.type.checked.load in the linkage unit. It might be possible to
    extend this optimisation to be able to use the ThinLTO summary, as was done
    for devirtualization, but until then that combination is rejected in the
    clang driver.

    To test this, I've written a fuzzer which generates random C++ programs with
    complex class inheritance graphs, and virtual functions called through object
    and function pointers of different types. The programs are spread across
    multiple translation units and DSOs to test the different visibility
    restrictions.

    I've also tried doing bootstrap builds of LLVM to test this. This isn't
    ideal, because only classes in anonymous namespaces can be optimised with
    -fvisibility=default, and some parts of LLVM (plugins and bugpoint) do not
    work correctly with -fvisibility=hidden. However, there are only 12 test
    failures when building with -fvisibility=hidden (and an unmodified compiler),
    and this change does not cause any new failures for either value of
    -fvisibility.

    On the 7 C++ sub-benchmarks of SPEC2006, this gives a geomean code-size
    reduction of ~6%, over a baseline compiled with "-O2 -flto
    -fvisibility=hidden -fwhole-program-vtables". The best cases are reductions
    of ~14% in 450.soplex and 483.xalancbmk, and there are no code size
    increases.

    I've also run this on a set of 8 mbed-os examples compiled for Armv7M, which
    show a geomean size reduction of ~3%, again with no size increases.

    I had hoped that this would have no effect on performance, which would allow
    it to awlays be enabled (when using -fwhole-program-vtables). However, the
    changes in clang to use the llvm.type.checked.load intrinsic are causing ~1%
    performance regression in the C++ parts of SPEC2006. It should be possible to
    recover some of this perf loss by teaching optimisations about the
    llvm.type.checked.load intrinsic, which would make it worth turning this on
    by default (though it's still dependent on -fwhole-program-vtables).

    Differential revision: https://reviews.llvm.org/D63932 — ostannard / ViewSVN
  33. [FileCheck] Implement --ignore-case option.

    The FileCheck utility is enhanced to support a `--ignore-case`
    option. This is useful in cases where the output of Unix tools
    differs in case (e.g. case not specified by Posix).

    Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson, MaskRay

    Differential Revision: https://reviews.llvm.org/D68146 — redstar / ViewSVN
  34. [SCEV] Add stricter verification option.

    Currently -verify-scev only fails if there is a constant difference
    between two BE counts. This misses a lot of cases.

    This patch adds a -verify-scev-strict options, which fails for any
    non-zero differences, if used together with -verify-scev.

    With the stricter checking, some unit tests fail because
    of mis-matches, especially around IndVarSimplify.

    If there is no reason I am missing for just checking constant deltas, I
    am planning on looking into the various failures.

    Reviewers: efriedma, sanjoy.google, reames, atrick

    Reviewed By: sanjoy.google

    Differential Revision: https://reviews.llvm.org/D68592 — fhahn / ViewSVN
  35. [X86] isFNEG - add recursion depth limit

    Now that its used by isNegatibleForFree we should try to avoid costly deep recursion — rksimon / ViewSVN
  36. [llvm-exegesis] Show noise cluster in analysis output.

    Reviewers: gchatelet

    Subscribers: tschuett, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68780 — courbet / ViewSVN
  37. [Windows] Use information from the PE32 exceptions directory to construct unwind plans

    This patch adds an implementation of unwinding using PE EH info. It allows to
    get almost ideal call stacks on 64-bit Windows systems (except some epilogue
    cases, but I believe that they can be fixed with unwind plan disassembly
    augmentation in the future).

    To achieve the goal the CallFrameInfo abstraction was made. It is based on the
    DWARFCallFrameInfo class interface with a few changes to make it less
    DWARF-specific.

    To implement the new interface for PECOFF object files the class PECallFrameInfo
    was written. It uses the next helper classes:

    - UnwindCodesIterator helps to iterate through UnwindCode structures (and
      processes chained infos transparently);
    - EHProgramBuilder with the use of UnwindCodesIterator constructs EHProgram;
    - EHProgram is, by fact, a vector of EHInstructions. It creates an abstraction
      over the low-level unwind codes and simplifies work with them. It contains
      only the information that is relevant to unwinding in the unified form. Also
      the required unwind codes are read from the object file only once with it;
    - EHProgramRange allows to take a range of EHProgram and to build an unwind row
      for it.

    So, PECallFrameInfo builds the EHProgram with EHProgramBuilder, takes the ranges
    corresponding to every offset in prologue and builds the rows of the resulted
    unwind plan. The resulted plan covers the whole range of the function except the
    epilogue.

    Reviewers: jasonmolenda, asmith, amccarth, clayborg, JDevlieghere, stella.stamenova, labath, espindola

    Reviewed By: jasonmolenda

    Subscribers: leonid.mashinskiy, emaste, mgorny, aprantl, arichardson, MaskRay, lldb-commits, llvm-commits

    Tags: #lldb

    Differential Revision: https://reviews.llvm.org/D67347 — aleksandr.urakov / ViewSVN
  38. Insert module constructors in a module pass

    Summary:
    If we insert them from function pass some analysis may be missing or invalid.
    Fixes PR42877.

    Reviewers: eugenis, leonardchan

    Reviewed By: leonardchan

    Subscribers: hiraditya, cfe-commits, llvm-commits

    Tags: #clang, #llvm

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

    llvm-svn: 374481
    Signed-off-by: Vitaly Buka <vitalybuka@google.com> — Vitaly Buka / ViewSVN
  39. [TableGen] Fix a bug that MCSchedClassDesc is interfered between different SchedModel

    Assume that, ModelA has scheduling resource for InstA and ModelB has scheduling resource for InstB. This is what the llvm::MCSchedClassDesc looks like:

    llvm::MCSchedClassDesc ModelASchedClasses[] = {
    ...
    InstA, 0, ...
    InstB, -1,...
    };

    llvm::MCSchedClassDesc ModelBSchedClasses[] = {
    ...
    InstA, -1,...
    InstB, 0,...
    };
    The -1 means invalid num of macro ops, while it is valid if it is >=0. This is what we look like now:

    llvm::MCSchedClassDesc ModelASchedClasses[] = {
    ...
    InstA, 0, ...
    InstB, 0,...
    };

    llvm::MCSchedClassDesc ModelBSchedClasses[] = {
    ...
    InstA, 0,...
    InstB, 0,...
    };
    And compiler hit the assertion here because the SCDesc is valid now for both InstA and InstB.

    Differential Revision: https://reviews.llvm.org/D67950 — qshanz / ViewSVN
  40. [X86] Add v8i64->v8i8 ssat/usat/packus truncate tests to min-legal-vector-width.ll

    I wonder if we should split the v8i8 stores in order to form
    two v4i8 saturating truncating stores. This would remove the
    unpckl needed to concatenated the v4i8 results to make a
    single store. — ctopper / ViewSVN
  41. [ADT][Statistics] Fix test after rL374490 — kadircet / ViewSVN
  42. Fix modules build for r374337

    A modules build failed with the following error:
      call to function 'operator&' that is neither visible in the template definition nor found by argument-dependent lookup

    Fix that by declaring the appropriate operators in the llvm::minidump
    namespace. — labath / ViewSVN
  43. [X86] Always define the tzcnt intrinsics even when _MSC_VER is defined.

    These intrinsics use llvm.cttz intrinsics so are always available
    even without the bmi feature. We already don't check for the bmi
    feature on the intrinsics themselves. But we were blocking the
    include of the header file with _MSC_VER unless BMI was enabled
    on the command line.

    Fixes PR30506. — ctopper / ViewSVN
  44. [PowerPC] Remove assertion "Shouldn't overwrite a register before it is killed"

    The assertion is everzealous and fail tests like:

      renamable $x3 = LI8 0
      STD renamable $x3, 16, $x1
      renamable $x3 = LI8 0

    Remove the assertion since killed flag of $x3 is not mandentory.

    Differential Revision: https://reviews.llvm.org/D68344 — yi-hong.lyu / ViewSVN
  45. [NFC] run specific pass instead of whole -O3 pipeline for popcount recoginzation testcase. — shchenz / ViewSVN
  46. [InstCombine] recognize popcount.

      This patch recognizes popcount intrinsic according to algorithm from website
      http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

    Differential Revision: https://reviews.llvm.org/D68189 — shchenz / ViewSVN
  47. [libc++] Fix linker script generation

    Handle the case when libc++abi and libunwind are being built together
    with libc++ in the runtimes build. This logic was used in the previous
    implementation but dropped in r374116.

    Differential Revision: https://reviews.llvm.org/D68791 — phosek / ViewSVN
  48. [X86] Add a DAG combine to turn v16i16->v16i8 VTRUNCUS+store into a saturating truncating store. — ctopper / ViewSVN
  49. [X86] Add test case for trunc_packus_v16i32_v16i8_store to min-legal-vector-width.ll

    We aren't folding the vpmovuswb into the store. — ctopper / ViewSVN
  50. [CVP] Remove a masking operation if range information implies it's a noop

    This is really a known bits style transformation, but known bits isn't context sensitive. The particular case which comes up happens to involve a range which allows range based reasoning to eliminate the mask pattern, so handle that case specifically in CVP.

    InstCombine likes to generate the mask-by-low-bits pattern when widening an arithmetic expression which includes a zext in the middle.

    Differential Revision: https://reviews.llvm.org/D68811 — reames / ViewSVN
  51. [X86] Add more packus/ssat/usat truncate tests from legal vectors to less than 128-bit vectors.

    Some of these have sub-optimal codegen for avx512 relative to avx2. — ctopper / ViewSVN
  52. Revert 374481 "[tsan,msan] Insert module constructors in a module pass"

    CodeGen/sanitizer-module-constructor.c fails on mac and windows, see e.g.
    http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/11424 — nico / ViewSVN
  53. [CUDA][HIP} Add a test for constexpr default ctor

    Differential Revision: https://reviews.llvm.org/D68753 — yaxunl / ViewSVN
  54. [JITLink] Disable the MachO/AArch64 testcase while investigating bot failures.

    The windows bots are failing due to a memory layout error. Temporarily disabling
    while I investigate whether this can be worked around, or whether the test
    should be disabled on Windows. — Lang Hames / ViewSVN
  55. [JITLink] Fix MachO/arm64 GOTPAGEOFF encoding.

    The original implementation failed to shift the immediate down.

    This should fix some of the bot failures due to r374476. — Lang Hames / ViewSVN
  56. [Attributor][FIX] Do not replace musstail calls with constant — jdoerfert / ViewSVN
  57. Fix assertion failure for a cv-qualified array as a non-type template
    parameter type.

    We were both failing to decay the array type to a pointer and failing to
    remove the top-level cv-qualifications. Fix this by decaying array
    parameters even if the parameter type is dependent. — rsmith / ViewSVN
  58. AMDGPU: Move SelectFlatOffset back into AMDGPUISelDAGToDAG — arsenm / ViewSVN
  59. Get ClangdXPC.framework building (barely) with CMake's Xcode generator

    The output directories for CMake's Xcode project generator are
    specific to the configuration, and so looking in
    CMAKE_LIBRARY_OUTPUT_DIRECTORY isn't going to work. Fortunately, CMake
    already provides generator expressions to find the output of a given
    target.

    I call this "barely" building because the built framework isn't going
    to respect the configuration; that is, I can't have both Debug and
    RelWithDebInfo variants of ClangdXPC.framework at the same time like I
    can with normal library or executable targets. To do that we'd have to
    put the framework in a configuration-specific output directory or use
    CMake's native support for frameworks instead.

    https://reviews.llvm.org/D68846 — jrose / ViewSVN
  60. [Stats] Add ALWAYS_ENABLED_STATISTIC enabled regardless of LLVM_ENABLE_STATS.

    The intended usage is to measure relatively expensive operations. So the
    cost of the statistic is negligible compared to the cost of a measured
    operation and can be enabled all the time without impairing the
    compilation time.

    rdar://problem/55715134

    Reviewers: dsanders, bogner, rtereshin

    Reviewed By: dsanders

    Subscribers: hiraditya, jkorous, dexonsmith, ributzka, cfe-commits, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68252 — vsapsai / ViewSVN
  61. Include whether the destructor is constexpr in -ast-dump output for a
    clss. — rsmith / ViewSVN
  62. [X86] Improve the AVX512 bailout in combineTruncateWithSat to allow pack instructions in more situations.

    If we don't have VLX we won't end up selecting a saturating
    truncate for 256-bit or smaller vectors so we should just use
    the pack lowering. — ctopper / ViewSVN
  63. [X86] Update trunc_packus_v32i32_v32i8 test in min-legal-vector-width.ll to use a load for the large type and add the min-legal-vector-width attribute.

    The attribute is needed to avoid zmm registers. Using memory
    avoids argument splitting for large vectors. — ctopper / ViewSVN
  64. Move most CXXRecordDecl::DefinitionData bit-fields out into a separate
    file.

    Reduces duplication and thereby reduces the risk that someone will
    forget to update one of these places, as I did when adding
    DefaultedDestructorIsConstexpr (though I've been unable to produce
    a testcase for which that matters so far). — rsmith / ViewSVN
  65. gn build: Merge r374476 — gnsyncbot / ViewSVN
  66. [tsan,msan] Insert module constructors in a module pass

    Summary:
    If we insert them from function pass some analysis may be missing or invalid.
    Fixes PR42877.

    Reviewers: eugenis, leonardchan

    Reviewed By: leonardchan

    Subscribers: hiraditya, cfe-commits, llvm-commits

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D68832 — Vitaly Buka / ViewSVN
  67. [msan, NFC] Move option parsing into constructor — Vitaly Buka / ViewSVN
  68. Fix compilation warning due to typo. — hliao / ViewSVN
  69. [tooling] Fix assertion on MacOSX. — hliao / ViewSVN
  70. [JITLink] Add an initial implementation of JITLink for MachO/AArch64.

    This implementation has support for all relocation types except TLV.

    Compact unwind sections are not yet supported, so exceptions/unwinding will not
    work. — Lang Hames / ViewSVN
  71. [JITLink] Move MachO/x86 got test further down in the data section.

    'named_data' should be the first symbol in the data section. — Lang Hames / ViewSVN
  72. docs/DeveloperPolicy: Add instructions for requesting GitHub commit access

    Subscribers: mehdi_amini, jtony, xbolva00, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D66840 — tstellar / ViewSVN
  73. Fix check-interception link error in compiler-rt debug mode — rnk / ViewSVN
  74. [MemorySSA] Update Phi simplification.

    When simplifying a Phi to the unique value found incoming, check that
    there wasn't a Phi already created to break a cycle. If so, remove it.
    Resolves PR43541.

    Some additional nits included. — asbirlea / ViewSVN
  75. [tooling] Teach Tooling to understand compilation with offloading.

    Summary:
    - So far, we only recognize the host compilation with offloading and
      skip the offloading part.

    Reviewers: tra, yaxunl

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68660 — hliao / ViewSVN
  76. Fix help message for -ffp-contract

    Differential Revision: https://reviews.llvm.org/D68823 — yaxunl / ViewSVN
  77. PR43629: Fix crash evaluating constexpr placement new on a subobject of
    an out-of-lifetime object. — rsmith / ViewSVN
  78. [GISel] Simplifying return from else in function. NFC

    Forgot to integrate this little change in previous commit — mggm / ViewSVN
  79. [X86] Guard against leaving a dangling node in combineTruncateWithSat.

    When handling the packus pattern for i32->i8 we do a two step
    process using a packss to i16 followed by a packus to i8. If the
    final i8 step is a type with less than 64-bits the packus step
    will return SDValue(), but the i32->i16 step might have succeeded.
    This leaves the nodes from the middle step dangling.

    Guard against this by pre-checking that the number of elements is
    at least 8 before doing the middle step.

    With that check in place this should mean the only other
    case the middle step itself can fail is when SSE2 is disabled. So
    add an early SSE2 check then just assert that neither the middle
    or final step ever fail. — ctopper / ViewSVN
  80. [X86] Add test cases for packus/ssat/usat 32i32->v32i8 test cases. NFC — ctopper / ViewSVN
  81. [GISel] Allow getConstantVRegVal() to return G_FCONSTANT values.

    In GISel we have both G_CONSTANT and G_FCONSTANT, but because
    in GISel we don't really have a concept of Float vs Int value
    the only difference between the two is where the data originates
    from.

    What both G_CONSTANT and G_FCONSTANT return is just a bag of bits
    with the constant representation in it.

    By making getConstantVRegVal() return G_FCONSTANTs bit representation
    as well we allow ConstantFold and other things to operate with
    G_FCONSTANT.

    Adding tests that show ConstantFolding to work on mixed G_CONSTANT
    and G_FCONSTANT sources.

    Differential Revision: https://reviews.llvm.org/D68739 — mggm / ViewSVN
  82. Fix some errors in <arm_neon.h> tests that cause them to fail with lax
    vector conversions disabled. — rsmith / ViewSVN
  83. Revert 374450 "Fix __builtin_assume_aligned with too large values."

    The test fails on Windows, with

      error: 'warning' diagnostics expected but not seen:
        File builtin-assume-aligned.c Line 62: requested alignment
            must be 268435456 bytes or smaller; assumption ignored
      error: 'warning' diagnostics seen but not expected:
        File builtin-assume-aligned.c Line 62: requested alignment
            must be 8192 bytes or smaller; assumption ignored — nico / ViewSVN
  84. [AMDGPU] Handle undef old operand in DPP combine

    It was missing an undef flag.

    Differential Revision: https://reviews.llvm.org/D68813 — rampitec / ViewSVN
  85. [ValueTracking] Improve pointer offset computation for cases of same base

    This patch improves the handling of pointer offset in GEP expressions where
    one argument is the base pointer. isPointerOffset() is being used by memcpyopt
    where current code synthesizes consecutive 32 bytes stores to one store and
    two memset intrinsic calls. With this patch, we convert the stores to one
    memset intrinsic.

    Differential Revision: https://reviews.llvm.org/D67989 — xur / ViewSVN
  86. [InstCombine] Add test case for PR43617 (NFC)

    Also, refactor check in `LibCallSimplifier::optimizeLog()`. — evandro / ViewSVN
  87. [lit] Break main into smaller functions

    This change is purely mechanical.  I will do further cleanups of
    parameter usages.

    Reviewed By: rnk

    Differential Revision: https://reviews.llvm.org/D68830 — yln / ViewSVN
  88. Fix __builtin_assume_aligned with too large values.

    Code to handle __builtin_assume_aligned was allowing larger values, but
    would convert this to unsigned along the way. This patch removes the
    EmitAssumeAligned overloads that take unsigned to do away with this
    problem.

    Additionally, it adds a warning that values greater than 1 <<29 are
    ignored by LLVM.

    Differential Revision: https://reviews.llvm.org/D68824 — erichkeane / ViewSVN
  89. Add -fgnuc-version= to control __GNUC__ and other GCC macros

    I noticed that compiling on Windows with -fno-ms-compatibility had the
    side effect of defining __GNUC__, along with __GNUG__, __GXX_RTTI__, and
    a number of other macros for GCC compatibility. This is undesirable and
    causes Chromium to do things like mix __attribute__ and __declspec,
    which doesn't work. We should have a positive language option to enable
    GCC compatibility features so that we can experiment with
    -fno-ms-compatibility on Windows. This change adds -fgnuc-version= to be
    that option.

    My issue aside, users have, for a long time, reported that __GNUC__
    doesn't match their expectations in one way or another. We have
    encouraged users to migrate code away from this macro, but new code
    continues to be written assuming a GCC-only environment. There's really
    nothing we can do to stop that. By adding this flag, we can allow them
    to choose their own adventure with __GNUC__.

    This overlaps a bit with the "GNUMode" language option from -std=gnu*.
    The gnu language mode tends to enable non-conforming behaviors that we'd
    rather not enable by default, but the we want to set things like
    __GXX_RTTI__ by default, so I've kept these separate.

    Helps address PR42817

    Reviewed By: hans, nickdesaulniers, MaskRay

    Differential Revision: https://reviews.llvm.org/D68055 — rnk / ViewSVN
  90. Add a missing include in test.

    A fix for r373993. — eugenis / ViewSVN
  91. [MemorySSA] Additional handling of unreachable blocks.

    Summary:
    Whenever we get the previous definition, the assumption is that the
    recursion starts ina  reachable block.
    If the recursion starts in an unreachable block, we may recurse
    indefinitely. Handle this case by returning LoE if the block is
    unreachable.

    Resolves PR43426.

    Reviewers: george.burgess.iv

    Subscribers: Prazek, sanjoy.google, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68809 — asbirlea / ViewSVN
  92. [System Model] [TTI] Move default cache/prefetch implementations

    Move the default implementations of cache and prefetch queries to
    TargetTransformInfoImplBase and delete them from NoTIIImpl.  This brings these
    interfaces in line with how other TTI interfaces work.

    Differential Revision: https://reviews.llvm.org/D68804 — greened / ViewSVN
  93. Fix a documentation warning from GSYM commit. — gclayton / ViewSVN
  94. [MSVC] Automatically add atlmfc folder to include and libpath.

    Differential Revision: https://reviews.llvm.org/D68736 — zturner / ViewSVN
  95. [PDB] Fix bug when using multiple PCH header objects with the same name.

    A common pattern in Windows is to have all your precompiled headers
    use an object named stdafx.obj.  If you've got a project with many
    different static libs, you might use a separate PCH for each one of
    these.

    During the final link step, a file from A might reference the PCH
    object from A, but it will have the same name (stdafx.obj) as any
    other PCH from another project.  The only difference will be the
    path.  For example, A might be A/stdafx.obj while B is B/stdafx.obj.

    The existing algorithm checks only the filename that was passed on
    the command line (or stored in archive), but this is insufficient in
    the case where relative paths are used, because depending on the
    command line object file / library order, it might find the wrong
    PCH object first resulting in a signature mismatch.

    The fix here is to simply check whether the absolute path of the
    PCH object (which is stored in the input obj file for the file that
    references the PCH) *ends with* the full relative path of whatever
    is specified on the command line (or is in the archive).

    Differential Revision: https://reviews.llvm.org/D66431 — zturner / ViewSVN
  96. [lit] Add comment explaining the LIT_OPTS env var overrides command line options

    Normally, command line options override environment variables.  Add
    comment to state that we are doing the reverse on purpose. — yln / ViewSVN
  97. ADT: Save a word in every StringSet entry

    Add a specialization to StringMap (actually StringMapEntry) for a
    value type of NoneType (the type of llvm::None), and use it for
    StringSet. This'll save us a word from every entry in a StringSet,
    used for alignment with the size_t that stores the string length.

    I could have gone all the way to some kind of empty base class
    optimization, but that seemed like overkill. Someone can consider
    adding that in the future, though.

    https://reviews.llvm.org/D68586 — jrose / ViewSVN
  98. [ScanDeps] clang-format, 80 cols. — mspencer / ViewSVN
  99. [OPENMP]Update doc for supported constructs, NFC. — abataev / ViewSVN
  100. [OPENMP50]Support for 'master taskloop' directive.

    Added full support for master taskloop directive. — abataev / ViewSVN
  101. [x86] reduce duplicate test assertions; NFC — spatel / ViewSVN

#5510 (Oct 10, 2019 12:47:42 PM)

  1. [lit] Bring back `--threads` option alias

    Bring back `--threads` option which was lost in the move of the
    command line argument parsing code to cl_arguments.py.  Update docs
    since `--workers` is preferred. — yln / ViewSVN
  2. [X86] Use packusdw+vpmovuswb to implement v16i32->V16i8 that clamps signed inputs to be between 0 and 255 when zmm registers are disabled on SKX.

    If we've disable zmm registers, the v16i32 will need to be split. This split will propagate through min/max the truncate. This creates two sequences that need to be concatenated back to v16i8. We can instead use packusdw to do part of the clamping, truncating, and concatenating all at once. Then we can use a vpmovuswb to finish off the clamp.

    Differential Revision: https://reviews.llvm.org/D68763 — ctopper / ViewSVN
  3. Revert r374388: "[lit] Make internal diff work in pipelines"

    This breaks a Windows bot. — jdenny / ViewSVN
  4. [PowerPC][docs] Update IBM official docs in Compiler Writers Info page

    Summary:
    Just realized that most of the links in this page are deprecated.
    So update some important reference here:
    * adding PowerISA 3.0B/2.7B
    * adding P8/P9 User Manual
    * ELFv2 ABI and errata

    Move deprecated ones into "Other documents..".

    Reviewers: #powerpc, hfinkel, nemanjai

    Reviewed By: hfinkel

    Subscribers: shchenz, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68817 — jsji / ViewSVN
  5. Revert r374389: "[lit] Clean up internal diff's encoding handling"

    This breaks a Windows bot. — jdenny / ViewSVN
  6. Revert r374390: "[lit] Extend internal diff to support `-` argument"

    This breaks a Windows bot. — jdenny / ViewSVN
  7. Revert r374392: "[lit] Extend internal diff to support -U"

    This breaks a Windows bot. — jdenny / ViewSVN
  8. win: Move Parallel.h off concrt to cross-platform code

    r179397 added Parallel.h and implemented it terms of concrt in 2013.

    In 2015, a cross-platform implementation of the functions has appeared
    and is in use everywhere but on Windows (r232419).  r246219 hints that
    <thread> had issues in MSVC2013, but r296906 suggests they've been fixed
    now that we require 2015+.

    So remove the concrt code. It's less code, and it sounds like concrt has
    conceptual and performance issues, see PR41198.

    I built blink_core.dll in a debug component build with full symbols and
    in a release component build without any symbols.  I couldn't measure a
    performance difference for linking blink_core.dll before and after this
    patch.

    Differential Revision: https://reviews.llvm.org/D68820 — nico / ViewSVN
  9. [NFC][PowerPC]Clean up PPCAsmPrinter for TOC related pseudo opcode

    Add a helper function getMCSymbolForTOCPseudoMO to clean up PPCAsmPrinter
    a little bit.

    Differential Revision: https://reviews.llvm.org/D68721 — xiangling_liao / ViewSVN
  10. [ARM] Fix arm_neon.h with -flax-vector-conversions=none, part 2.

    Just running -fsyntax-only over arm_neon.h doesn't cover some intrinsics
    which are defined using macros.  Add more test coverage for that.

    arm-neon-header.c wasn't checking the full set of available NEON target
    features; change the target architecture of the test to account for
    that.

    Fix the generator for arm_neon.h to generate casts in more cases where
    they are necessary.

    Fix VFMLAL_LOW etc. to express their signatures differently, so the
    builtins have the expected type. Maybe the TableGen backend should
    detect intrinsics that are defined the wrong way, and produce an error.
    The rules here are sort of strange.

    Differential Revision: https://reviews.llvm.org/D68743 — efriedma / ViewSVN
  11. Fix one more clang test which didn't have \5C in it — rnk / ViewSVN
  12. Update clang tests for new LLVM IR backslash printing in r374415 — rnk / ViewSVN
  13. Print quoted backslashes in LLVM IR as \\ instead of \5C

    This improves readability of Windows path string literals in LLVM IR.
    The LLVM assembler has supported \\ in IR strings for a long time, but
    the lexer doesn't tolerate escaped quotes, so they have to be printed as
    \22 for now. — rnk / ViewSVN
  14. Fix Windows build after r374381 — nico / ViewSVN
  15. Remove strings.h include to fix GSYM Windows build

    Fifth time's the charm. — rnk / ViewSVN
  16. Unbreak buildbots. — gclayton / ViewSVN
  17. Fix buildbots by using memset instead of bzero. — gclayton / ViewSVN
  18. [libc++][test] Change IsSmallObject's calculation for std::any's small object buffer

    `sizeof(std::any) - sizeof(void*)` is correct for both libc++ and the MSVC standard library.

    Differential Revision: https://reviews.llvm.org/D68756 — caseycarter / ViewSVN
  19. Fix build by adding the missing dependency. — hliao / ViewSVN
  20. [lit] Leverage argparse features to remove some code

    Reviewed By: rnk, serge-sans-paille

    Differential Revision: https://reviews.llvm.org/D68589 — yln / ViewSVN
  21. Fix test to avoid check-not matching the temp file absolute path

    Fix for PR43636 — rnk / ViewSVN
  22. Re-land "Use -fdebug-compilation-dir to form absolute paths in coverage mappings"

    This reverts r374324 (git commit 62808631acceaa8b78f8ab9b407eb6b943ff5f77)

    I changed the test to not rely on finding the sequence "clang, test,
    CoverageMapping" in the CWD used to run the test. Instead it makes its
    own internal directory hierarchy of foo/bar/baz and looks for that. — rnk / ViewSVN
  23. [lit] Move argument parsing/validation to separate file

    Reviewed By: serge-sans-paille

    Differential Revision: https://reviews.llvm.org/D68529 — yln / ViewSVN
  24. [clang-format] throws an incorrect assertion in consumeToken() formatting the MSVC stl

    Summary:
    An incorrect assertion is thrown when clang-formatting MSVC's STL library

    ```
    Assertion failed: !Line.startsWith(tok::hash), file C:/llvm/llvm-project/clang/lib/Format/TokenAnnotator.cpp, line 847
    Stack dump:
    0.      Program arguments: C:\llvm\build\bin\clang-format.exe -i -n ./stl/inc/xkeycheck.h
    ```

    ```
    Enable warning C4005 to find the forbidden define.
    ```

    Reviewers: mitchell-stellar, STL_MSFT, klimek, krasimir

    Reviewed By: mitchell-stellar

    Subscribers: cfe-commits

    Tags: #clang-format, #clang-tools-extra, #clang

    Differential Revision: https://reviews.llvm.org/D68707 — paulhoad / ViewSVN
  25. Unbreak  llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast buildbot. — gclayton / ViewSVN
  26. [DAGCombiner] fold select-of-constants to shift

    This reverses the scalar canonicalization proposed in D63382.

    Pre: isPowerOf2(C1)
    %r = select i1 %cond, i32 C1, i32 0
    =>
    %z = zext i1 %cond to i32
    %r = shl i32 %z, log2(C1)

    https://rise4fun.com/Alive/Z50

    x86 already tries to fold this pattern, but it isn't done
    uniformly, so we still see a diff. AArch64 probably should
    enable the TLI hook to benefit too, but that's a follow-on. — spatel / ViewSVN
  27. Unbreak windows buildbots. — gclayton / ViewSVN
  28. gn build: restore tablegen restat optimization after r373664 — nico / ViewSVN
  29. [lit] Extend internal diff to support -U

    When using lit's internal shell, RUN lines like the following
    accidentally execute an external `diff` instead of lit's internal
    `diff`:

    ```
    # RUN: program | diff -U1 file -
    ```

    Such cases exist now, in `clang/test/Analysis` for example.  We are
    preparing patches to ensure lit's internal `diff` is called in such
    cases, which will then fail because lit's internal `diff` doesn't
    recognize `-U` as a command-line option.  This patch adds `-U`
    support.

    Reviewed By: rnk

    Differential Revision: https://reviews.llvm.org/D68668 — jdenny / ViewSVN
  30. gn build: merge r374381 more (effectively a no-op) — nico / ViewSVN
  31. [lit] Extend internal diff to support `-` argument

    When using lit's internal shell, RUN lines like the following
    accidentally execute an external `diff` instead of lit's internal
    `diff`:

    ```
    # RUN: program | diff file -
    ```

    Such cases exist now, in `clang/test/Analysis` for example.  We are
    preparing patches to ensure lit's internal `diff` is called in such
    cases, which will then fail because lit's internal `diff` doesn't
    recognize `-` as a command-line option.  This patch adds support for
    `-` to mean stdin.

    Reviewed By: probinson, rnk

    Differential Revision: https://reviews.llvm.org/D67643 — jdenny / ViewSVN
  32. [lit] Clean up internal diff's encoding handling

    As suggested by rnk at D67643#1673043, instead of reading files
    multiple times until an appropriate encoding is found, read them once
    as binary, and then try to decode what was read.

    For python >= 3.5, don't fail when attempting to decode the
    `diff_bytes` output in order to print it.

    Finally, add some tests for encoding handling.

    Reviewed By: rnk

    Differential Revision: https://reviews.llvm.org/D68664 — jdenny / ViewSVN
  33. [lit] Make internal diff work in pipelines

    When using lit's internal shell, RUN lines like the following
    accidentally execute an external `diff` instead of lit's internal
    `diff`:

    ```
    # RUN: program | diff file -
    # RUN: not diff file1 file2 | FileCheck %s
    ```

    Such cases exist now, in `clang/test/Analysis` for example.  We are
    preparing patches to ensure lit's internal `diff` is called in such
    cases, which will then fail because lit's internal `diff` cannot
    currently be used in pipelines and doesn't recognize `-` as a
    command-line option.

    To enable pipelines, this patch moves lit's `diff` implementation into
    an out-of-process script, similar to lit's `cat` implementation.  A
    follow-up patch will implement `-` to mean stdin.

    Reviewed By: probinson, stella.stamenova

    Differential Revision: https://reviews.llvm.org/D66574 — jdenny / ViewSVN
  34. [OPENMP50]Support for declare variant directive for NVPTX target.

    NVPTX does not support global aliases. Instead, we have to copy the full
    body of the variant function for the original function. — abataev / ViewSVN
  35. Reland "[ASan] Do not misrepresent high value address dereferences as null dereferences"

    Updated: Removed offending TODO comment.

    Dereferences with addresses above the 48-bit hardware addressable range
    produce "invalid instruction" (instead of "invalid access") hardware
    exceptions (there is no hardware address decoding logic for those bits),
    and the address provided by this exception is the address of the
    instruction (not the faulting address).  The kernel maps the "invalid
    instruction" to SEGV, but fails to provide the real fault address.

    Because of this ASan lies and says that those cases are null
    dereferences.  This downgrades the severity of a found bug in terms of
    security.  In the ASan signal handler, we can not provide the real
    faulting address, but at least we can try not to lie.

    rdar://50366151

    Reviewed By: vitalybuka

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

    llvm-svn: 374265 — yln / ViewSVN
  36. gn build: Merge r374381 — gnsyncbot / ViewSVN
  37. Add GsymCreator and GsymReader.

    This patch adds the ability to create GSYM files with GsymCreator, and read them with GsymReader. Full testing has been added for both new classes.

    This patch differs from the original patch https://reviews.llvm.org/D53379 in that is uses a StringTableBuilder class from llvm instead of a custom version. Support for big and little endian files has been added. If the endianness matches the current host, we use efficient extraction for the header, address table and address info offset tables.

    Differential Revision: https://reviews.llvm.org/D68744 — gclayton / ViewSVN
  38. [dsymutil] Move CommonSymbols.clear() in resetParserState.

    This seems like a more natural place to clear the vector, especially
    since this method is clearing other data structures as well. — Jonas Devlieghere / ViewSVN
  39. [ARM] VQSUB instruction

    Same as VQADD, VQSUB can be selected from llvm.ssub.sat intrinsics.

    Differential Revision: https://reviews.llvm.org/D68567 — dmgreen / ViewSVN
  40. [Codegen] Alter the default promotion for saturating adds and subs

    The default promotion for the add_sat/sub_sat nodes currently does:
       1. ANY_EXTEND iN to iM
       2. SHL by M-N
       3. [US][ADD|SUB]SAT
       4. L/ASHR by M-N
    If the promoted add_sat or sub_sat node is not legal, this can produce code
    that effectively does a lot of shifting (and requiring large constants to be
    materialised) just to use the overflow flag. It is simpler to just do the
    saturation manually, using the higher bitwidth addition and a min/max against
    the saturating bounds. That is what this patch attempts to do.

    Differential Revision: https://reviews.llvm.org/D68643 — dmgreen / ViewSVN
  41. Fix assertions disabled builds after rL374367 — kadircet / ViewSVN
  42. [DAGCombiner] reduce code duplication; NFC — spatel / ViewSVN
  43. [Alignment][NFC] Use llv::Align in GISelKnownBits

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68786 — gchatelet / ViewSVN
  44. [BPF] Remove relocation for patchable externs

    Previously, patchable extern relocations are introduced to patch
    external variables used for multi versioning in
    compile once, run everywhere use case. The load instruction
    will be converted into a move with an patchable immediate
    which can be changed by bpf loader on the host.

    The kernel verifier has evolved and is able to load
    and propagate constant values, so compiler relocation
    becomes unnecessary. This patch removed codes related to this.

    Differential Revision: https://reviews.llvm.org/D68760 — yhs / ViewSVN
  45. In openFileForRead don't cache erroneous entries if the error relates to them being directories. Add tests.

    Summary:
    It seems that when the CachingFileSystem is first given a file to open that is actually a directory, it incorrectly
    caches that path to be errenous and throws an error when subsequently a directory open call is made for the same
    path.
    This change makes it so that we do NOT cache a path if it turns out we asked for a file when its a directory.

    Reviewers: arphaman

    Subscribers: dexonsmith, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68193 — kousikk / ViewSVN
  46. [AMDGPU] Fixed dpp_combine.mir with expensive checks. NFC. — rampitec / ViewSVN
  47. Fix Wdocumentation warnings. NFCI. — rksimon / ViewSVN
  48. [OPENMP50]Register vendor name only once in vendor context selector.

    No need to store multiple copies of the same vendor names in the context
    selector, keep only single copy. — abataev / ViewSVN
  49. [MCA] Show aggregate over Average Wait times for the whole snippet (PR43219)

    Summary:
    As disscused in https://bugs.llvm.org/show_bug.cgi?id=43219,
    i believe it may be somewhat useful to show //some// aggregates
    over all the sea of statistics provided.

    Example:
    ```
    Average Wait times (based on the timeline view):
    [0]: Executions
    [1]: Average time spent waiting in a scheduler's queue
    [2]: Average time spent waiting in a scheduler's queue while ready
    [3]: Average time elapsed from WB until retire stage

          [0]    [1]    [2]    [3]
    0.     3     1.0    1.0    4.7       vmulps     %xmm0, %xmm1, %xmm2
    1.     3     2.7    0.0    2.3       vhaddps    %xmm2, %xmm2, %xmm3
    2.     3     6.0    0.0    0.0       vhaddps    %xmm3, %xmm3, %xmm4
           3     3.2    0.3    2.3       <total>
    ```
    I.e. we average the averages.

    Reviewers: andreadb, mattd, RKSimon

    Reviewed By: andreadb

    Subscribers: gbedwell, arphaman, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68714 — lebedevri / ViewSVN
  50. Revert "[FileCheck] Implement --ignore-case option."

    This reverts commit r374339. It broke tests:
    http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066 — gribozavr / ViewSVN
  51. Revert "[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj)."

    This reverts commit r374343. It broke tests:
    http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066 — gribozavr / ViewSVN
  52. Revert "Fix OCaml/core.ml fneg check"

    This reverts commit r374346. It attempted to fix OCaml tests, but is
    does not actually fix them. — gribozavr / ViewSVN
  53. [X86] combineFMA - Convert to use isNegatibleForFree/GetNegatedExpression.

    Split off from D67557. — rksimon / ViewSVN
  54. Fix OCaml/core.ml fneg check (try 2) — rksimon / ViewSVN
  55. Revert "[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator"

    This reverts commit r374240. It broke OCaml tests:
    http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19014 — gribozavr / ViewSVN
  56. [X86] combineFMADDSUB - Convert to use isNegatibleForFree/GetNegatedExpression.

    Split off from D67557, fixes the compile time regression mentioned in rL372756 — rksimon / ViewSVN
  57. Revert "[test] Use system locale for mri-utf8.test"

    This reverts commit r374318 / b6f1d1fa0e3ee0e25f22414bf97c05276b934507. — thopre / ViewSVN
  58. Revert "[AMDGPU] Run `unreachable-mbb-elimination` after isel to clean up PHIs."

    Summary:
    This has been superseded by "[AMDGPU]: PHI Elimination hooks added for custom COPY insertion."

    This reverts the code changes from commit 53f967f2bdb6aa7b08596880c3689d1ecad6f0ff
    but keeps the test case.

    Reviewers: hliao, arsenm, tpr, dstuttard

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68769 — foad / ViewSVN
  59. Fix OCaml/core.ml fneg check — rksimon / ViewSVN
  60. [DAG][X86] Add isNegatibleForFree/GetNegatedExpression override placeholders. NFCI.

    Continuing to undo the rL372756 reversion.

    Differential Revision: https://reviews.llvm.org/D67557 — rksimon / ViewSVN
  61. [llvm-readelf] - Do not enter an infinite loop when printing histogram.

    This is similar to D68086.
    We are entering an infinite loop when dumping a histogram for a specially crafted
    .hash section with a loop in a chain.

    Differential revision: https://reviews.llvm.org/D68771 — grimar / ViewSVN
  62. [Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).

    The command `od -t x` is used to dump data in hex format.
    The LIT tests assumes that the hex characters are in lowercase.
    However, there are also platforms which use uppercase letter.

    To solve this issue the tests are updated to use the new
    `--ignore-case` option of FileCheck.

    Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson

    Differential Revision: https://reviews.llvm.org/D68693 — redstar / ViewSVN
  63. [DAGCombine] Match more patterns for half word bswap

    Summary: It ensures that the bswap is generated even when a part of the subtree already matches a bswap transform.

    Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68250 — deadalnix / ViewSVN
  64. [FileCheck] Implement --ignore-case option.

    The FileCheck utility is enhanced to support a `--ignore-case`
    option. This is useful in cases where the output of Unix tools
    differs in case (e.g. case not specified by Posix).

    Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson, MaskRay

    Differential Revision: https://reviews.llvm.org/D68146 — redstar / ViewSVN
  65. [LV][NFC] Factor out calculation of "best" estimated trip count.

    This is just small refactoring to minimize changes in upcoming patch.
    In the next path I'm going to introduce changes into heuristic for vectorization of "tiny trip count" loops.

    Patch by Evgeniy Brevnov <evgueni.brevnov@gmail.com>

    Reviewers: hsaito, Ayal, fhahn, reames

    Reviewed By: hsaito

    Differential Revision: https://reviews.llvm.org/D67690 — fhahn / ViewSVN
  66. MinidumpYAML: Add support for the memory info list stream

    Summary:
    The implementation is fairly straight-forward and uses the same patterns
    as the existing streams. The yaml form does not attempt to preserve the
    data in the "gaps" that can be created by setting a larger-than-required
    header or entry size in the stream header, because the existing consumer
    (lldb) does not make use of the information in the gap in any way, and
    attempting to preserve that would make the implementation more
    complicated.

    Reviewers: amccarth, jhenderson, clayborg

    Subscribers: llvm-commits, lldb-commits, markmentovai, zturner, JosephTremoulet

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68645 — labath / ViewSVN
  67. [ARM] VQADD instructions

    This selects MVE VQADD from the vector llvm.sadd.sat or llvm.uadd.sat
    intrinsics.

    Differential Revision: https://reviews.llvm.org/D68566 — dmgreen / ViewSVN
  68. [AArch64][x86] add tests for (v)select bit magic; NFC — spatel / ViewSVN
  69. [Sanitizers] Fix getrandom test — David CARLIER / ViewSVN
  70. [Alignment][NFC] Make VectorUtils uas llvm::Align

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, rogfer01, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68784 — gchatelet / ViewSVN
  71. [AST] ASTReader::ReadSLocEntry(): move computation of FirstDecl into the branch where it's used

    The existing code is not defined, you are not allowed
    to produce non-null pointer from null pointer (F->FileSortedDecls here).
    That being said, i'm not really confident this is fix-enough, but we'll see.

    FAIL: Clang :: Modules/no-module-map.cpp (6879 of 16079)
    ******************** TEST 'Clang :: Modules/no-module-map.cpp' FAILED ********************
    Script:
    --
    : 'RUN: at line 1';   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/clang -cc1 -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/lib/clang/10.0.0/include -nostdsysteminc -fmodules-ts -fmodule-name=ab -x c++-header /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/Inputs/no-module-map/a.h /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/Inputs/no-module-map/b.h -emit-header-module -o /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/test/Modules/Output/no-module-map.cpp.tmp.pcm
    : 'RUN: at line 2';   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/clang -cc1 -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/lib/clang/10.0.0/include -nostdsysteminc -fmodules-ts -fmodule-file=/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/test/Modules/Output/no-module-map.cpp.tmp.pcm /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/no-module-map.cpp -I/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/Inputs/no-module-map -verify
    : 'RUN: at line 3';   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/clang -cc1 -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/lib/clang/10.0.0/include -nostdsysteminc -fmodules-ts -fmodule-file=/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/test/Modules/Output/no-module-map.cpp.tmp.pcm /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/no-module-map.cpp -I/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/Inputs/no-module-map -verify -DA
    : 'RUN: at line 4';   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/clang -cc1 -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/lib/clang/10.0.0/include -nostdsysteminc -fmodules-ts -fmodule-file=/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/test/Modules/Output/no-module-map.cpp.tmp.pcm /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/no-module-map.cpp -I/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/Inputs/no-module-map -verify -DB
    : 'RUN: at line 5';   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/clang -cc1 -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/lib/clang/10.0.0/include -nostdsysteminc -fmodules-ts -fmodule-file=/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/test/Modules/Output/no-module-map.cpp.tmp.pcm /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/no-module-map.cpp -I/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/Inputs/no-module-map -verify -DA -DB
    : 'RUN: at line 7';   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/clang -cc1 -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/lib/clang/10.0.0/include -nostdsysteminc -E /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/test/Modules/Output/no-module-map.cpp.tmp.pcm -o - | /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/FileCheck /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/no-module-map.cpp
    : 'RUN: at line 8';   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/clang -cc1 -internal-isystem /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/lib/clang/10.0.0/include -nostdsysteminc -frewrite-imports -E /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/test/Modules/Output/no-module-map.cpp.tmp.pcm -o - | /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/FileCheck /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/test/Modules/no-module-map.cpp
    --
    Exit Code: 2

    Command Output (stderr):
    --
    /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Serialization/ASTReader.cpp:1526:50: runtime error: applying non-zero offset 8 to null pointer
        #0 0x3a9bd0c in clang::ASTReader::ReadSLocEntry(int) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Serialization/ASTReader.cpp:1526:50
        #1 0x328b6f8 in clang::SourceManager::loadSLocEntry(unsigned int, bool*) const /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Basic/SourceManager.cpp:461:28
        #2 0x328b351 in clang::SourceManager::initializeForReplay(clang::SourceManager const&) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Basic/SourceManager.cpp:399:11
        #3 0x3996c71 in clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Frontend/FrontendAction.cpp:581:27
        #4 0x394f341 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:956:13
        #5 0x3a8a92b in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:25
        #6 0xaf8d62 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/tools/driver/cc1_main.cpp:250:15
        #7 0xaf1602 in ExecuteCC1Tool /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/tools/driver/driver.cpp:309:12
        #8 0xaf1602 in main /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/tools/driver/driver.cpp:382:12
        #9 0x7f2c1eecc2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
        #10 0xad57f9 in _start (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/clang-10+0xad57f9)

    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Serialization/ASTReader.cpp:1526:50 in — lebedevri / ViewSVN
  72. [ADR] ArrayRefTest: disable SizeTSizedOperations test - it's UB.

    This test is not defined.

    FAIL: LLVM-Unit :: ADT/./ADTTests/ArrayRefTest.SizeTSizedOperations (178 of 33926)
    ******************** TEST 'LLVM-Unit :: ADT/./ADTTests/ArrayRefTest.SizeTSizedOperations' FAILED ********************
    Note: Google Test filter = ArrayRefTest.SizeTSizedOperations
    [==========] Running 1 test from 1 test case.
    [----------] Global test environment set-up.
    [----------] 1 test from ArrayRefTest
    [ RUN      ] ArrayRefTest.SizeTSizedOperations
    /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32: runtime error: applying non-zero offset 9223372036854775806 to null pointer
        #0 0x5ae8dc in llvm::ArrayRef<char>::slice(unsigned long, unsigned long) const /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32
        #1 0x5ae44c in (anonymous namespace)::ArrayRefTest_SizeTSizedOperations_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/unittests/ADT/ArrayRefTest.cpp:85:3
        #2 0x928a96 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2474:5
        #3 0x929793 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
        #4 0x92a152 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
        #5 0x9319d2 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
        #6 0x931416 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:4257:10
        #7 0x920ac3 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
        #8 0x920ac3 in main /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50:10
        #9 0x7f66135b72e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
        #10 0x472c19 in _start (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/unittests/ADT/ADTTests+0x472c19)

    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32 in — lebedevri / ViewSVN
  73. Fix -Wparentheses warning. NFCI. — rksimon / ViewSVN
  74. Revert "Use -fdebug-compilation-dir to form absolute paths in coverage mappings"

    This reverts commit f6777964bde28c349d3e289ea37ecf5f5eeedbc4.

    Because the absolute path check relies on temporary path containing
    "clang", "test" and "CoverageMapping" as a subsequence, which is not
    necessarily true on all systems(breaks internal integrates). Wanted to
    fix it by checking for a leading "/" instead, but then noticed that it
    would break windows tests, so leaving it to the author instead. — kadircet / ViewSVN
  75. Fix sanitizer lint check after r374315 — russell_gallop / ViewSVN
  76. [Mips] Fix 374055

    EXPENSIVE_CHECKS build was failing on new test.
    This is fixed by marking $ra register as undef.
    Test now has -verify-machineinstrs to check for operand flags. — mbrkusanin / ViewSVN
  77. [test] Use system locale for mri-utf8.test

    Summary:
    llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be
    installed for its last RUN line to work. If not installed, the unicode
    string gets encoded (interpreted) as ascii which fails since the most
    significant byte is non zero. This commit changes the test to only rely
    on the system being able to encode the pound sign in its default
    encoding (e.g. UTF-16 for Microsoft Windows) by always opening the file
    via input/output redirection. This avoids forcing a given locale to be
    present and supported. A Byte Order Mark is also added to help
    recognizing the encoding of the file and its endianness.

    Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb

    Subscribers: dexonsmith, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68472 — thopre / ViewSVN
  78. [UBSan] Appease linter — lebedevri / ViewSVN
  79. [Sanitizers] Porting getrandom/getentropy interceptors to FreeBSD

    - Available from 12.x branch, by the time it lands next year in FreeBSD tree, the 11.x's might be EOL.
    - Intentionally changed the getrandom test to C code as with 12.0 (might be fixed in CURRENT since), there is a linkage issue in C++ context.

    Reviewers: emaste, dim, vitalybuka

    Reviewed-By: vitalybuka

    Differential Revision: https://reviews.llvm.org/D68451 — David CARLIER / ViewSVN
  80. [UBSan] Split nullptr-and-nonzero-offset-variable.c in another direction — lebedevri / ViewSVN
  81. Revert "[ASan] Do not misrepresent high value address dereferences as null dereferences"

    As it was breaking bots running sanitizer lint check

    This reverts r374265 (git b577efe4567f1f6a711ad36e1d17280dd1c4f009) — russell_gallop / ViewSVN
  82. [UBSan] Split nullptr-and-nonzero-offset-variable.cpp into C and C++ variants

    I do not understand the BB failire, it fully passes locally. — lebedevri / ViewSVN
  83. [IfCvt][ARM] Optimise diamond if-conversion for code size

    Currently, the heuristics the if-conversion pass uses for diamond if-conversion
    are based on execution time, with no consideration for code size. This adds a
    new set of heuristics to be used when optimising for code size.

    This is mostly target-independent, because the if-conversion pass can
    see the code size of the instructions which it is removing. For thumb,
    there are a few passes (insertion of IT instructions, selection of
    narrow branches, and selection of CBZ instructions) which are run after
    if conversion and affect these heuristics, so I've added target hooks to
    better predict the code-size effect of a proposed if-conversion.

    Differential revision: https://reviews.llvm.org/D67350 — ostannard / ViewSVN
  84. [UBSan] Revisit nullptr-and-nonzero-offset-variable.cpp test to hopefully make it pass on sanitizer-windows BB — lebedevri / ViewSVN
  85. Remove rest of time-trace message as it is inconsistent style

    Other options which create output files don't produce output messages.
    Improve documentation to help find trace file.

    Differential Revision: https://reviews.llvm.org/D68710 — russell_gallop / ViewSVN
  86. [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

    Summary:
    Quote from http://eel.is/c++draft/expr.add#4:
    ```
    4     When an expression J that has integral type is added to or subtracted
          from an expression P of pointer type, the result has the type of P.
    (4.1) If P evaluates to a null pointer value and J evaluates to 0,
          the result is a null pointer value.
    (4.2) Otherwise, if P points to an array element i of an array object x with n
          elements ([dcl.array]), the expressions P + J and J + P
          (where J has the value j) point to the (possibly-hypothetical) array
          element i+j of x if 0≤i+j≤n and the expression P - J points to the
          (possibly-hypothetical) array element i−j of x if 0≤i−j≤n.
    (4.3) Otherwise, the behavior is undefined.
    ```

    Therefore, as per the standard, applying non-zero offset to `nullptr`
    (or making non-`nullptr` a `nullptr`, by subtracting pointer's integral value
    from the pointer itself) is undefined behavior. (*if* `nullptr` is not defined,
    i.e. e.g. `-fno-delete-null-pointer-checks` was *not* specified.)

    To make things more fun, in C (6.5.6p8), applying *any* offset to null pointer
    is undefined, although Clang front-end pessimizes the code by not lowering
    that info, so this UB is "harmless".

    Since rL369789 (D66608 `[InstCombine] icmp eq/ne (gep inbounds P, Idx..), null -> icmp eq/ne P, null`)
    LLVM middle-end uses those guarantees for transformations.
    If the source contains such UB's, said code may now be miscompiled.
    Such miscompilations were already observed:
    * https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190826/687838.html
    * https://github.com/google/filament/pull/1566

    Surprisingly, UBSan does not catch those issues
    ... until now. This diff teaches UBSan about these UB's.

    `getelementpointer inbounds` is a pretty frequent instruction,
    so this does have a measurable impact on performance;
    I've addressed most of the obvious missing folds (and thus decreased the performance impact by ~5%),
    and then re-performed some performance measurements using my [[ https://github.com/darktable-org/rawspeed | RawSpeed ]] benchmark:
    (all measurements done with LLVM ToT, the sanitizer never fired.)
    * no sanitization vs. existing check: average `+21.62%` slowdown
    * existing check vs. check after this patch: average `22.04%` slowdown
    * no sanitization vs. this patch: average `48.42%` slowdown

    Reviewers: vsk, filcab, rsmith, aaron.ballman, vitalybuka, rjmccall, #sanitizers

    Reviewed By: rsmith

    Subscribers: kristof.beyls, nickdesaulniers, nikic, ychen, dtzWill, xbolva00, dberris, arphaman, rupprecht, reames, regehr, llvm-commits, cfe-commits

    Tags: #clang, #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D67122 — lebedevri / ViewSVN
  87. Recommit "[Clang] Pragma vectorize_width() implies vectorize(enable)"

    This was further discussed at the llvm dev list:

    http://lists.llvm.org/pipermail/llvm-dev/2019-October/135602.html

    I think the brief summary of that is that this change is an improvement,
    this is the behaviour that we expect and promise in ours docs, and also
    as a result there are cases where we now emit diagnostics whereas before
    pragmas were silently ignored. Two areas where we can improve: 1) the
    diagnostic message itself, and 2) and in some cases (e.g. -Os and -Oz)
    the vectoriser is (quite understandably) not triggering.

    Original commit message:

    Specifying the vectorization width was supposed to implicitly enable
    vectorization, except that it wasn't really doing this. It was only
    setting the vectorize.width metadata, but not vectorize.enable.

    This should fix PR27643. — sjoerdmeijer / ViewSVN
  88. [update_cc_test_checks] Support 'clang | opt | FileCheck'

    Some clang lit tests use a pipeline of the form

    // RUN: %clang [args] -O0 %s | opt [specific optimizations] | FileCheck %s

    to make the expected test output depend on as few optimization phases
    as possible, for stability. But when you write a RUN line of this
    form, you lose the ability to use update_cc_test_checks.py to
    automatically generate the expected output, because it only supports
    two-stage pipelines consisting of '%clang | FileCheck' (or %clang_cc1).

    This change extends the set of supported RUN lines so that pipelines
    with an invocation of `opt` in the middle can still be automatically
    handled.

    To implement it, I've adjusted `get_function_body()` so that it can
    cope with an arbitrary sequence of intermediate pipeline commands. But
    the code that decides which RUN lines to consider is more
    conservative: it only adds clang | opt | FileCheck to the set of
    supported lines, because I didn't want to accidentally include some
    other kind of line that doesn't output IR at all.

    (Also in this commit is the minimal change to make this script work at
    all, after r373912 added an extra parameter to `add_ir_checks`.)

    Reviewers: MaskRay, xbolva00

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68406 — statham / ViewSVN
  89. [clang] prevent crash for nonnull attribut in constant context (Bug 43601)

    Summary:

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

    Reviewers: rnk

    Reviewed By: rnk

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68716 — tyker / ViewSVN
  90. AMDGPU: Use SGPR_128 instead of SReg_128 for vregs

    SGPR_128 only includes the real allocatable SGPRs, and SReg_128 adds
    the additional non-allocatable TTMP registers. There's no point in
    allocating SReg_128 vregs. This shrinks the size of the classes
    regalloc needs to consider, which is usually good. — arsenm / ViewSVN
  91. [X86] Add test case for trunc_packus_v16i32_v16i8 with avx512vl+avx512bw and prefer-vector-width=256 and min-legal-vector-width=256. NFC — ctopper / ViewSVN
  92. [Attributor][NFC] clang format — jdoerfert / ViewSVN
  93. [Attributor] Handle `null` differently in capture and alias logic

    Summary:
    `null` in the default address space (=AS 0) cannot be captured nor can
    it alias anything. We make this clear now as it can be important for
    callbacks and other cases later on. In addition, this patch improves the
    debug output for noalias deduction.

    Reviewers: sstefan1, uenoku

    Subscribers: hiraditya, bollu, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68624 — jdoerfert / ViewSVN
  94. gn build: Merge r374277 — gnsyncbot / ViewSVN
  95. Reland "[TextAPI] Introduce TBDv4"

    Original Patch broke for compilations w/ gcc and exposed asan fail.
    This reland repairs those bugs.

    Differential Revision: https://reviews.llvm.org/D67529 — cishida / ViewSVN
  96. [ast] Fix indentation. NFC. — hliao / ViewSVN
  97. [sema] Revise `getCurrentMangleNumberContext` interface. NFC.

    - Prefer returning mulitple values using a tuple instead of
      additional pointers/references. — hliao / ViewSVN
  98. [PowerPC] add testcase for ppc loop instr form prep - NFC — shchenz / ViewSVN
  99. gn build: (manually) merge r374271 — nico / ViewSVN
  100. [libTooling] Move Transformer files to their own directory/library.

    Summary:
    The Transformer library has been growing inside of
    lib/Tooling/Refactoring. However, it's not really related to anything else in
    that directory. This revision moves all Transformer-related files into their own
    include & lib directories.  A followup revision will (temporarily) add
    forwarding headers to help any users migrate their code to the new location.

    Reviewers: gribozavr

    Subscribers: mgorny, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68637 — ymandel / ViewSVN
  101. Re-land [mangle] Fix mangling where an extra mangle context is required.

    This reverts r374268 (git commit c34385d07c7d59447bf836b740f032235391d121)

    I think I reverted this by mistake, so I'm relanding it. While my bisect
    found this revision, I think the crashes I'm seeing locally must be
    environmental. Maybe the version of clang I'm using miscompiles tot
    clang. — rnk / ViewSVN
  102. Revert [mangle] Fix mangling where an extra mangle context is required.

    This reverts r374200 (git commit fd18e94697c987d5f24e25aa4e27adaffff3cce4)

    Causes crashes just compiling `int main() {}` on my machine. — rnk / ViewSVN
  103. [codeview] Try to avoid emitting .cv_loc with line zero

    Summary:
    Visual Studio doesn't like it while stepping. It kicks you out of the
    source view of the file being stepped through and tries to fall back to
    the disassembly view.

    Fixes PR43530

    The fix is incomplete, because it's possible to have a basic block with
    no source locations at all. In this case, we don't emit a .cv_loc, but
    that will result in wrong stepping behavior in the debugger if the
    layout predecessor of the location-less BB has an unrelated source
    location. We could try harder to find a valid location that dominates or
    post-dominates the current BB, but in general it's a dataflow problem,
    and one still might not exist. I left a FIXME about this.

    As an alternative, we might want to consider having the middle-end check
    if its emitting codeview and get it to stop using line zero.

    Reviewers: akhuang

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68747 — rnk / ViewSVN
  104. Use -fdebug-compilation-dir to form absolute paths in coverage mappings

    This allows users to explicitly request relative paths with
    `-fdebug-compilation-dir .`.

    Fixes PR43614

    Reviewers: vsk, arphaman

    Differential Revision: https://reviews.llvm.org/D68733 — rnk / ViewSVN
  105. [ASan] Do not misrepresent high value address dereferences as null dereferences

    Dereferences with addresses above the 48-bit hardware addressable range
    produce "invalid instruction" (instead of "invalid access") hardware
    exceptions (there is no hardware address decoding logic for those bits),
    and the address provided by this exception is the address of the
    instruction (not the faulting address).  The kernel maps the "invalid
    instruction" to SEGV, but fails to provide the real fault address.

    Because of this ASan lies and says that those cases are null
    dereferences.  This downgrades the severity of a found bug in terms of
    security.  In the ASan signal handler, we can not provide the real
    faulting address, but at least we can try not to lie.

    rdar://50366151

    Reviewed By: vitalybuka

    Differential Revision: https://reviews.llvm.org/D68676 — yln / ViewSVN

#5509 (Oct 9, 2019 4:58:47 PM)

  1. [CUDA][HIP] Fix host/device check with -fopenmp

    CUDA/HIP program may be compiled with -fopenmp. In this case, -fopenmp is only passed to host compilation
    to take advantages of multi-threads computation.

    CUDA/HIP and OpenMP both use Sema::DeviceCallGraph to store functions to be analyzed and remove them
    once they decide the function is sure to be emitted. CUDA/HIP and OpenMP have different functions to determine
    if a function is sure to be emitted.

    To check host/device correctly for CUDA/HIP when -fopenmp is enabled, there needs a unified logic to determine
    whether a function is to be emitted. The logic needs to be aware of both CUDA and OpenMP logic.

    Differential Revision: https://reviews.llvm.org/D67837 — yaxunl / ViewSVN
  2. Conservatively add volatility and atomic checks in a few places

    As background, starting in D66309, I'm working on support unordered atomics analogous to volatile flags on normal LoadSDNode/StoreSDNodes for X86.

    As part of that, I spent some time going through usages of LoadSDNode and StoreSDNode looking for cases where we might have missed a volatility check or need an atomic check. I couldn't find any cases that clearly miscompile - i.e. no test cases - but a couple of pieces in code loop suspicious though I can't figure out how to exercise them.

    This patch adds defensive checks and asserts in the places my manual audit found. If anyone has any ideas on how to either a) disprove any of the checks, or b) hit the bug they might be fixing, I welcome suggestions.

    Differential Revision: https://reviews.llvm.org/D68419 — reames / ViewSVN
  3. gn build: Merge r374245 — gnsyncbot / ViewSVN
  4. [WebAssembly] Fix tests missed in rL374235 — tlively / ViewSVN
  5. [sanitizer_common] Remove OnPrint from Go build.

    Summary: Go now uses __sanitizer_on_print instead.

    Reviewers: vitalybuka, dvyukov

    Reviewed By: vitalybuka

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68621 — morehouse / ViewSVN
  6. AMDGPU: Don't fold copies to physregs

    In a future patch, this will help cleanup m0 handling.

    The register coalescer handles copies from a register that
    materializes an immediate, but doesn't handle move immediates
    itself. The virtual register uses will often be allocated to the same
    register, so there end up being no real copy. — arsenm / ViewSVN
  7. AMDGPU/GlobalISel: Fix crash on wide constant load with VGPR pointer

    This was ignoring the register bank of the input pointer, and
    isUniformMMO seems overly aggressive.

    This will now conservatively assume a VGPR in cases where the incoming
    bank hasn't been determined yet (i.e. is from a loop phi). — arsenm / ViewSVN
  8. AMDGPU: Relax register classes used — arsenm / ViewSVN
  9. AMDGPU: Fix typos — arsenm / ViewSVN
  10. GlobalISel: Implement fewerElementsVector for G_BUILD_VECTOR

    Turn it into a G_CONCAT_VECTORS of G_BUILD_VECTOR. — arsenm / ViewSVN
  11. gn build: (manually) merge r374219 — nico / ViewSVN
  12. [libc++][test] Miscellaneous MSVC cleanups

    * Silence unused-local-typedef warnings: `map.cons/assign_initializer_list.pass.cpp` (and the `set.cons` variant) uses a local typedef only within `LIBCPP_ASSERT`s, so clang diagnoses it as unused when testing non-libc++.
    * Add missing include: `c.math/abs.pass.cpp` uses `std::numeric_limits` but failed to `#include <limits>`.
    * Don't test non-type: A "recent" change to `meta.trans.other/underlying_type.pass.cpp` unconditionally tests the type `F` which is conditionally defined.
    * Use `hash<long long>` instead of `hash<short>` with `int` in `unordered_meow` deduction guide tests to avoid truncation warnings.
    * Convert `3.14` explicitly in `midpoint.float.pass` since MSVC incorrectly diagnoses `float meow = 3.14;` as truncating.

    Differential Revision: https://reviews.llvm.org/D68681 — caseycarter / ViewSVN
  13. [GISel] Refactor and split PatternMatchTest. NFC

    Split the ConstantFold part into a separate file and
    make it use the fixture GISelMITest. — mggm / ViewSVN
  14. [InstCombine] Fix PR43617

    Check for `nullptr` before inspecting composite function. — evandro / ViewSVN
  15. [AMDGPU] Fixed dpp combine of VOP1

    If original instruction did not have source modifiers they were
    not added to the new DPP instruction as well, even if needed.

    Differential Revision: https://reviews.llvm.org/D68729 — rampitec / ViewSVN
  16. [IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator

    Also update Clang to call Builder.CreateFNeg(...) for UnaryMinus.

    Differential Revision: https://reviews.llvm.org/D61675 — mcinally / ViewSVN
  17. [WebAssembly] Make returns variadic

    Summary:
    This is necessary and sufficient to get simple cases of multiple
    return working with multivalue enabled. More complex cases will
    require block and loop signatures to be generalized to potentially be
    type indices as well.

    Reviewers: aheejin, dschuff

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68684 — tlively / ViewSVN
  18. [SampleFDO] Add indexing for function profiles so they can be loaded on demand
    in ExtBinary format

    Currently for Text, Binary and ExtBinary format profiles, when we compile a
    module with samplefdo, even if there is no function showing up in the profile,
    we have to load all the function profiles from the profile input. That is a
    waste of compile time.

    CompactBinary format profile has already had the support of loading function
    profiles on demand. In this patch, we add the support to load profile on
    demand for ExtBinary format. It will work no matter the sections in ExtBinary
    format profile are compressed or not. Experiment shows it reduces the time to
    compile a server benchmark by 30%.

    When profile remapping and loading function profiles on demand are both used,
    extra work needs to be done so that the loading on demand process will take
    the name remapping into consideration. It will be addressed in a follow-up
    patch.

    Differential Revision: https://reviews.llvm.org/D68601 — wmi / ViewSVN
  19. llvm-dwarfdump: Support multiple debug_loclists contributions

    Also fixing the incorrect "offset" field being computed/printed for each
    location list. — dblaikie / ViewSVN
  20. [Docs] Adds section for Additional Topics on Reference page

    Adds a new section for Additional Topics on the Reference documentation page. Also moves Support Library topic to User Guides page. — dr87 / ViewSVN
  21. [libFuzzer] Fix Alarm callback in fuchsia.

    This patch adds an #if macro to skip the InFuzzingThread() comparison
    for fuchsia, similar to what it is done for Windows and NetBSD.

    In fuchsia, the alarm callback runs in a separate thread[0], making it fail
    the comparison InFuzzingThread(), breaking the -timeout flag.

    [0]:
    https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp#L323

    Author: charco (aka Marco  Vanotti)
    Differential Revision: https://reviews.llvm.org/D68166 — jakehehrlich / ViewSVN
  22. [OPENMP50]Fix scoring of contexts with and without user provided scores.

    The context selector with user provided score must have higher score
    than the context selector without user provided score. — abataev / ViewSVN
  23. [sanitizer, NFC] Fix grammar in comment — Vitaly Buka / ViewSVN
  24. [System Model] [TTI] Define AMDGPUTTIImpl::getST and AMDGPUTTIImpl::getTLI

    To fix "infinite recursion" warning. — Vitaly Buka / ViewSVN
  25. [System Model] [TTI] Fix virtual destructor warning — Vitaly Buka / ViewSVN
  26. [sanitizer] Disable signal_trap_handler on s390 — Vitaly Buka / ViewSVN
  27. [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries

    This patch removes the remaining part of the OpenMP offload linker scripts which was used for inserting device binaries into the output linked binary. Device binaries are now inserted into the host binary with a help of the wrapper bit-code file which contains device binaries as data. Wrapper bit-code file is dynamically created by the clang driver with a help of new tool clang-offload-wrapper which takes device binaries as input and produces bit-code file with required contents. Wrapper bit-code is then compiled to an object and resulting object is appended to the host linking by the clang driver.

    This is the second part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943).

    Differential Revision: https://reviews.llvm.org/D68166 — sdmitriev / ViewSVN
  28. [Docs] Adds Documentation links to sidebar

    Adds links to Getting Started/Tutorials, User Guides, and Reference documentation pages to sidebar. Also adds a new section for LLVM IR on the Reference documentation page. — dr87 / ViewSVN
  29. [sanitizer] Make signal_name a C test — Vitaly Buka / ViewSVN
  30. [sanitizer] Use raise() in test and cover more signals — Vitaly Buka / ViewSVN
  31. [ConstProp] add tests for extractelement with undef index; NFC — spatel / ViewSVN
  32. [AMDGPU] Use math constants defined in MathExtras (NFC)

    Use the the new math constants in `MathExtras.h`.

    Differential revision: https://reviews.llvm.org/D68285 — evandro / ViewSVN
  33. [Support] Add mathematical constants

    Add own version of the mathematical constants from the upcoming C++20 `std::numbers`.

    Differential revision: https://reviews.llvm.org/D68257 — evandro / ViewSVN
  34. [System Model] [TTI] Update cache and prefetch TTI interfaces

    Re-apply 9fdfb045ae8b/r365676 with fixes for PPC and Hexagon.  This involved
    moving defaults from TargetTransformInfoImplBase to MCSubtargetInfo.

    Rework the TTI cache and software prefetching APIs to prepare for the
    introduction of a general system model.  Changes include:

    - Marking existing interfaces const and/or override as appropriate
    - Adding comments
    - Adding BasicTTIImpl interfaces that delegate to a subtarget
      implementation
    - Moving the default TargetTransformInfoImplBase implementation to a default
      MCSubtarget implementation

    Only a handful of targets use these interfaces currently: AArch64, Hexagon, PPC
    and SystemZ.  AArch64 already has a custom subtarget implementation, so its
    custom TTI implementation is migrated to use the new facilities in BasicTTIImpl
    to invoke its custom subtarget implementation.  The custom TTI implementations
    continue to exist for the other targets with this change.  They are not moved
    over to subtarget-based implementations.

    The end goal is to have the default subtarget implementation defer to the system
    model defined by the target.  With this change, the default MCSubtargetInfo
    implementation essentially returns the defaults TargetTransformInfoImplBase used
    to return.  Existing users of TTI defaults will hit the defaults now in
    MCSubtargetInfo.  Targets that define their own custom TTI implementations won't
    use the BasicTTIImpl implementations that route to the subtarget.

    Once system models are in place for the targets that use these interfaces, their
    custom TTI implementations can be removed.

    Differential Revision: https://reviews.llvm.org/D63614 — greened / ViewSVN
  35. [ObjC generics] Fix not inheriting type bounds in categories/extensions.

    When a category/extension doesn't repeat a type bound, corresponding
    type parameter is substituted with `id` when used as a type argument. As
    a result, in the added test case it was causing errors like

    > type argument 'T' (aka 'id') does not satisfy the bound ('id<NSCopying>') of type parameter 'T'

    We are already checking that type parameters should be consistent
    everywhere (see `checkTypeParamListConsistency`) and update
    `ObjCTypeParamDecl` to have correct underlying type. And when we use the
    type parameter as a method return type or a method parameter type, it is
    substituted to the bounded type. But when we use the type parameter as a
    type argument, we check `ObjCTypeParamType` that ignores the updated
    underlying type and remains `id`.

    Fix by desugaring `ObjCTypeParamType` to the underlying type, the same
    way we are doing with `TypedefType`.

    rdar://problem/54329242

    Reviewers: erik.pilkington, ahatanak

    Reviewed By: erik.pilkington

    Subscribers: jkorous, dexonsmith, ributzka, cfe-commits

    Differential Revision: https://reviews.llvm.org/D66696 — vsapsai / ViewSVN
  36. [mangle] Fix mangling where an extra mangle context is required.

    Summary:
    - [Itanium C++ ABI][1], for certain contexts like default parameter and
      etc., mangling numbering will be local to the particular argument in
      which it appears.
    - However, for these cases, the mangle numbering context is allocated per
      expression evaluation stack entry. That causes, for example, two
      lambdas defined/used understand the same default parameter are
      numbered as the same value and, in turn, one of them is not generated
      at all.
    - In this patch, an extra mangle numbering context map is maintained in
      the AST context to map taht extra declaration context to its numbering
      context. So that, 2 different lambdas defined/used in the same default
      parameter are numbered differently.

    [1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html

    Reviewers: rsmith, eli.friedman

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68715 — hliao / ViewSVN
  37. [HIP] Fix -save-temps

    Currently clang does not save some of the intermediate file generated during device compilation for HIP when -save-temps is specified.

    This patch fixes that.

    Differential Revision: https://reviews.llvm.org/D68665 — yaxunl / ViewSVN
  38. DebugInfo: Shot in the dark attempt to fix ubsan error from r374122

    (specifying an underlying type for the enum might also be suitable - but
    this seems better/as good, since there's a clear expectation this can
    contain values other than the actual enumerators of this enum) — dblaikie / ViewSVN
  39. [lit] Refactor ProgressDisplay

    Move progress display to separate file.  Simplify some code paths.
    Decouple from other components via progress callback.  Remove unused
    `_Display` class.

    Reviewed By: serge-sans-paille

    Differential Revision: https://reviews.llvm.org/D68525 — yln / ViewSVN
  40. [ARM] Fix arm_neon.h with -flax-vector-conversions=none

    Really, we were already 99% of the way there; just needed a couple minor
    fixes that affected 64-bit-only builtins.  Based on D61717.

    Note that the change to builtin_str changes the type of a few
    __builtin_neon_* intrinsics that had the "wrong" type.

    Fixes https://bugs.llvm.org/show_bug.cgi?id=43341

    Differential Revision: https://reviews.llvm.org/D68683 — efriedma / ViewSVN
  41. [InstCombine] add another test for gep inbounds; NFC — spatel / ViewSVN
  42. [WebAssembly] Add builtin and intrinsic for v8x16.swizzle

    Summary:
    This clang builtin and corresponding LLVM intrinsic are necessary to
    expose the exact semantics of the underlying WebAssembly instruction
    to users. LLVM produces a poison value if the dynamic swizzle indices
    are greater than the vector size, but the WebAssembly instruction sets
    the corresponding output lane to zero. Users who depend on this
    behavior can safely use this builtin.

    Depends on D68527.

    Reviewers: aheejin, dschuff

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

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D68531 — tlively / ViewSVN
  43. [WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering

    Summary:
    Adds the new v8x16.swizzle SIMD instruction as specified at
    https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#swizzling-using-variable-indices.
    In addition to adding swizzles as a candidate lowering in
    LowerBUILD_VECTOR, also rewrites and simplifies the lowering to
    minimize the number of replace_lanes necessary rather than trying to
    minimize code size. This leads to more uses of v128.const instead of
    splats, which is expected to increase performance.

    The new code will be easier to tune once V8 implements all the vector
    construction operations, and it will also be easier to add new
    candidate instructions in the future if necessary.

    Reviewers: aheejin, dschuff

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68527 — tlively / ViewSVN
  44. [FPEnv][NFC] Change test to conform to strictfp attribute rules.

    In particular, the function definition is not marked strictfp despite
    containing a function marked strictfp. Also, if any function call is marked
    strictfp then all function calls in that function must be marked.

    This change to move the one strictfp call to a new properly marked function
    meets all the new rules.

    Tested with a stricter version of D68233.

    Reviewed by: spatel
    Approved by: spatel
    Differential Revision: https://reviews.llvm.org/D68713 — kpn / ViewSVN
  45. [SLP] respect target register width for GEP vectorization (PR43578)

    We failed to account for the target register width (max vector factor)
    when vectorizing starting from GEPs. This causes vectorization to
    proceed to obviously illegal widths as in:
    https://bugs.llvm.org/show_bug.cgi?id=43578

    For x86, this also means that SLP can produce rogue AVX or AVX512
    code even when the user specifies a narrower vector width.

    The AArch64 test in ext-trunc.ll appears to be better using the
    narrower width. I'm not exactly sure what getelementptr.ll is trying
    to do, but it's testing with "-slp-threshold=-18", so I'm not worried
    about those diffs. The x86 test is an over-reduction from SPEC h264;
    this patch appears to restore the perf loss caused by SLP when using
    -march=haswell.

    Differential Revision: https://reviews.llvm.org/D68667 — spatel / ViewSVN
  46. [AArch64] Ensure no tagged memory is left in the unallocated portion of the
    stack

    This patch makes sure that if we tag some memory, we untag that memory before
    the function returns/throws via any exit, reachable from the tag operation. For
    that we place the untag operation either at:

      a) the lifetime end call for the alloca, if that call post-dominates the
         lifetime start call (where the tag operation is placed), or it (the
         lifetime end call) dominates all reachable exits, otherwise
      b) at the reachable exits

    Differential Revision: https://reviews.llvm.org/D68469 — chill / ViewSVN
  47. [NFC] Remove files got accidentally upload in llvm-svn 374179 — jasonliu / ViewSVN
  48. [AIX][XCOFF][NFC] Change the SectionLen field name of CSect Auxiliary entry to SectionOrLength.

    Summary:
    According the the XCOFF document,
    If
    Then
    XTY_SD
    x_scnlen contains the csect length.
    XTY_LD
    x_scnlen contains the symbol table index of the containing csect.
    XTY_CM
    x_scnlen contains the csect length.
    XTY_ER
    x_scnlen contains 0.

    Change the SectionLen member name to SectionOrLength is more reasonable.

    Authored By: DiggerLin

    Reviewed By: hubert.reinterpretcast

    Differential Revision: https://reviews.llvm.org/D68650 — jasonliu / ViewSVN
  49. Re-land "[dsymutil] Fix handling of common symbols in multiple object files."

    The original patch got reverted because it hit a long-standing legacy
    issue on Windows that prevents files from being named `com`. Thanks
    Kristina & Jeremy for pointing this out. — Jonas Devlieghere / ViewSVN
  50. [MemorySSA] Make the use of moveAllAfterMergeBlocks consistent.

    Summary:
    The rule for the moveAllAfterMergeBlocks API si for all instructions
    from `From` to have been moved to `To`, while keeping the CFG edges (and
    block terminators) unchanged.
    Update all the callsites for moveAllAfterMergeBlocks to follow this.

    Pending follow-up: since the same behavior is needed everytime, merge
    all callsites into one. The common denominator may be the call to
    `MergeBlockIntoPredecessor`.

    Resolves PR43569.

    Reviewers: george.burgess.iv

    Subscribers: Prazek, sanjoy.google, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68659 — asbirlea / ViewSVN
  51. [NFC] Reverting changes from test commit.
    llvm commit access test succeeded. — mitchell / ViewSVN
  52. [NFC] Test commit.
    Testing llvm commit access only. — mitchell / ViewSVN
  53. [scudo][standalone] Get statistics in a char buffer

    Summary:
    Following up on D68471, this CL introduces some `getStats` APIs to
    gather statistics in char buffers (`ScopedString` really) instead of
    printing them out right away. Ultimately `printStats` will just
    output the buffer, but that allows us to potentially do some work
    on the intermediate buffer, and can be used for a `mallocz` type
    of functionality. This allows us to pretty much get rid of all the
    `Printf` calls around, but I am keeping the function in for
    debugging purposes.

    This changes the existing tests to use the new APIs when required.

    I will add new tests as suggested in D68471 in another CL.

    Reviewers: morehouse, hctim, vitalybuka, eugenis, cferris

    Reviewed By: morehouse

    Subscribers: delcypher, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D68653 — cryptoad / ViewSVN
  54. [clang-format] Update noexcept reference qualifiers detection

    Summary:
    r373165 fixed an issue where a templated noexcept member function with a
    reference qualifier would be indented more than expected:
    ```
    // Formatting produced with LLVM style with AlwaysBreakTemplateDeclarations: Yes

    // before r373165:
    struct f {
      template <class T>
          void bar() && noexcept {}
    };

    // after:
    struct f {
      template <class T>
      void bar() && noexcept {}
    };

    ```
    The way this is done is that in the AnnotatingParser in
    `lib/FormatTokenAnnotator.cpp` the determination of the usage of a `&` or `&&`
    (the line in determineTokenType

    ```
    Current.Type = determineStarAmpUsage(...
    ```
    is not performed in some cases anymore, combining with a few additional related
    checks afterwards. The net effect of these checks results in the `&` or `&&`
    token to start being classified as `TT_Unknown` in cases where before `r373165`
    it would be classified as `TT_UnaryOperator` or `TT_PointerOrReference` by
    `determineStarAmpUsage`.

    This inadvertently caused 2 classes of regressions I'm aware of:

    - The address-of `&` after a function assignment would be classified as
      `TT_Unknown`, causing spaces to surround it, disregarding style options:
    ```
    // before r373165:
    void (*fun_ptr)(void) = &fun;

    // after:
    void (*fun_ptr)(void) = & fun;
    ```

    - In cases where there is a function declaration list -- looking macro between
      a template line and the start of the function declaration, an `&` as part of
      the return type would be classified as `TT_Unknown`, causing spaces to
      surround it:
    ```
    // before r373165:
    template <class T>
    DEPRECATED("lala")
    Type& foo();

    // after:
    template <class T>
    DEPRECATED("lala")
    Type & foo();
    ```

    In these cases the problems are rooted in the skipping of the classification of
    a `&` (and similarly `&&`) by determineStarAmpUsage which effects the formatting
    decisions later in the pipeline.

    I've looked into the goal of r373165 and noticed that replacing `noexcept` with
    `const` in the given example produces no extra indentation with the old code:
    ```
    // before r373165:
    struct f {
      template <class T>
      int foo() & const {}
    };

    struct f {
      template <class T>
          int foo() & noexcept {}
    };
    ```

    I investigated how clang-format annotated these two examples differently to
    determine the places where the processing of both diverges in the pipeline.
    There were two places where the processing diverges, causing the extra indent in
    the `noexcept` case:
    1. The `const` is annotated as a `TT_TrailingAnnotation`, whereas `noexcept`
       is annotated as `TT_Unknown`. I've updated the `determineTokenType` function
       to account for this by adding a missing `tok:kw_noexcept` to the clause that
       marks a token as `TT_TrailingAnnotation`.
    2. The `&` in the second example is wrongly identified as `TT_BinaryOperator`
       in `determineStarAmpUsage`. This is the reason for the extra indentation --
       clang-format gets confused and thinks this is an expression.
       I've updated `determineStarAmpUsage` to check for `tok:kw_noexcept`.

    With these two updates in place, the additional parsing introduced by r373165
    becomes unnecessary and all added tests pass (with updates, as now clang-format
    respects the style configuration for spaces around the `&` in the test
    examples).
    I've removed these additions and added regression tests for the cases above.

    Reviewers: AndWass, MyDeveloperDay

    Reviewed By: MyDeveloperDay

    Subscribers: cfe-commits

    Tags: #clang, #clang-format

    Differential Revision: https://reviews.llvm.org/D68695 — krasimir / ViewSVN
  55. Fix Wdocumentation unknown parameter warning. NFCI. — rksimon / ViewSVN
  56. [llvm-exegesis] Ensure that ExecutableFunction are aligned.

    Summary: Experiments show that this is the alignment we get (for ELF+Linux), but let's ensure that we have it.

    Reviewers: gchatelet

    Subscribers: tschuett, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68703 — courbet / ViewSVN
  57. Add and adjust saturating tests. NFC

    This adds some extra testing to the existing [su][add/sub]_sat X86 and AArch64
    tests and adds equivalent tests for ARM. — dmgreen / ViewSVN
  58. [clangd] Make sure ReplyCallbacks are destroyed before RequestCancelersMutex

    Summary:
    After rL374163, replycallbacks might have a cancellable context, which
    will try to access RequestCancellers on destruction. See
    http://45.33.8.238/mac/1245/step_7.txt for a sample failure.

    Reviewers: sammccall

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits, thakis

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68702 — kadircet / ViewSVN
  59. [clang-offload-bundler] Support `.cui` and `.d`.

    Reviewers: tra, yaxunl

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68663 — hliao / ViewSVN
  60. [LV] Emitting SCEV checks with OptForSize

    When optimising for size and SCEV runtime checks need to be emitted to check
    overflow behaviour, the loop vectorizer can run in this assert:

      LoopVectorize.cpp:2699: void llvm::InnerLoopVectorizer::emitSCEVChecks(
      llvm::Loop *, llvm::BasicBlock *): Assertion `!BB->getParent()->hasOptSize()
      && "Cannot SCEV check stride or overflow when opt

    We should not generate predicates while optimising for size because
    code will be generated for predicates such as these SCEV overflow runtime
    checks.

    This should fix PR43371.

    Differential Revision: https://reviews.llvm.org/D68082 — sjoerdmeijer / ViewSVN
  61. [mips] Rename local variable. NFC — atanasyan / ViewSVN
  62. [mips] Split expandLoadImmReal into multiple methods. NFC

    The `expandLoadImmReal` handles four different and almost non-overlapping
    cases: loading a "single" float immediate into a GPR, loading a "single"
    float immediate into a FPR, and the same couple for a "double" float
    immediate.

    It's better to move each `else if` branch into separate methods. — atanasyan / ViewSVN
  63. [clangd] Propagate context into reply handlers — kadircet / ViewSVN
  64. [llvm-exegesis] Fix r374158

    Some bots complain about missing 'class':

    LlvmState.h:70:40: error: declaration of ‘std::unique_ptr<const llvm::TargetMachine> llvm::exegesis::LLVMState::TargetMachine’ [-fpermissive]
       std::unique_ptr<const TargetMachine> TargetMachine; — courbet / ViewSVN
  65. [CostModel][X86] Add tests for insertelement to non-immediate vector element indices — rksimon / ViewSVN
  66. [CostModel][X86] Add tests for extractelement from non-immediate vector element indices — rksimon / ViewSVN
  67. [ARM] Add saturating arithmetic tests for MVE. NFC — dmgreen / ViewSVN
  68. [llvm-exegesis][NFC] Remove extra `llvm::` qualifications.

    Summary: Second patch: in the lib.

    Reviewers: gchatelet

    Subscribers: nemanjai, tschuett, MaskRay, mgrang, jsji, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68692 — courbet / ViewSVN
  69. [llvm-exegesis][NFC] Remove extra `llvm::` qualifications.

    Summary: First patch: in unit tests.

    Subscribers: nemanjai, tschuett, MaskRay, jsji, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68687 — courbet / ViewSVN
  70. [mips] Set default float ABI to "soft" on FreeBSD

    Initial patch by Kyle Evans.

    Fix PR43596 — atanasyan / ViewSVN
  71. [DebugInfo] Enable call site debug info for ARM and AArch64

    ARM and AArch64 SelectionDAG support for tacking parameter forwarding
    register is implemented so we can allow clang invocations for those two
    targets.
    Beside that restrict debug entry value support to be emitted for
    LimitedDebugInfo info and FullDebugInfo. Other types of debug info do
    not have functions nor variables debug info.

    Reviewers: aprantl, probinson, dstenb, vsk

    Reviewed By: vsk

    Differential Revision: https://reviews.llvm.org/D67004 — nikolaprica / ViewSVN
  72. [Sema] Emit diagnostics for uncorrected delayed typos at the end of TU

    Summary:
    Instead of asserting all typos are corrected in the sema destructor.

    The sema destructor is not run in the common case of running the compiler
    with the -disable-free cc1 flag (which is the default in the driver).

    Having this assertion led to crashes in libclang and clangd, which are not
    reproducible when running the compiler.

    Asserting at the end of the TU could be an option, but finding all
    missing typo correction cases is hard and having worse diagnostics instead
    of a failing assertion is a better trade-off.

    For more discussion on this, see:
    https://lists.llvm.org/pipermail/cfe-dev/2019-July/062872.html

    Reviewers: sammccall, rsmith

    Reviewed By: rsmith

    Subscribers: usaxena95, dgoldman, jkorous, vsapsai, rnk, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D64799 — ibiryukov / ViewSVN
  73. Revert r374006: Reland 'Add VFS support for sanitizers' blacklist'

    Also revert follow-up changes to the test.
    Reason: the patch breaks our internal clang-tidy integration.

    It's also unclear why we should use getRealPath instead of plumbing the
    VFS to SanitizerBlacklist, see original commit thread of cfe-commits for
    a discussion. — ibiryukov / ViewSVN
  74. [TableGen] Fix crash when using HwModes in CodeEmitterGen

    When an instruction has an encoding definition for only a subset of
    the available HwModes, ensure we just avoid generating an encoding
    rather than crash. — jamesm / ViewSVN
  75. [llvm-exegesis] Add missing std::move in rL374146.

    This was breaking some bots:

    /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/include/llvm/Support/Error.h:483:5:   required from ‘llvm::Expected<T>::Expected(OtherT&&, typename std::enable_if<std::is_convertible<_Rep2, _Rep>::value>::type*) [with OtherT = std::vector<llvm::exegesis::CodeTemplate>&; T = std::vector<llvm::exegesis::CodeTemplate>; typename std::enable_if<std::is_convertible<_Rep2, _Rep>::value>::type = void]’
    /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:238:20:   required from here
    /usr/include/c++/6/bits/stl_construct.h:75:7: error: use of deleted function ‘llvm::exegesis::CodeTemplate::CodeTemplate(const llvm::exegesis::CodeTemplate&)’
         { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ — courbet / ViewSVN
  76. Unify the two CRC implementations

    David added the JamCRC implementation in r246590. More recently, Eugene
    added a CRC-32 implementation in r357901, which falls back to zlib's
    crc32 function if present.

    These checksums are essentially the same, so having multiple
    implementations seems unnecessary. This replaces the CRC-32
    implementation with the simpler one from JamCRC, and implements the
    JamCRC interface in terms of CRC-32 since this means it can use zlib's
    implementation when available, saving a few bytes and potentially making
    it faster.

    JamCRC took an ArrayRef<char> argument, and CRC-32 took a StringRef.
    This patch changes it to ArrayRef<uint8_t> which I think is the best
    choice, and simplifies a few of the callers nicely.

    Differential revision: https://reviews.llvm.org/D68570 — hans / ViewSVN
  77. [llvm-exegesis][NFC] Fix rL374146.

    Remove extra semicolon: Target.cpp:187:2: warning: extra ‘;’ [-Wpedantic] — courbet / ViewSVN
  78. [llvm-exegesis] Explore LEA addressing modes.

    Summary:
    This will help for PR32326.

    This shows the well-known issue with `RBP` and `R13` as base registers.

    Reviewers: gchatelet

    Subscribers: tschuett, llvm-commits, RKSimon, andreadb

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68646 — courbet / ViewSVN
  79. Revert r374139, "[dsymutil] Fix handling of common symbols in multiple object files."

    The added test files ("com", "com1.o", "com2.o") are reserved names on
    Windows, and makes 'git checkout' fail with a filesystem error. — jmorse / ViewSVN
  80. [llvm-exegesis][NFC] Remove unecessary `using llvm::` directives.

    We've been in namespace llvm for at least a year. — courbet / ViewSVN

#5508 (Oct 8, 2019 10:28:25 PM)

  1. [dsymutil] Fix handling of common symbols in multiple object files.

    For common symbols the linker emits only a single symbol entry in the
    debug map. This caused dsymutil to not relocate common symbols when
    linking DWARF coming form object files that did not have this entry.
    This patch fixes that by keeping track of common symbols in the object
    files and synthesizing a debug map entry for them using the address from
    the main binary.

    Differential revision: https://reviews.llvm.org/D68680 — Jonas Devlieghere / ViewSVN
  2. [TypeSize] Fix module builds (cassert)

    TypeSize.h uses `assert` statements without including
    the <cassert> header first which leads to failures
    in modular builds. — Kristina Brooks / ViewSVN
  3. Optimize operator=(const basic_string&) for tail call.

    Patch by Martijn Vels (mvels@google.com)
    Reviewed as https://reviews.llvm.org/D68276

    This is a non trivial win for externally templated assignment operator.

    x86 without tail call (current libc++)

    0000000000000000 <std::string::operator=(std::string const&)>:
       0:   55                      push   %rbp
       1:   48 89 e5                mov    %rsp,%rbp
       4:   53                      push   %rbx
       5:   50                      push   %rax
       6:   48 89 fb                mov    %rdi,%rbx
       9:   48 39 f7                cmp    %rsi,%rdi
       c:   74 17                   je     25 <std::string::operator=(std::string const&)+0x25>
       e:   0f b6 56 17             movzbl 0x17(%rsi),%edx
      12:   84 d2                   test   %dl,%dl
      14:   79 07                   jns    1d <std::string::operator=(std::string const&)+0x1d>
      16:   48 8b 56 08             mov    0x8(%rsi),%rdx
      1a:   48 8b 36                mov    (%rsi),%rsi
      1d:   48 89 df                mov    %rbx,%rdi
      20:   e8 00 00 00 00          callq  25 <std::string::operator=(std::string const&)+0x25>
      25:   48 89 d8                mov    %rbx,%rax
      28:   48 83 c4 08             add    $0x8,%rsp
      2c:   5b                      pop    %rbx
      2d:   5d                      pop    %rbp
      2e:   c3                      retq

    After:

    0000000000000000 <std::string::operator=(std::string const&)>:
       0:   48 39 f7                cmp    %rsi,%rdi
       3:   74 14                   je     19 <std::string::operator=(std::string const&)+0x19>
       5:   0f b6 56 17             movzbl 0x17(%rsi),%edx
       9:   84 d2                   test   %dl,%dl
       b:   79 07                   jns    14 <std::string::operator=(std::string const&)+0x14>
       d:   48 8b 56 08             mov    0x8(%rsi),%rdx
      11:   48 8b 36                mov    (%rsi),%rsi
      14:   e9 00 00 00 00          jmpq   19 <std::string::operator=(std::string const&)+0x19>
      19:   48 89 f8                mov    %rdi,%rax
      1c:   c3                      retq

    Benchmark (pending per https://reviews.llvm.org/D67667)

    ```
    BM_StringAssignStr_Empty_Opaque                     6.23ns ± 0%             5.19ns ± 0%  -16.70%          (p=0.016 n=5+4)
    BM_StringAssignStr_Empty_Transparent                5.86ns ± 0%             5.14ns ± 0%  -12.24%          (p=0.008 n=5+5)
    BM_StringAssignStr_Small_Opaque                     8.79ns ± 1%             7.69ns ± 0%  -12.53%          (p=0.008 n=5+5)
    BM_StringAssignStr_Small_Transparent                9.44ns ± 0%             8.00ns ± 0%  -15.26%          (p=0.008 n=5+5)
    BM_StringAssignStr_Large_Opaque                     25.2ns ± 0%             24.3ns ± 0%   -3.50%          (p=0.008 n=5+5)
    BM_StringAssignStr_Large_Transparent                23.6ns ± 0%             22.5ns ± 0%   -4.76%          (p=0.008 n=5+5)
    BM_StringAssignStr_Huge_Opaque                       319ns ± 5%              317ns ± 5%     ~             (p=0.690 n=5+5)
    BM_StringAssignStr_Huge_Transparent                  319ns ± 5%              317ns ± 5%     ~             (p=0.421 n=5+5)
    BM_StringAssignAsciiz_Empty_Opaque                  7.41ns ± 0%             7.77ns ± 0%   +4.89%          (p=0.008 n=5+5)
    BM_StringAssignAsciiz_Empty_Transparent             7.54ns ± 3%             7.30ns ± 0%   -3.24%          (p=0.008 n=5+5)
    BM_StringAssignAsciiz_Small_Opaque                  9.87ns ± 0%            10.24ns ± 1%   +3.76%          (p=0.008 n=5+5)
    BM_StringAssignAsciiz_Small_Transparent             10.4ns ± 1%              9.8ns ± 2%   -5.78%          (p=0.008 n=5+5)
    BM_StringAssignAsciiz_Large_Opaque                  30.1ns ± 0%             30.1ns ± 0%     ~             (p=0.167 n=5+5)
    BM_StringAssignAsciiz_Large_Transparent             27.1ns ± 0%             27.4ns ± 0%   +0.92%          (p=0.016 n=4+5)
    BM_StringAssignAsciiz_Huge_Opaque                    383ns ± 4%              382ns ± 4%     ~             (p=0.548 n=5+5)
    BM_StringAssignAsciiz_Huge_Transparent               375ns ± 0%              380ns ± 0%   +1.37%          (p=0.029 n=4+4)
    BM_StringAssignAsciizMix_Opaque                     14.0ns ± 0%             14.0ns ± 0%     ~             (p=0.881 n=5+5)
    BM_StringAssignAsciizMix_Transparent                13.7ns ± 1%             13.8ns ± 0%     ~             (p=0.056 n=5+5)
    ``` — ericwf / ViewSVN
  4. [c++20] P1152R4: warn on any simple-assignment to a volatile lvalue
    whose value is not ignored.

    We don't warn on all the cases that are deprecated: specifically, we
    choose to not warn for now if there are parentheses around the
    assignment but its value is not actually used. This seems like a more
    defensible rule, particularly for cases like sizeof(v = a), where the
    parens are part of the operand rather than the sizeof syntax. — rsmith / ViewSVN
  5. [c++20] Implement most of P1152R4.

    Diagnose some now-deprecated uses of volatile types:
    * as function parameter types and return types
    * as the type of a structured binding declaration
    * as the type of the lvalue operand of an increment / decrement /
       compound assignment operator

    This does not implement a check for the deprecation of simple
    assignments whose results are used; that check requires somewhat
    more complexity and will be addressed separately. — rsmith / ViewSVN
  6. [cxx_status] Note that Clang has supported std::source_location since
    version 9. — rsmith / ViewSVN
  7. Factor out some duplication. NFC. — rsmith / ViewSVN
  8. gn build: unbreak libcxx build after r374116 by restoring gen_link_script.py for gn — nico / ViewSVN
  9. [Docs] Fixes broken sphinx build - undefined label

    Removes label ref pointing to non-existent subsystem docs page. — dr87 / ViewSVN
  10. [clang-scan-deps] Improve string/character literal skipping

    The existing string/character literal skipping code in the
    dependency directives source minimizer has two issues:

    - It doesn't stop the scanning when a newline is reached before the terminating character,
    unlike the lexer which considers the token to be done (even if it's invalid) at the end of the line.

    - It doesn't support whitespace between '\' and the newline when looking if the '\' is used as a line continuation character.

    This commit fixes both issues.

    Differential Revision: https://reviews.llvm.org/D68436 — arphaman / ViewSVN
  11. [IRGen] Emit lifetime markers for temporary struct allocas

    When passing arguments using temporary allocas, we need to add the
    appropriate lifetime markers so that the stack coloring passes can
    re-use the stack space.

    This patch keeps track of all the lifetime.start calls emited before the
    codegened call, and adds the corresponding lifetime.end calls after the
    call.

    Differential Revision: https://reviews.llvm.org/D68611 — thegameg / ViewSVN
  12. [sanitizer] Fix crypt.cpp on Android again — Vitaly Buka / ViewSVN
  13. [IA] Add tests for a few other edge cases

    Test with the last eight bits within the range [7F, FF] and with
    lower-case hex letters. — void / ViewSVN
  14. [dsymutil] Improve verbose output (NFC)

    The verbose output for finding relocations assumed that we'd always dump
    the DIE after (which starts with a newline) and therefore didn't include
    one itself. However, this isn't always true, leading to garbled output.

    This patch adds a newline to the verbose output and adds a line that
    says that the DIE is being kept (which isn't obvious otherwise). It also
    adds a 0x prefix to the relocations. — Jonas Devlieghere / ViewSVN
  15. DebugInfo: Move LLE enum handling to .def to match RLE handling — dblaikie / ViewSVN
  16. [libc++] Workaround old versions of CMake that don't understand list(JOIN) — Louis Dionne / ViewSVN
  17. Fix crash or wrong code bug if a lifetime-extended temporary contains a
    "non-constant" value.

    If the constant evaluator evaluates part of a variable initializer,
    including the initializer for some lifetime-extended temporary, but
    fails to fully evaluate the initializer, it can leave behind wrong
    values for temporaries encountered in that initialization. Don't try to
    emit those from CodeGen! Instead, look at the values that constant
    evaluation produced if (and only if) it actually succeeds and we're
    emitting the lifetime-extending declaration's initializer as a constant. — rsmith / ViewSVN
  18. [libc++] Move the linker script generation step to CMake

    Summary:
    This allows the linker script generation to query CMake properties
    (specifically the dependencies of libc++.so) instead of having to
    carry these dependencies around manually in global variables. Notice
    the removal of the LIBCXX_INTERFACE_LIBRARIES global variable.

    Reviewers: phosek, EricWF

    Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D68343 — Louis Dionne / ViewSVN
  19. [sanitizer] Fix crypt.cpp test on Darwin — Vitaly Buka / ViewSVN
  20. [clang] enable_trivial_var_init_zero should not be Joined<>

    Reviewers: rnk

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68610 — Vitaly Buka / ViewSVN
  21. [CVP} Replace SExt with ZExt if the input is known-non-negative

    Summary:
    zero-extension is far more friendly for further analysis.
    While this doesn't directly help with the shift-by-signext problem, this is not unrelated.

    This has the following effect on test-suite (numbers collected after the finish of middle-end module pass manager):
    | Statistic                            |     old |     new | delta | percent change |
    | correlated-value-propagation.NumSExt |       0 |    6026 |  6026 |   +100.00%     |
    | instcount.NumAddInst                 |  272860 |  271283 | -1577 |     -0.58%     |
    | instcount.NumAllocaInst              |   27227 |   27226 | -1    |      0.00%     |
    | instcount.NumAndInst                 |   63502 |   63320 | -182  |     -0.29%     |
    | instcount.NumAShrInst                |   13498 |   13407 | -91   |     -0.67%     |
    | instcount.NumAtomicCmpXchgInst       |    1159 |    1159 |  0    |      0.00%     |
    | instcount.NumAtomicRMWInst           |    5036 |    5036 |  0    |      0.00%     |
    | instcount.NumBitCastInst             |  672482 |  672353 | -129  |     -0.02%     |
    | instcount.NumBrInst                  |  702768 |  702195 | -573  |     -0.08%     |
    | instcount.NumCallInst                |  518285 |  518205 | -80   |     -0.02%     |
    | instcount.NumExtractElementInst      |   18481 |   18482 |  1    |      0.01%     |
    | instcount.NumExtractValueInst        |   18290 |   18288 | -2    |     -0.01%     |
    | instcount.NumFAddInst                |  139035 |  138963 | -72   |     -0.05%     |
    | instcount.NumFCmpInst                |   10358 |   10348 | -10   |     -0.10%     |
    | instcount.NumFDivInst                |   30310 |   30302 | -8    |     -0.03%     |
    | instcount.NumFenceInst               |     387 |     387 |  0    |      0.00%     |
    | instcount.NumFMulInst                |   93873 |   93806 | -67   |     -0.07%     |
    | instcount.NumFPExtInst               |    7148 |    7144 | -4    |     -0.06%     |
    | instcount.NumFPToSIInst              |    2823 |    2838 |  15   |      0.53%     |
    | instcount.NumFPToUIInst              |    1251 |    1251 |  0    |      0.00%     |
    | instcount.NumFPTruncInst             |    2195 |    2191 | -4    |     -0.18%     |
    | instcount.NumFSubInst                |   92109 |   92103 | -6    |     -0.01%     |
    | instcount.NumGetElementPtrInst       | 1221423 | 1219157 | -2266 |     -0.19%     |
    | instcount.NumICmpInst                |  479140 |  478929 | -211  |     -0.04%     |
    | instcount.NumIndirectBrInst          |       2 |       2 |  0    |      0.00%     |
    | instcount.NumInsertElementInst       |   66089 |   66094 |  5    |      0.01%     |
    | instcount.NumInsertValueInst         |    2032 |    2030 | -2    |     -0.10%     |
    | instcount.NumIntToPtrInst            |   19641 |   19641 |  0    |      0.00%     |
    | instcount.NumInvokeInst              |   21789 |   21788 | -1    |      0.00%     |
    | instcount.NumLandingPadInst          |   12051 |   12051 |  0    |      0.00%     |
    | instcount.NumLoadInst                |  880079 |  878673 | -1406 |     -0.16%     |
    | instcount.NumLShrInst                |   25919 |   25921 |  2    |      0.01%     |
    | instcount.NumMulInst                 |   42416 |   42417 |  1    |      0.00%     |
    | instcount.NumOrInst                  |  100826 |  100576 | -250  |     -0.25%     |
    | instcount.NumPHIInst                 |  315118 |  314092 | -1026 |     -0.33%     |
    | instcount.NumPtrToIntInst            |   15933 |   15939 |  6    |      0.04%     |
    | instcount.NumResumeInst              |    2156 |    2156 |  0    |      0.00%     |
    | instcount.NumRetInst                 |   84485 |   84484 | -1    |      0.00%     |
    | instcount.NumSDivInst                |    8599 |    8597 | -2    |     -0.02%     |
    | instcount.NumSelectInst              |   45577 |   45913 |  336  |      0.74%     |
    | instcount.NumSExtInst                |   84026 |   78278 | -5748 |     -6.84%     |
    | instcount.NumShlInst                 |   39796 |   39726 | -70   |     -0.18%     |
    | instcount.NumShuffleVectorInst       |  100272 |  100292 |  20   |      0.02%     |
    | instcount.NumSIToFPInst              |   29131 |   29113 | -18   |     -0.06%     |
    | instcount.NumSRemInst                |    1543 |    1543 |  0    |      0.00%     |
    | instcount.NumStoreInst               |  805394 |  804351 | -1043 |     -0.13%     |
    | instcount.NumSubInst                 |   61337 |   61414 |  77   |      0.13%     |
    | instcount.NumSwitchInst              |    8527 |    8524 | -3    |     -0.04%     |
    | instcount.NumTruncInst               |   60523 |   60484 | -39   |     -0.06%     |
    | instcount.NumUDivInst                |    2381 |    2381 |  0    |      0.00%     |
    | instcount.NumUIToFPInst              |    5549 |    5549 |  0    |      0.00%     |
    | instcount.NumUnreachableInst         |    9855 |    9855 |  0    |      0.00%     |
    | instcount.NumURemInst                |    1305 |    1305 |  0    |      0.00%     |
    | instcount.NumXorInst                 |   10230 |   10081 | -149  |     -1.46%     |
    | instcount.NumZExtInst                |   60353 |   66840 |  6487 |     10.75%     |
    | instcount.TotalBlocks                |  829582 |  829004 | -578  |     -0.07%     |
    | instcount.TotalFuncs                 |   83818 |   83817 | -1    |      0.00%     |
    | instcount.TotalInsts                 | 7316574 | 7308483 | -8091 |     -0.11%     |

    TLDR: we produce -0.11% less instructions, -6.84% less `sext`, +10.75% more `zext`.
    To be noted, clearly, not all new `zext`'s are produced by this fold.

    (And now i guess it might have been interesting to measure this for D68103 :S)

    Reviewers: nikic, spatel, reames, dberlin

    Reviewed By: nikic

    Subscribers: hiraditya, jfb, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68654 — lebedevri / ViewSVN
  22. [CVP][NFC] Revisit sext vs. zext test — lebedevri / ViewSVN
  23. [clang] Add llvm-ifs in test deps — Vitaly Buka / ViewSVN
  24. Fix `compiler_rt_logbf_test.c` test failure for Builtins-i386-darwin test suite.

    Summary:
    It seems that compiler-rt's implementation and Darwin
    libm's implementation of `logbf()` differ when given a NaN
    with raised sign bit. Strangely this behaviour only happens with
    i386 Darwin libm. For x86_64 and x86_64h the existing compiler-rt
    implementation matched Darwin libm.

    To workaround this the `compiler_rt_logbf_test.c` has been modified
    to do a comparison on the `fp_t` type and if that fails check if both
    values are NaN. If both values are NaN they are equivalent and no
    error needs to be raised.

    rdar://problem/55565503

    Reviewers: rupprecht, scanon, compnerd, echristo
    Subscribers: #sanitizers, llvm-commits
    Tags: #llvm, #sanitizers
    Differential Revision: https://reviews.llvm.org/D67999 — delcypher / ViewSVN
  25. [OPENMP50]Multiple vendors in vendor context must be treated as logical
    and of vendors, not or.

    If several vendors are provided in the same vendor context trait, the
    context shall match only if all vendors are matching, not one of them.
    This is per OpenMP 5.0, 2.3.3 Matching and Scoring Context Selectors,
    all selectors in the construct, device, and implementation sets of the
    context selector appear in the corresponding trait set of the OpenMP
    context. — abataev / ViewSVN
  26. Try to get ubsan-blacklist-vfs.c pass more on Windows — nico / ViewSVN
  27. Try to get readability-deleted-default.cpp to pass on Windows.

    In MS compatibility mode, "extern inline void g()" is not a redundant
    declaration for "inline void g()", because of redeclForcesDefMSVC()
    (see PR19264, r205485).

    To fix, run the test with -fms-compatiblity forced on and off
    and explicit check for the differing behavior for extern inline.

    Final bit of PR43593.

    Differential Revision: https://reviews.llvm.org/D68640 — nico / ViewSVN
  28. Mark several PointerIntPair methods as lvalue-only

    No point in mutating 'this' if it's just going to be thrown away.

    https://reviews.llvm.org/D63945 — jrose / ViewSVN
  29. [tblgen] Add getOperatorAsDef() to Record

    Summary:
    While working with DagInit's, it's often the case that you expect the
    operator to be a reference to a def. This patch adds a wrapper for this
    common case to reduce the amount of boilerplate callers need to duplicate
    repeatedly.

    getOperatorAsDef() returns the record if the DagInit has an operator that is
    a DefInit. Otherwise, it prints a fatal error.

    There's only a few pre-existing examples in LLVM at the moment and I've
    left a few instances of the code this simplifies as they had more specific
    error messages than the generic one this produces. I'm going to be using
    this a fair bit in my subsequent patches.

    Reviewers: bogner, volkan, nhaehnle

    Reviewed By: nhaehnle

    Subscribers: nhaehnle, hiraditya, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68424 — dsanders / ViewSVN
  30. [BPF] do compile-once run-everywhere relocation for bitfields

    A bpf specific clang intrinsic is introduced:
       u32 __builtin_preserve_field_info(member_access, info_kind)
    Depending on info_kind, different information will
    be returned to the program. A relocation is also
    recorded for this builtin so that bpf loader can
    patch the instruction on the target host.
    This clang intrinsic is used to get certain information
    to facilitate struct/union member relocations.

    The offset relocation is extended by 4 bytes to
    include relocation kind.
    Currently supported relocation kinds are
    enum {
        FIELD_BYTE_OFFSET = 0,
        FIELD_BYTE_SIZE,
        FIELD_EXISTENCE,
        FIELD_SIGNEDNESS,
        FIELD_LSHIFT_U64,
        FIELD_RSHIFT_U64,
    };
    for __builtin_preserve_field_info. The old
    access offset relocation is covered by
        FIELD_BYTE_OFFSET = 0.

    An example:
    struct s {
        int a;
        int b1:9;
        int b2:4;
    };
    enum {
        FIELD_BYTE_OFFSET = 0,
        FIELD_BYTE_SIZE,
        FIELD_EXISTENCE,
        FIELD_SIGNEDNESS,
        FIELD_LSHIFT_U64,
        FIELD_RSHIFT_U64,
    };

    void bpf_probe_read(void *, unsigned, const void *);
    int field_read(struct s *arg) {
      unsigned long long ull = 0;
      unsigned offset = __builtin_preserve_field_info(arg->b2, FIELD_BYTE_OFFSET);
      unsigned size = __builtin_preserve_field_info(arg->b2, FIELD_BYTE_SIZE);
    #ifdef USE_PROBE_READ
      bpf_probe_read(&ull, size, (const void *)arg + offset);
      unsigned lshift = __builtin_preserve_field_info(arg->b2, FIELD_LSHIFT_U64);
    #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
      lshift = lshift + (size << 3) - 64;
    #endif
    #else
      switch(size) {
      case 1:
        ull = *(unsigned char *)((void *)arg + offset); break;
      case 2:
        ull = *(unsigned short *)((void *)arg + offset); break;
      case 4:
        ull = *(unsigned int *)((void *)arg + offset); break;
      case 8:
        ull = *(unsigned long long *)((void *)arg + offset); break;
      }
      unsigned lshift = __builtin_preserve_field_info(arg->b2, FIELD_LSHIFT_U64);
    #endif
      ull <<= lshift;
      if (__builtin_preserve_field_info(arg->b2, FIELD_SIGNEDNESS))
        return (long long)ull >> __builtin_preserve_field_info(arg->b2, FIELD_RSHIFT_U64);
      return ull >> __builtin_preserve_field_info(arg->b2, FIELD_RSHIFT_U64);
    }

    There is a minor overhead for bpf_probe_read() on big endian.

    The code and relocation generated for field_read where bpf_probe_read() is
    used to access argument data on little endian mode:
            r3 = r1
            r1 = 0
            r1 = 4  <=== relocation (FIELD_BYTE_OFFSET)
            r3 += r1
            r1 = r10
            r1 += -8
            r2 = 4  <=== relocation (FIELD_BYTE_SIZE)
            call bpf_probe_read
            r2 = 51 <=== relocation (FIELD_LSHIFT_U64)
            r1 = *(u64 *)(r10 - 8)
            r1 <<= r2
            r2 = 60 <=== relocation (FIELD_RSHIFT_U64)
            r0 = r1
            r0 >>= r2
            r3 = 1  <=== relocation (FIELD_SIGNEDNESS)
            if r3 == 0 goto LBB0_2
            r1 s>>= r2
            r0 = r1
    LBB0_2:
            exit

    Compare to the above code between relocations FIELD_LSHIFT_U64 and
    FIELD_LSHIFT_U64, the code with big endian mode has four more
    instructions.
            r1 = 41   <=== relocation (FIELD_LSHIFT_U64)
            r6 += r1
            r6 += -64
            r6 <<= 32
            r6 >>= 32
            r1 = *(u64 *)(r10 - 8)
            r1 <<= r6
            r2 = 60   <=== relocation (FIELD_RSHIFT_U64)

    The code and relocation generated when using direct load.
            r2 = 0
            r3 = 4
            r4 = 4
            if r4 s> 3 goto LBB0_3
            if r4 == 1 goto LBB0_5
            if r4 == 2 goto LBB0_6
            goto LBB0_9
    LBB0_6:                                 # %sw.bb1
            r1 += r3
            r2 = *(u16 *)(r1 + 0)
            goto LBB0_9
    LBB0_3:                                 # %entry
            if r4 == 4 goto LBB0_7
            if r4 == 8 goto LBB0_8
            goto LBB0_9
    LBB0_8:                                 # %sw.bb9
            r1 += r3
            r2 = *(u64 *)(r1 + 0)
            goto LBB0_9
    LBB0_5:                                 # %sw.bb
            r1 += r3
            r2 = *(u8 *)(r1 + 0)
            goto LBB0_9
    LBB0_7:                                 # %sw.bb5
            r1 += r3
            r2 = *(u32 *)(r1 + 0)
    LBB0_9:                                 # %sw.epilog
            r1 = 51
            r2 <<= r1
            r1 = 60
            r0 = r2
            r0 >>= r1
            r3 = 1
            if r3 == 0 goto LBB0_11
            r2 s>>= r1
            r0 = r2
    LBB0_11:                                # %sw.epilog
            exit

    Considering verifier is able to do limited constant
    propogation following branches. The following is the
    code actually traversed.
            r2 = 0
            r3 = 4   <=== relocation
            r4 = 4   <=== relocation
            if r4 s> 3 goto LBB0_3
    LBB0_3:                                 # %entry
            if r4 == 4 goto LBB0_7
    LBB0_7:                                 # %sw.bb5
            r1 += r3
            r2 = *(u32 *)(r1 + 0)
    LBB0_9:                                 # %sw.epilog
            r1 = 51   <=== relocation
            r2 <<= r1
            r1 = 60   <=== relocation
            r0 = r2
            r0 >>= r1
            r3 = 1
            if r3 == 0 goto LBB0_11
            r2 s>>= r1
            r0 = r2
    LBB0_11:                                # %sw.epilog
            exit

    For native load case, the load size is calculated to be the
    same as the size of load width LLVM otherwise used to load
    the value which is then used to extract the bitfield value.

    Differential Revision: https://reviews.llvm.org/D67980 — yhs / ViewSVN
  31. [NFC] Attempt to make ubsan-blacklist-vfs test pass on Windows

    Previously disabled in d0c2d5daa3e — Jan Korous / ViewSVN
  32. [driver][hip] Skip bundler if host action is nothing.

    Reviewers: sfantao, tra, yaxunl

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68652 — hliao / ViewSVN
  33. [OPENMP50]Do not allow multiple same context traits in the same context
    selector.

    According to OpenMP 5.0, 2.3.2 Context Selectors, Restrictions, each
    trait-selector-name can only be specified once. Added check for this
    restriction. — abataev / ViewSVN
  34. AMDGPU: Fix i16 arithmetic pattern redundancy

    There were 2 problems here. First, these patterns were duplicated to
    handle the inverted shift operands instead of using the commuted
    PatFrags.

    Second, the point of the zext folding patterns don't apply to the
    non-0ing high subtargets. They should be skipped instead of inserting
    the extension. The zeroing high code would be emitted when necessary
    anyway. This was also emitting unnecessary zexts in cases where the
    high bits were undefined. — arsenm / ViewSVN
  35. Revert "[LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop-vectorize"

    Also Revert "[LoopVectorize] Fix non-debug builds after rL374017"

    This reverts commit 9f41deccc0e648a006c9f38e11919f181b6c7e0a.
    This reverts commit 18b6fe07bcf44294f200bd2b526cb737ed275c04.

    The patch is breaking PowerPC internal build, checked with author, reverting
    on behalf of him for now due to timezone. — jsji / ViewSVN
  36. [SLP] add test with prefer-vector-width function attribute; NFC (PR43578) — spatel / ViewSVN
  37. [CodeExtractor] Factor out and reuse shrinkwrap analysis

    Factor out CodeExtractor's analysis of allocas (for shrinkwrapping
    purposes), and allow the analysis to be reused.

    This resolves a quadratic compile-time bug observed when compiling
    AMDGPUDisassembler.cpp.o.

    Pre-patch (Release + LTO clang):

    ```
       ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
      176.5278 ( 57.8%)   0.4915 ( 18.5%)  177.0192 ( 57.4%)  177.4112 ( 57.3%)  Hot Cold Splitting
    ```

    Post-patch (ReleaseAsserts clang):

    ```
       ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
      1.4051 (  3.3%)   0.0079 (  0.3%)   1.4129 (  3.2%)   1.4129 (  3.2%)  Hot Cold Splitting
    ```

    Testing: check-llvm, and comparing the AMDGPUDisassembler.cpp.o binary
    pre- vs. post-patch.

    An alternate approach is to hide CodeExtractorAnalysisCache from clients
    of CodeExtractor, and to recompute the analysis from scratch inside of
    CodeExtractor::extractCodeRegion(). This eliminates some redundant work
    in the shrinkwrapping legality check. However, some clients continue to
    exhibit O(n^2) compile time behavior as computing the analysis is O(n).

    rdar://55912966

    Differential Revision: https://reviews.llvm.org/D68616 — Vedant Kumar / ViewSVN
  38. [sanitizer] Disable crypt*.cpp tests on Android — Vitaly Buka / ViewSVN
  39. AMDGPU: Add offsets to MMO when lowering buffer intrinsics

    Summary:
    Without offsets on the MachineMemOperands (MMOs),
    MachineInstr::mayAlias() will return true for all reads and writes to the
    same resource descriptor.  This leads to O(N^2) complexity in the MachineScheduler
    when analyzing dependencies of buffer loads and stores.  It also limits
    the SILoadStoreOptimizer from merging more instructions.

    This patch reduces the compile time of one pathological compute shader
    from 12 seconds to 1 second.

    Reviewers: arsenm, nhaehnle

    Reviewed By: arsenm

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D65097 — tstellar / ViewSVN
  40. [Attributor][Fix] Temporary fix for windows build bot failure

    D65402 causes test failure related to attributor-max-iterations.
    This commit removes attributor-max-iterations-verify for now.
    I'll examine the factor and the flag should be reverted. — uenoku / ViewSVN
  41. CodeGenPrepare - silence static analyzer dyn_cast<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use cast<> directly and if not assert will fire for us. — rksimon / ViewSVN
  42. [AMDGPU] Disable unused gfx10 dpp instructions

    Inhibit generation of unused real dpp instructions on gfx10 just
    like it is done on other subtargets. This does not change anything
    because these are illegal anyway and not accepted, but it does
    reduce the number of instruction definitions generated.

    Differential Revision: https://reviews.llvm.org/D68607 — rampitec / ViewSVN
  43. [libc++] Make sure we link all system libraries into the benchmarks

    It turns out that r374056 broke _some_ build bots again, specifically
    the ones using sanitizers. Instead of trying to link the right system
    libraries to the benchmarks bit-by-bit, let's just link exactly the
    system libraries that libc++ itself needs. — Louis Dionne / ViewSVN
  44. [UpdateCCTestChecks] Detect function mangled name on separate line

    Sometimes functions with large comment blocks in front of them have their
    declarations output on several lines by c-index-test.  Hence the one-line
    function name/line/mangled pattern will not work to detect them.  Break the
    pattern up into two patterns and keep state after seeing the name/line
    information until we finally see the mangled name.

    Differential Revision: https://reviews.llvm.org/D68272 — greened / ViewSVN
  45. [NFC][CVP] Add tests where we can replace sext with zext

    If the sign bit of the value that is being sign-extended is not set,
    i.e. the value is non-negative (s>= 0), then zero-extension will suffice,
    and is better for analysis: https://rise4fun.com/Alive/a8PD — lebedevri / ViewSVN
  46. (Re)generate various tests. NFC — deadalnix / ViewSVN
  47. [WebAssembly] Fix a bug in 'try' placement

    Summary:
    When searching for local expression tree created by stackified
    registers, for 'block' placement, we start the search from the previous
    instruction of a BB's terminator. But in 'try''s case, we should start
    from the previous instruction of a call that can throw, or a EH_LABEL
    that precedes the call, because the return values of the call's previous
    instructions can be stackified and consumed by the throwing call.

    For example,
    ```
      i32.call @foo
      call @bar         ; may throw
      br $label0
    ```
    In this case, if we start the search from the previous instruction of
    the terminator (`br` here), we end up stopping at `call @bar` and place
    a 'try' between `i32.call @foo` and `call @bar`, because `call @bar`
    does not have a return value so it is not a local expression tree of
    `br`.

    But in this case, unlike when placing 'block's, we should start the
    search from `call @bar`, because the return value of `i32.call @foo` is
    stackified and used by `call @bar`.

    Reviewers: dschuff

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68619 — aheejin / ViewSVN
  48. [OPENMP50]Prohibit multiple context selector sets in context selectors.

    According to OpenMP 5.0, 2.3.2 Context Selectors, Restrictions, each
    trait-set-selector-name can only be specified once. Added check to
    implement this restriction. — abataev / ViewSVN
  49. [builtins] Unbreak build on FreeBSD armv7 after D60351

    headers include reordering.

    Reviewers: phosek, echristo

    Reviewed-By: phosek

    Differential Revsion: https://reviews.llvm.org/D68045 — David CARLIER / ViewSVN
  50. [DebugInfo][If-Converter] Update call site info during the optimization

    During the If-Converter optimization pay attention when copying or
    deleting call instructions in order to keep call site information in
    valid state.

    Reviewers: aprantl, vsk, efriedma

    Reviewed By: vsk, efriedma

    Differential Revision: https://reviews.llvm.org/D66955 — nikolaprica / ViewSVN
  51. gn build: Merge r374062 — gnsyncbot / ViewSVN
  52. gn build: Merge r374061 — gnsyncbot / ViewSVN
  53. [Attributor][MustExec] Deduce dereferenceable and nonnull attribute using MustBeExecutedContextExplorer

    Summary:
    In D65186 and related patches, MustBeExecutedContextExplorer is introduced. This enables us to traverse instructions guaranteed to execute from function entry. If we can know the argument is used as `dereferenceable` or `nonnull` in these instructions, we can mark `dereferenceable` or `nonnull` in the argument definition:

    1. Memory instruction (similar to D64258)
    Trace memory instruction pointer operand. Currently, only inbounds GEPs are traced.
    ```
    define i64* @f(i64* %a) {
    entry:
      %add.ptr = getelementptr inbounds i64, i64* %a, i64 1
    ; (because of inbounds GEP we can know that %a is at least dereferenceable(16))
      store i64 1, i64* %add.ptr, align 8
      ret i64* %add.ptr ; dereferenceable 8 (because above instruction stores into it)
    }
    ```

    2. Propagation from callsite (similar to D27855)
    If `deref` or `nonnull` are known in call site parameter attributes we can also say that argument also that attribute.

    ```
    declare void @use3(i8* %x, i8* %y, i8* %z);
    declare void @use3nonnull(i8* nonnull %x, i8* nonnull %y, i8* nonnull %z);

    define void @parent1(i8* %a, i8* %b, i8* %c) {
      call void @use3nonnull(i8* %b, i8* %c, i8* %a)
    ; Above instruction is always executed so we can say that@parent1(i8* nonnnull %a, i8* nonnull %b, i8* nonnull %c)
      call void @use3(i8* %c, i8* %a, i8* %b)
      ret void
    }
    ```

    Reviewers: jdoerfert, sstefan1, spatel, reames

    Reviewed By: jdoerfert

    Subscribers: xbolva00, hiraditya, jfb, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D65402 — uenoku / ViewSVN
  54. Revert [TextAPI] Introduce TBDv4

    This reverts r374058 (git commit 5d566c5a46aeaa1fa0e5c0b823c9d5f84036dc9a) — cishida / ViewSVN
  55. [clang][ifs] Clang Interface Stubs ToolChain plumbing.

    Second Landing Attempt:

    This patch enables end to end support for generating ELF interface stubs
    directly from clang. Now the following:

    clang -emit-interface-stubs -o libfoo.so a.cpp b.cpp c.cpp

    will product an ELF binary with visible symbols populated. Visibility attributes
    and -fvisibility can be used to control what gets populated.

    * Adding ToolChain support for clang Driver IFS Merge Phase
    * Implementing a default InterfaceStubs Merge clang Tool, used by ToolChain
    * Adds support for the clang Driver to involve llvm-ifs on ifs files.
    * Adds -emit-merged-ifs flag, to tell llvm-ifs to emit a merged ifs text file
      instead of the final object format (normally ELF)


    Differential Revision: https://reviews.llvm.org/D63978 — zer0 / ViewSVN
  56. [Attributor] Add helper class to compose two structured deduction.

    Summary: This patch introduces a generic way to compose two structured deductions.  This will be used for composing generic deduction with `MustBeExecutedExplorer` and other existing generic deduction.

    Reviewers: jdoerfert, sstefan1

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D66645 — uenoku / ViewSVN
  57. gn build: Merge r374058 — gnsyncbot / ViewSVN
  58. [TextAPI] Introduce TBDv4

    Summary:
    This format introduces new features and platforms
    The motivation for this format is to support more than 1 platform since previous versions only supported additional architectures and 1 platform,
    for example ios + ios-simulator and macCatalyst.

    Reviewers: ributzka, steven_wu

    Reviewed By: ributzka

    Subscribers: mgorny, hiraditya, mgrang, dexonsmith, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67529 — cishida / ViewSVN
  59. [OPENMP50]Allow functions in declare variant directive to have different
    C linkage.

    After some discussion with OpenMP developers, it was decided that the
    functions with the different C linkage can be used in declare variant
    directive. — abataev / ViewSVN
  60. [libc++] TAKE 2: Make system libraries PRIVATE dependencies of libc++

    We tried doing that previously (in r373487) and failed (reverted in
    r373506) because the benchmarks needed to link against system libraries
    and relied on libc++'s dependencies being propagated. Now that this has
    been fixed (in r374053), this commit marks the system libraries as
    PRIVATE dependencies of libc++. — Louis Dionne / ViewSVN
  61. [Mips] Emit proper ABI for _mcount calls

    When -pg option is present than a call to _mcount is inserted into every
    function. However since the proper ABI was not followed then the generated
    gmon.out did not give proper results. By inserting needed instructions
    before every _mcount we can fix this.

    Differential Revision: https://reviews.llvm.org/D68390 — mbrkusanin / ViewSVN
  62. [llvm-exegesis] Add options to SnippetGenerator.

    Summary:
    This adds a `-max-configs-per-opcode` option to limit the number of
    configs per opcode.

    Reviewers: gchatelet

    Subscribers: tschuett, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68642 — courbet / ViewSVN
  63. [libc++] Add missing link-time dependencies to the benchmarks

    Since the benchmarks build with -nostdlib, they need to manually link
    against some system libraries that are used by the benchmarks and the
    GoogleBenchmark library itself.

    Previously, we'd rely on the fact that these libraries were linked
    through the PUBLIC dependencies of cxx_shared/cxx_static. However,
    if we were to make these dependencies PRIVATE (as they should be
    because they are implementation details of libc++), the benchmarks
    would fail to link. This commit remediates that. — Louis Dionne / ViewSVN
  64. Object/minidump: Add support for the MemoryInfoList stream

    Summary:
    This patch adds the definitions of the constants and structures
    necessary to interpret the MemoryInfoList minidump stream, as well as
    the object::MinidumpFile interface to access the stream.

    While the code is fairly simple, there is one important deviation from
    the other minidump streams, which is worth calling out explicitly.
    Unlike other "List" streams, the size of the records inside
    MemoryInfoList stream is not known statically. Instead it is described
    in the stream header. This makes it impossible to return
    ArrayRef<MemoryInfo> from the accessor method, as it is done with other
    streams. Instead, I create an iterator class, which can be parameterized
    by the runtime size of the structure, and return
    iterator_range<iterator> instead.

    Reviewers: amccarth, jhenderson, clayborg

    Subscribers: JosephTremoulet, zturner, markmentovai, lldb-commits, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68210 — labath / ViewSVN
  65. [libc++] Use PRIVATE to link benchmark dependencies

    It's better style to use PRIVATE when linking libraries to executables,
    and it doesn't make a difference since executables don't need to propagate
    their link-time dependencies anyway. — Louis Dionne / ViewSVN
  66. Nope, I'm wrong. It looks like someone else removed these on purpose and
    it just happened to break the bot right when I did my push. So I'm undoing
    this mornings incorrect push. I've also kicked off an email to hopefully
    get the bot fixed the correct way. — kpn / ViewSVN
  67. [clangd] Disable expand auto on decltype(auto)

    Summary: Applying it produces incorrect code at the moment.

    Reviewers: sammccall

    Reviewed By: sammccall

    Subscribers: kuhnel, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68630 — ibiryukov / ViewSVN
  68. [clangd] Bump timeouts in speculative completion tests — kadircet / ViewSVN
  69. Restore documentation that 'svn update' unexpectedly yanked out from under me. — kpn / ViewSVN
  70. fix fmls fp16

    Tim Northover remarked that the added patterns for fmls fp16
    produce wrong code in case the fsub instruction has a
    multiplication as its first operand, i.e., all the patterns FMLSv*_OP1:

    > define <8 x half> @test_FMLSv8f16_OP1(<8 x half> %a, <8 x half> %b, <8 x half> %c) {
    > ; CHECK-LABEL: test_FMLSv8f16_OP1:
    > ; CHECK: fmls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
    > entry:
    >
    >   %mul = fmul fast <8 x half> %c, %b
    >   %sub = fsub fast <8 x half> %mul, %a
    >   ret <8 x half> %sub
    > }
    >
    > This doesn't look right to me. The exact instruction produced is "fmls
    > v0.8h, v2.8h, v1.8h", which I think calculates "v0 - v2*v1", but the
    > IR is calculating "v2*v1-v0". The equivalent <4 x float> code also
    > doesn't emit an fmls.

    This patch generates an fmla and negates the value of the operand2 of the fsub.

    Inspecting the pattern match, I found that there was another mistake in the
    opcode to be selected: matching FMULv4*16 should generate FMLSv4*16
    and not FMLSv2*32.

    Tested on aarch64-linux with make check-all.

    Differential Revision: https://reviews.llvm.org/D67990 — spop / ViewSVN
  71. Add test for rotating truncated vectors. NFC — deadalnix / ViewSVN
  72. [SVE][IR] Scalable Vector size queries and IR instruction support

    * Adds a TypeSize struct to represent the known minimum size of a type
      along with a flag to indicate that the runtime size is a integer multiple
      of that size
    * Converts existing size query functions from Type.h and DataLayout.h to
      return a TypeSize result
    * Adds convenience methods (including a transparent conversion operator
      to uint64_t) so that most existing code 'just works' as if the return
      values were still scalars.
    * Uses the new size queries along with ElementCount to ensure that all
      supported instructions used with scalable vectors can be constructed
      in IR.

    Reviewers: hfinkel, lattner, rkruppe, greened, rovka, rengolin, sdesmalen

    Reviewed By: rovka, sdesmalen

    Differential Revision: https://reviews.llvm.org/D53137 — huntergr / ViewSVN
  73. AMDGPU: Propagate undef flag during pre-RA exec mask optimizations

    Summary: Issue: https://github.com/GPUOpen-Drivers/llpc/issues/204

    Reviewers: arsenm, rampitec

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68184 — nha / ViewSVN
  74. MachineSSAUpdater: insert IMPLICIT_DEF at top of basic block

    Summary:
    When getValueInMiddleOfBlock happens to be called for a basic block
    that has no incoming value at all, an IMPLICIT_DEF is inserted in that
    block via GetValueAtEndOfBlockInternal. This IMPLICIT_DEF must be at
    the top of its basic block or it will likely not reach the use that
    the caller intends to insert.

    Issue: https://github.com/GPUOpen-Drivers/llpc/issues/204

    Reviewers: arsenm, rampitec

    Subscribers: jvesely, wdng, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68183 — nha / ViewSVN
  75. [SLP] add test with prefer-vector-width function attribute; NFC — spatel / ViewSVN
  76. [LoopRotate] Unconditionally get DomTree.

    LoopRotate is a loop pass and the DomTree should always be available.

    Similar to a70c5261436322a53187d67b8bdc0445d0463a9a — fhahn / ViewSVN
  77. [Diagnostics] Silence -Wsizeof-array-div for character buffers

    Summary:
    Character buffers are sometimes used to represent a pool of memory that
    contains non-character objects, due to them being synonymous with a stream of
    bytes on almost all modern architectures. Often, when interacting with hardware
    devices, byte buffers are therefore used as an intermediary and so we can end
    Character buffers are sometimes used to represent a pool of memory that
    contains non-character objects, due to them being synonymous with a stream of
    bytes on almost all modern architectures. Often, when interacting with hardware
    devices, byte buffers are therefore used as an intermediary and so we can end
    up generating lots of false-positives.

    Moreover, due to the ability of character pointers to alias non-character
    pointers, the strict aliasing violations that would generally be implied by the
    calculations caught by the warning (if the calculation itself is in fact
    correct) do not apply here, and so although the length calculation may be
    wrong, that is the only possible issue.

    Reviewers: rsmith, xbolva00, thakis

    Reviewed By: xbolva00, thakis

    Subscribers: thakis, lebedev.ri, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68526 — jrtc27 / ViewSVN
  78. [MCA][LSUnit] Track loads and stores until retirement.

    Before this patch, loads and stores were only tracked by their corresponding
    queues in the LSUnit from dispatch until execute stage. In practice we should be
    more conservative and assume that memory opcodes leave their queues at
    retirement stage.

    Basically, loads should leave the load queue only when they have completed and
    delivered their data. We conservatively assume that a load is completed when it
    is retired. Stores should be tracked by the store queue from dispatch until
    retirement. In practice, stores can only leave the store queue if their data can
    be written to the data cache.

    This is mostly a mechanical change. With this patch, the retire stage notifies
    the LSUnit when a memory instruction is retired. That would triggers the release
    of LDQ/STQ entries.  The only visible change is in memory tests for the bdver2
    model. That is because bdver2 is the only model that defines the load/store
    queue size.

    This patch partially addresses PR39830.

    Differential Revision: https://reviews.llvm.org/D68266 — adibiagio / ViewSVN
  79. [ISEL][ARM][AARCH64] Tracking simple parameter forwarding registers

    Support for tracking registers that forward function parameters into the
    following function frame. For now we only support cases when parameter
    is forwarded through single register.

    Reviewers: aprantl, vsk, t.p.northover

    Reviewed By: vsk

    Differential Revision: https://reviews.llvm.org/D66953 — nikolaprica / ViewSVN
  80. Remove an useless allocation (from by clang-analyzer/scan-build)
    https://llvm.org/reports/scan-build/report-TargetInfo.cpp-detectFPCCEligibleStruct-9-1.html#EndPath — sylvestre / ViewSVN
  81. [llvm-exegesis] Finish plumbing the `Config` field.

    Summary:
    Right now there are no snippet generators that emit the `Config` Field,
    but I plan to add it to investigate LEA operands for PR32326.

    What was broken was:
    - `Config` Was not propagated up until the BenchmarkResult::Key.
    - Clustering should really consider different configs as measuring
    different things, so we should stabilize on (Opcode, Config) instead of
    just Opcode.

    Reviewers: gchatelet

    Subscribers: tschuett, llvm-commits, lebedev.ri

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68629 — courbet / ViewSVN
  82. [llvm-readobj/llvm-readelf] - Add checks for GNU-style to "all.test" test case.

    We do not check the GNU-style output when -all is given.
    This patch does that.

    Differential revision: https://reviews.llvm.org/D68462 — grimar / ViewSVN
  83. [NFC] Add REQUIRES for r374017 in testcase — wuzish / ViewSVN
  84. [LoopRotate] Unconditionally get ScalarEvolution.

    Summary: LoopRotate is a loop pass and SE should always be available.

    Reviewers: anemet, asbirlea

    Reviewed By: asbirlea

    Differential Revision: https://reviews.llvm.org/D68573 — fhahn / ViewSVN
  85. [ARM] Generate vcmp instead of vcmpe

    Based on the discussion in
    http://lists.llvm.org/pipermail/llvm-dev/2019-October/135574.html, the
    conclusion was reached that the ARM backend should produce vcmp instead
    of vcmpe instructions by default, i.e. not be producing an Invalid
    Operation exception when either arguments in a floating point compare
    are quiet NaNs.

    In the future, after constrained floating point intrinsics for floating
    point compare have been introduced, vcmpe instructions probably should
    be produced for those intrinsics - depending on the exact semantics
    they'll be defined to have.

    This patch logically consists of the following parts:
    - Revert http://llvm.org/viewvc/llvm-project?rev=294945&view=rev and
      http://llvm.org/viewvc/llvm-project?rev=294968&view=rev, which
      implemented fine-tuning for when to produce vcmpe (i.e. not do it for
      equality comparisons). The complexity introduced by those patches
      isn't needed anymore if we just always produce vcmp instead. Maybe
      these patches need to be reintroduced again once support is needed to
      map potential LLVM-IR constrained floating point compare intrinsics to
      the ARM instruction set.
    - Simply select vcmp, instead of vcmpe, see simple changes in
      lib/Target/ARM/ARMInstrVFP.td
    - Adapt lots of tests that tested for vcmpe (instead of vcmp). For all
      of these test, the intent of what is tested for isn't related to
      whether the vcmp should produce an Invalid Operation exception or not.

    Fixes PR43374.

    Differential Revision: https://reviews.llvm.org/D68463 — kbeyls / ViewSVN
  86. [Tools] Mark output of tools as text if it is text

    Several LLVM tools write text files/streams without using OF_Text.
    This can cause problems on platforms which distinguish between
    text and binary output. This PR adds the OF_Text flag for the
    following tools:

    - llvm-dis
    - llvm-dwarfdump
    - llvm-mca
    - llvm-mc (assembler files only)
    - opt (assembler files only)
    - RemarkStreamer (used e.g. by opt)

    Reviewers: rnk, vivekvpandya, Bigcheese, andreadb

    Differential Revision: https://reviews.llvm.org/D67696 — redstar / ViewSVN
  87. [LoopVectorize] Fix non-debug builds after rL374017 — kadircet / ViewSVN
  88. [llvm-exegesis] Add stabilization test with config

    In preparation for D68629. — courbet / ViewSVN

#5507 (Oct 8, 2019 12:06:15 AM)

  1. [IA] Recognize hexadecimal escape sequences

    Summary:
    Implement support for hexadecimal escape sequences to match how GNU 'as'
    handles them. I.e., read all hexadecimal characters and truncate to the
    lower 16 bits.

    Reviewers: nickdesaulniers, jcai19

    Subscribers: llvm-commits, hiraditya

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68598 — void / ViewSVN
  2. [LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop-vectorize

    In loop-vectorize, interleave count and vector factor depend on target register number. Currently, it does not
    estimate different register pressure for different register class separately(especially for scalar type,
    float type should not be on the same position with int type), so it's not accurate. Specifically,
    it causes too many times interleaving/unrolling, result in too many register spills in loop body and hurting performance.

    So we need classify the register classes in IR level, and importantly these are abstract register classes,
    and are not the target register class of backend provided in td file. It's used to establish the mapping between
    the types of IR values and the number of simultaneous live ranges to which we'd like to limit for some set of those types.

    For example, POWER target, register num is special when VSX is enabled. When VSX is enabled, the number of int scalar register is 32(GPR),
    float is 64(VSR), but for int and float vector register both are 64(VSR). So there should be 2 kinds of register class when vsx is enabled,
    and 3 kinds of register class when VSX is NOT enabled.

    It runs on POWER target, it makes big(+~30%) performance improvement in one specific bmk(503.bwaves_r) of spec2017 and no other obvious degressions.

    Differential revision: https://reviews.llvm.org/D67148 — wuzish / ViewSVN
  3. [ConstantRange] [NFC] replace addWithNoSignedWrap with addWithNoWrap. — shchenz / ViewSVN
  4. [WebAssembly] Add REQUIRES: asserts to cfg-stackify-eh.ll

    This was missing in D68552. — aheejin / ViewSVN
  5. [ItaniumMangle] Fix mangling of GNU __null in an expression to match GCC

    Reviewers: rsmith

    Reviewed By: rsmith

    Subscribers: erik.pilkington, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68368 — jrtc27 / ViewSVN
  6. [NFC] Fix ubsan-blacklist test

    Restored original test and marked tests for VFS as unsupported on Windows. — Jan Korous / ViewSVN
  7. [sanitizer] Fix signal_trap_handler.cpp on android — Vitaly Buka / ViewSVN
  8. [LitConfig] Silenced notes/warnings on quiet.

    Lit has a "quiet" option, -q, which is documented to "suppress no
    error output". Previously, LitConfig displayed notes and warnings when
    the quiet option was specified. The result was that it was not
    possible to get only pertinent file/line information to be used by an
    editor to jump to the location where checks were failing without
    passing a number of unhelpful locations first. Here, the
    implementations of LitConfig.note and LitConfig.warning are modified
    to account for the quiet flag and avoid displaying if the flag has
    indeed been set.

    Patch by Nate Chandler

    Reviewed by yln

    Differential Revision: https://reviews.llvm.org/D68044 — atrick / ViewSVN
  9. Reland 'Add VFS support for sanitizers' blacklist'

    The original patch broke the test for Windows.
    Trying to fix as per Reid's suggestions outlined here:
    https://reviews.llvm.org/rC371663

    Differential Revision: https://reviews.llvm.org/D67742 — Jan Korous / ViewSVN
  10. Revert "Add VFS support for sanitizers' blacklist"

    Fix tests on Windows for now.

    This reverts commit 96ac97a4213287003f08636d0c372b3f71e9cfca. — Jan Korous / ViewSVN
  11. [msan] Add interceptors: crypt, crypt_r.

    Reviewers: vitalybuka

    Subscribers: srhines, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68431 — eugenis / ViewSVN
  12. [clang] Accept -ftrivial-auto-var-init in clang-cl

    Reviewers: eugenis, rnk

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68608 — Vitaly Buka / ViewSVN
  13. AMDGPU/GlobalISel: Clamp G_SITOFP/G_UITOFP sources — arsenm / ViewSVN
  14. [Attributor][NFC] Add debug output — jdoerfert / ViewSVN
  15. [Attributor][FIX] Remove initialize calls and add undefs

    The initialization logic has become part of the Attributor but the
    patches that introduced these calls here were in development when the
    transition happened.

    We also now clean up (undefine) the macros used to create attributes. — jdoerfert / ViewSVN
  16. [Attributor] Use local linkage instead of internal

    Local linkage is internal or private, and private is a specialization of
    internal, so either is fine for all our "local linkage" queries. — jdoerfert / ViewSVN
  17. [Attributor] Use abstract call sites for call site callback

    Summary:
    When we iterate over uses of functions and expect them to be call sites,
    we now use abstract call sites to allow callback calls.

    Reviewers: sstefan1, uenoku

    Subscribers: hiraditya, bollu, hfinkel, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67871 — jdoerfert / ViewSVN
  18. [tsan, go] fix Go windows build

    Summary:
    Don't use weak exports when building tsan into a shared library for Go. gcc can't handle the pragmas used to make the weak references.

    Include files that have been added since the last update to build.bat. (We should really find a better way to list all the files needed.)

    Add windows version defines (WINVER and _WIN32_WINNT) to get AcquireSRWLockExclusive and ReleaseSRWLockExclusive defined.

    Define GetProcessMemoryInfo to use the kernel32 version. This is kind of a hack, the windows header files should do this translation for us. I think we're not in the right family partition (we're using Desktop, but that translation only happens for App and System partitions???), but hacking the family partition seems equally gross and I have no idea what the consequences of that might be.

    Patch by Keith Randall.

    Reviewers: dvyukov, vitalybuka

    Reviewed By: vitalybuka

    Subscribers: jfb, delcypher, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D68599 — Vitaly Buka / ViewSVN
  19. [tsan, go] break commands into multiple lines

    Summary: Patch by Keith Randall.

    Reviewers: dvyukov, vitalybuka

    Subscribers: delcypher, jfb, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D68596 — Vitaly Buka / ViewSVN
  20. [X86] Shrink zero extends of gather indices from type less than i32 to types larger than i32.

    Gather instructions can use i32 or i64 elements for indices. If
    the index is zero extended from a type smaller than i32 to i64, we
    can shrink the extend to just extend to i32. — ctopper / ViewSVN
  21. [X86] Add test cases for zero extending a gather index from less than i32 to i64.

    We should be able to use a smaller zero extend. — ctopper / ViewSVN
  22. Fix the spelling of my name. — joerg / ViewSVN
  23. [sanitizer] Print SIGTRAP for corresponding signal

    Reviewers: eugenis, jfb

    Subscribers: #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68603 — Vitaly Buka / ViewSVN
  24. [tsan] Don't delay SIGTRAP handler

    Reviewers: eugenis, jfb

    Subscribers: #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68604 — Vitaly Buka / ViewSVN
  25. Add VFS support for sanitizers' blacklist

    Differential Revision: https://reviews.llvm.org/D67742 — Jan Korous / ViewSVN
  26. [X86] Add new calling convention that guarantees tail call optimization

    When the target option GuaranteedTailCallOpt is specified, calls with
    the fastcc calling convention will be transformed into tail calls if
    they are in tail position. This diff adds a new calling convention,
    tailcc, currently supported only on X86, which behaves the same way as
    fastcc, except that the GuaranteedTailCallOpt flag does not need to
    enabled in order to enable tail call optimization.

    Patch by Dwight Guth <dwight.guth@runtimeverification.com>!

    Reviewed By: lebedev.ri, paquette, rnk

    Differential Revision: https://reviews.llvm.org/D67855 — rnk / ViewSVN
  27. [WebAssembly] Fix unwind mismatch stat computation

    Summary:
    There was a bug when computing the number of unwind destination
    mismatches in CFGStackify. When there are many mismatched calls that
    share the same (original) destination BB, they have to be counted
    separately.

    This also fixes a typo and runs `fixUnwindMismatches` only when the wasm
    exception handling is enabled. This is to prevent unnecessary
    computations and does not change behavior.

    Reviewers: dschuff

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68552 — aheejin / ViewSVN
  28. [llvm-lipo] Add TextAPI to LINK_COMPONENTS

    Summary:
    D68319 uses `MachO::getCPUTypeFromArchitecture` and without this builds
    with `-DBUILD_SHARED_LIBS=ON` fail.

    Reviewers: alexshap

    Subscribers: mgorny, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68594 — aheejin / ViewSVN
  29. [Diagnostics] Emit better -Wbool-operation's warning message if we known that the result is always true — xbolva00 / ViewSVN
  30. [Attributor][FIX] Remove assertion wrong for on invalid IRPositions — jdoerfert / ViewSVN
  31. [libc++] Remove C++03 variadics in shared_ptr (v2)

        Summary: In my last patch (D67675) I forgot a few variadics. This patch removes the remaining make_shared and allocate_shared C++03 variadics.

        Reviewers: ldionne, EricWF, mclow.lists

        Subscribers: christof, dexonsmith, libcxx-commits

        Tags: #libc

        Differential Revision: https://reviews.llvm.org/D68000 — zoecarver / ViewSVN
  32. [llvm-c] Add UnaryOperator to LLVM_FOR_EACH_VALUE_SUBCLASS macro

    Note that we are not sure where the tests for these functions lives. This was discussed in the Phab Diff.

    Differential Revision: https://reviews.llvm.org/D68588 — mcinally / ViewSVN
  33. [WebAssembly] Add memory intrinsics handling to mayThrow()

    Summary:
    Previously, `WebAssembly::mayThrow()` assumed all inputs are global
    addresses. But when intrinsics, such as `memcpy`, `memmove`, or `memset`
    are lowered to external symbols in instruction selection and later
    emitted as library calls. And these functions don't throw.

    This patch adds handling to those memory intrinsics to `mayThrow`
    function. But while most of libcalls don't throw, we can't guarantee all
    of them don't throw, so currently we conservatively return true for all
    other external symbols.

    I think a better way to solve this problem is to embed 'nounwind' info
    in `TargetLowering::CallLoweringInfo`, so that we can access the info
    from the backend. This will also enable transferring 'nounwind'
    properties of LLVM IR instructions. Currently we don't transfer that
    info and we can only access properties of callee functions, if the
    callees are within the module. Other targets don't need this info in the
    backend because they do all the processing before isel, but it will help
    us because that info will reduce code size increase in fixing unwind
    destination mismatches in CFGStackify.

    But for now we return false for these memory intrinsics and true for all
    other libcalls conservatively.

    Reviewers: dschuff

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68553 — aheejin / ViewSVN
  34. [llvm-lipo] Relax the check of the specified input file architecture

    cctools lipo only compares the cputypes when it verifies that
    the specified (via -arch) input file and the architecture match.
    This diff adjusts the behavior of llvm-lipo accordingly.

    Differential revision: https://reviews.llvm.org/D68319

    Test plan: make check-all — alexshap / ViewSVN
  35. [Attributor] Deduce memory behavior of functions and arguments

    Deduce the memory behavior, aka "read-none", "read-only", or
    "write-only", for functions and arguments.

    Reviewers: sstefan1, uenoku

    Subscribers: hiraditya, bollu, jfb, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67384 — jdoerfert / ViewSVN
  36. [InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract-with-signext (PR42389)

    This can come up in Bit Stream abstractions.

    The pattern looks big/scary, but it can't be simplified any further.
    It only is so simple because a number of my preparatory folds had
    happened already (shift amount reassociation / shift amount
    reassociation in bit test, sign bit test detection).

    Highlights:
    * There are two main flavors: https://rise4fun.com/Alive/zWi
      The difference is add vs. sub, and left-shift of -1 vs. 1
    * Since we only change the shift opcode,
      we can preserve the exact-ness: https://rise4fun.com/Alive/4u4
    * There can be truncation after high-bit-extraction:
      https://rise4fun.com/Alive/slHc1   (the main pattern i'm after!)
      Which means that we need to ignore zext of shift amounts and of NBits.
    * The sign-extending magic can be extended itself (in add pattern
      via sext, in sub pattern via zext. not the other way around!)
      https://rise4fun.com/Alive/NhG
      (or those sext/zext can be sinked into `select`!)
      Which again means we should pay attention when matching NBits.
    * We can have both truncation of extraction and widening of magic:
      https://rise4fun.com/Alive/XTw
      In other words, i don't believe we need to have any checks on
      bitwidths of any of these constructs.

    This is worsened in general by the fact that we may have `sext` instead
    of `zext` for shift amounts, and we don't yet canonicalize to `zext`,
    although we should. I have not done anything about that here.

    Also, we really should have something to weed out `sub` like these,
    by folding them into `add` variant.

    https://bugs.llvm.org/show_bug.cgi?id=42389 — lebedevri / ViewSVN
  37. [InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern (PR42389)

    https://bugs.llvm.org/show_bug.cgi?id=42389 — lebedevri / ViewSVN
  38. [InstCombine] Move isSignBitCheck(), handle rest of the predicates

    True, no test coverage is being added here. But those non-canonical
    predicates that are already handled here already have no test coverage
    as far as i can tell. I tried to add tests for them, but all the patterns
    already get handled elsewhere. — lebedevri / ViewSVN
  39. [InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with mask

    Summary:
    Currently, we pre-check whether we need to produce a mask or not.
    This involves some rather magical constants.
    I'd like to extend this fold to also handle the situation
    when there's also a `trunc` before outer shift.
    That will require another set of magical constants.
    It's ugly.

    Instead, we can just compute the mask, and check
    whether mask is a pass-through (all-ones) or not.
    This way we don't need to have any magical numbers.

    This change is NFC other than the fact that we now compute
    the mask and then check if we need (and can!) apply it.

    Reviewers: spatel

    Reviewed By: spatel

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68470 — lebedevri / ViewSVN
  40. [InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts

    Summary:
    When we do `ConstantExpr::getZExt()`, that "extends" `undef` to `0`,
    which means that for patterns a/b we'd assume that we must not produce
    any bits for that channel, while in reality we simply didn't care
    about that channel - i.e. we don't need to mask it.

    Reviewers: spatel

    Reviewed By: spatel

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68239 — lebedevri / ViewSVN
  41. [Bitcode] Update naming of UNOP_NEG to UNOP_FNEG

    Differential Revision: https://reviews.llvm.org/D68588 — mcinally / ViewSVN
  42. [AccelTable] Remove stale comment (NFC)

    rdar://55857228 — Jonas Devlieghere / ViewSVN
  43. [OPENMP]Fix caonical->canonical, NFC.

    Fixed typo. — abataev / ViewSVN
  44. Attempt to fix a few clang-tidy tests on Windows, see PR43593. — nico / ViewSVN
  45. Fix for expanding __pragmas in macro arguments

    Summary:
    Avoid parsing __pragma into an annotation token when macro arguments are pre-expanded.
    This is what clang currently does when parsing _Pragmas.

    Fixes https://bugs.llvm.org/show_bug.cgi?id=41128, where clang crashed
    when trying to get the length of an annotation token.

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68114 — akhuang / ViewSVN
  46. gn build: try to make system-libs.windows.test pass — nico / ViewSVN
  47. AMDGPU/GlobalISel: Handle more G_INSERT cases

    Start manually writing a table to get the subreg index. TableGen
    should probably generate this, but I'm not sure what it looks like in
    the arbitrary case where subregisters are allowed to not fully cover
    the super-registers. — arsenm / ViewSVN
  48. GlobalISel: Partially implement lower for G_INSERT — arsenm / ViewSVN
  49. AMDGPU/GlobalISel: Fix selection of 16-bit shifts — arsenm / ViewSVN
  50. AMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32 — arsenm / ViewSVN
  51. AMDGPU/GlobalISel: Use S_MOV_B64 for inline constants

    This hides some defects in SIFoldOperands when the immediates are
    split. — arsenm / ViewSVN
  52. AMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources

    Continue making a mess of merge/unmerge legality. — arsenm / ViewSVN
  53. [OPENMP50]Treat range-based for as canonical loop.

    According to OpenMP 5.0, range-based for is also considered as a
    canonical form of loops. — abataev / ViewSVN
  54. AMDGPU/GlobalISel: Select more G_INSERT cases

    At minimum handle the s64 insert type, which are emitted in real cases
    during legalization.

    We really need TableGen to emit something to emit something like the
    inverse of composeSubRegIndices do determine the subreg index to use. — arsenm / ViewSVN
  55. GlobalISel: Add target pre-isel instructions

    Allows targets to introduce regbankselectable
    pseudo-instructions. Currently the closet feature to this is an
    intrinsic. However this requires creating a public intrinsic
    declaration. This litters the public intrinsic namespace with
    operations we don't necessarily want to expose to IR producers, and
    would rather leave as private to the backend.

    Use a new instruction bit. A previous attempt tried to keep using enum
    value ranges, but it turned into a mess. — arsenm / ViewSVN
  56. [clang] [cmake] Support LLVM_DISTRIBUTION_COMPONENTS in stand-alone build

    Differential Revision: https://reviews.llvm.org/D68412 — mgorny / ViewSVN
  57. Second attempt to add iterator_range::empty()

    Doing this makes MSVC complain that `empty(someRange)` could refer to
    either C++17's std::empty or LLVM's llvm::empty, which previously we
    avoided via SFINAE because std::empty is defined in terms of an empty
    member rather than begin and end. So, switch callers over to the new
    method as it is added.

    https://reviews.llvm.org/D68439 — jrose / ViewSVN
  58. Try to get clangd tests passing on Windows.

    Part of PR43592. See also r328645. — nico / ViewSVN
  59. [scudo][standalone] Correct releaseToOS behavior

    Summary:
    There was an issue in `releaseToOSMaybe`: one of the criteria to
    decide if we should proceed with the release was wrong. Namely:

    ```
    const uptr N = Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks;
    if (N * BlockSize < PageSize)
      return; // No chance to release anything.
    ```

    I meant to check if the amount of bytes in the free list was lower
    than a page, but this actually checks if the amount of **in use** bytes
    was lower than a page.

    The correct code is:

    ```
    const uptr BytesInFreeList =
      Region->AllocatedUser -
      (Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
    if (BytesInFreeList < PageSize)
      return 0; // No chance to release anything.
    ```

    Consequences of the bug:
    - if a class size has less than a page worth of in-use bytes (allocated
      or in a cache), reclaiming would not occur, whatever the amount of
      blocks in the free list; in real world scenarios this is unlikely to
      happen and be impactful;
    - if a class size had less than a page worth of free bytes (and enough
      in-use bytes, etc), then reclaiming would be attempted, with likely
      no result. This means the reclaiming was overzealous at times.

    I didn't have a good way to test for this, so I changed the prototype
    of the function to return the number of bytes released, allowing to
    get the information needed. The test added fails with the initial
    criteria.

    Another issue is that `ReleaseToOsInterval` can actually be 0, meaning
    we always try to release (side note: it's terrible for performances).
    so change a `> 0` check to `>= 0`.

    Additionally, decrease the `CanRelease` threshold to `PageSize / 32`.
    I still have to make that configurable but I will do it at another time.

    Finally, rename some variables in `printStats`: I feel like "available"
    was too ambiguous, so change it to "total".

    Reviewers: morehouse, hctim, eugenis, vitalybuka, cferris

    Reviewed By: morehouse

    Subscribers: delcypher, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D68471 — cryptoad / ViewSVN
  60. Fix Calling Convention through aliases

    r369697 changed the behavior of stripPointerCasts to no longer include
    aliases.  However, the code in CGDeclCXX.cpp's createAtExitStub counted
    on the looking through aliases to properly set the calling convention of
    a call.

    The result of the change was that the calling convention mismatch of the
    call would be replaced with a llvm.trap, causing a runtime crash.

    Differential Revision: https://reviews.llvm.org/D68584 — erichkeane / ViewSVN
  61. [libTooling][NFC] Fix build break in r373916.

    r373916 used raw strings inside macro calls, which breaks some builds. — ymandel / ViewSVN
  62. [clangd] Fix raciness in code completion tests

    Reviewers: sammccall, ilya-biryukov

    Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68273 — kadircet / ViewSVN
  63. [Remarks] Pass StringBlockValue as StringRef.

    After changing the remark serialization, we now pass StringRefs to the
    serializer. We should use StringRef for StringBlockVal, to avoid
    creating temporary objects, which then cause StringBlockVal.Value to
    point to invalid memory.

    Reviewers: thegameg, anemet

    Reviewed By: thegameg

    Differential Revision: https://reviews.llvm.org/D68571 — fhahn / ViewSVN
  64. [clang-format] [PR27004] omits leading space for noexcept when formatting operator delete()

    Summary:
    clang-format is incorrectly thinking the parameter parens are part of a cast operation, this is resulting in there sometimes being not space between the paren and the noexcept (and other keywords like volatile etc..)

    ```
    void operator++(int) noexcept;
    void operator++(int &) noexcept;
    void operator delete(void *, std::size_t, const std::nothrow_t &)noexcept;
    ```

    Reviewers: klimek, owenpan, mitchell-stellar

    Reviewed By: mitchell-stellar

    Subscribers: cfe-commits

    Tags: #clang-format, #clang

    Differential Revision: https://reviews.llvm.org/D68481 — paulhoad / ViewSVN
  65. [clang-format] [NFC] Ensure clang-format is itself clang-formatted.

    Summary:
    Before making a proposed change, ensure ClangFormat.cpp is fully clang-formatted,

    no functional change just clang-formatting using the in tree .clang-format.

    Reviewers: mitchell-stellar

    Reviewed By: mitchell-stellar

    Subscribers: Eugene.Zelenko, cfe-commits

    Tags: #clang-format, #clang

    Differential Revision: https://reviews.llvm.org/D68551 — paulhoad / ViewSVN
  66. Fix build errors caused by rL373914. — wmi / ViewSVN
  67. Codegen - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  68. [llvm-profdata] Minor format fix

    Summary: Minor format fix for output of "llvm-profdata -show"

    Reviewers: wmi

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68440 — wenlei / ViewSVN
  69. [libTooling] Add `toString` method to the Stencil class

    Summary:
    `toString` generates a string representation of the stencil.

    Patch by Harshal T. Lehri.

    Reviewers: gribozavr

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68574 — ymandel / ViewSVN
  70. [X86][SSE] getTargetShuffleInputs - move VT.isSimple/isVector checks inside. NFCI.

    Stop all the callers from having to check the value type before calling getTargetShuffleInputs. — rksimon / ViewSVN
  71. [SampleFDO] Add compression support for any section in ExtBinary profile format

    Previously ExtBinary profile format only supports compression using zlib for
    profile symbol list. In this patch, we extend the compression support to any
    section. User can select some or all of the sections to compress. In an
    experiment, for a 45M profile in ExtBinary format, compressing name table
    reduced its size to 24M, and compressing all the sections reduced its size
    to 11M.

    Differential Revision: https://reviews.llvm.org/D68253 — wmi / ViewSVN
  72. [LoopVectorize] add test that asserted after cost model change (PR43582); NFC — spatel / ViewSVN
  73. Allow update_test_checks.py to not scrub names.

    Add a --preserve-names option to tell the script not to replace IR names.
    Sometimes tests want those names.  For example if a test is looking for a
    modification to an existing instruction we'll want to make the names.

    Differential Revision: https://reviews.llvm.org/D68081 — greened / ViewSVN
  74. Sema - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  75. [clang] Add test for FindNextToken in Lexer.

    Reviewers: ilya-biryukov

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68565 — usaxena95 / ViewSVN
  76. Fix another sphinx warning.

    Differential Revision: https://reviews.llvm.org/D64746 — kpn / ViewSVN
  77. Regenerate ptr-rotate.ll . NFC — deadalnix / ViewSVN
  78. [Mips] Always save RA when disabling frame pointer elimination

    This ensures that frame-based unwinding will continue to work when
    calling a noreturn function; there is not much use having the caller's
    frame pointer saved if you don't also have the caller's program counter.

    Patch by James Clarke.

    Differential Revision: https://reviews.llvm.org/D68542 — atanasyan / ViewSVN
  79. [Mips] Fix evaluating J-format branch targets

    J/JAL/JALX/JALS are absolute branches, but stay within the current
    256 MB-aligned region, so we must include the high bits of the
    instruction address when calculating the branch target.

    Patch by James Clarke.

    Differential Revision: https://reviews.llvm.org/D68548 — atanasyan / ViewSVN
  80. RewriteModernObjC - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  81. AST - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  82. [LLVM-C] Add bindings to create macro debug info

    Summary: The C API doesn't have the bindings to create macro debug information.

    Reviewers: whitequark, CodaFi, deadalnix

    Reviewed By: whitequark

    Subscribers: aprantl, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D58334 — whitequark / ViewSVN
  83. Fix sphinx warnings.

    Differential Revision: https://reviews.llvm.org/D64746 — kpn / ViewSVN
  84. Test commit

    Fix comment. — mbrkusanin / ViewSVN
  85. [FPEnv] Add constrained intrinsics for lrint and lround

    Earlier in the year intrinsics for lrint, llrint, lround and llround were
    added to llvm. The constrained versions are now implemented here.

    Reviewed by: andrew.w.kaylor, craig.topper, cameron.mcinally
    Approved by: craig.topper
    Differential Revision: https://reviews.llvm.org/D64746 — kpn / ViewSVN
  86. gn build: use better triple on windows

    The CMake build uses "x86_64-pc-windows-msvc". The "-msvc" suffix is
    important because e.g. clang/test/lit.cfg.py matches against the
    suffix "windows-msvc" to compute the presence of the "ms-sdk" and
    the absence of the "LP64" feature.

    Differential Revision: https://reviews.llvm.org/D68572 — nico / ViewSVN
  87. Revert r373888 "[IA] Recognize hexadecimal escape sequences"

    It broke MC/AsmParser/directive_ascii.s on all bots:

        Assertion failed: (Index < Length && "Invalid index!"), function operator[],
            file ../../llvm/include/llvm/ADT/StringRef.h, line 243. — nico / ViewSVN
  88. [clangd] Catch an unchecked "Expected<T>" in HeaderSourceSwitch.

    Summary: Also fixes a potential user-after-scope issue of "Path".

    Reviewers: kadircet

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68564 — hokein / ViewSVN
  89. [ASTImporter][NFC] Enable disabled but passing test

    RedeclChainShouldBeCorrectAmongstNamespaces — martong / ViewSVN
  90. [ASTImporter][NFC] Update ASTImporter internals docs — martong / ViewSVN
  91. [ASTImporter][NFC] Fix typo in user docs — martong / ViewSVN
  92. [AMDGPU] Fix test checks

    The GFX10-DENORM-STRICT checks were only passing by accident. Fix them
    to make the test more robust in the face of scheduling or register
    allocation changes. — foad / ViewSVN

#5506 (Oct 7, 2019 3:44:27 AM)

  1. [clangd] If an undocumented definition exists, don't accept documentation from other forward decls.

    Summary:
    This fixes cases like:
      foo.h
        class Undocumented{}
      bar.h
        // break an include cycle. we should refactor this!
        class Undocumented;
    Where the comment doesn't describe the class.

    Note that a forward decl that is *visible to the definition* will still have
    its doc comment used, by SymbolCollector: Merge isn't involved here.

    Reviewers: ilya-biryukov

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

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68467 — sammccall / ViewSVN
  2. [llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG section dumping.

    This patch:

    * Adds a llvm-readobj/llvm-readelf test file for SHT_LLVM_ADDRSIG sections. (we do not have any)
    * Enables dumping of SHT_LLVM_ADDRSIG with --all.
    * Changes the logic to report a warning instead of an error when something goes wrong during dumping
      (allows to continue dumping SHT_LLVM_ADDRSIG and other sections on error).
    * Refactors a piece of logic to a new toULEB128Array helper which might be used for GNU-style
      dumping implementation.

    Differential revision: https://reviews.llvm.org/D68383 — grimar / ViewSVN
  3. [clangd] Collect missing macro references.

    Summary: Semantic highlghting is missing a few macro references.

    Reviewers: ilya-biryukov

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

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68458 — hokein / ViewSVN
  4. [IA] Recognize hexadecimal escape sequences

    Summary:
    Implement support for hexadecimal escape sequences to match how GNU 'as'
    handles them. I.e., read all hexadecimal characters and truncate to the
    lower 16 bits.

    Reviewers: nickdesaulniers

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68483 — void / ViewSVN
  5. clang-cl: Ignore the new /ZH options

    These were added to the MS docs in
    https://github.com/MicrosoftDocs/cpp-docs/commit/85b9b6967e58e485251450f7451673f6fc873e88
    and are supposedly available in VS 2019 16.4 (though my 2019 Preview,
    version 16.4.0-pre.1.0 don't seem to have them.) — hans / ViewSVN
  6. [TableGen] Pacify gcc-5.4 more

    Followup to a previous pacification, this performs the same workaround
    to the TableGen generated code for tuple automata. — jamesm / ViewSVN
  7. Revert "[SLP] avoid reduction transform on patterns that the backend can load-combine"

    This reverts SVN r373833, as it caused a failed assert "Non-zero loop
    cost expected" on building numerous projects, see PR43582 for details
    and reproduction samples. — mstorsjo / ViewSVN
  8. [llvm-locstats] Fix a typo in the documentation; NFC — djtodoro / ViewSVN
  9. [X86] Autogenerate checks in leaFixup32.mir and leaFixup64.mir. NFC — ctopper / ViewSVN
  10. [X86] Support LEA64_32r in processInstrForSlow3OpLEA and use INC/DEC when possible.

    Move the erasing and iterator updating inside to match the
    other slow LEA function.

    I've adapted code from optTwoAddrLEA and basically rebuilt the
    implementation here. We do lose the kill flags now just like
    optTwoAddrLEA. This runs late enough in the pipeline that
    shouldn't really be a problem. — ctopper / ViewSVN
  11. [NFC][CGP] Tests for making ICMP_EQ use CR result of ICMP_S(L|G)T dominators — yi-hong.lyu / ViewSVN
  12. [c++20] Check for a class-specific operator delete when deleting an
    object of class type with a virtual destructor. — rsmith / ViewSVN
  13. Fix behavior of __builtin_bit_cast when the From and To types are the
    same.

    We were missing the lvalue-to-rvalue conversion entirely in this case,
    and in fact still need the full CK_LValueToRValueBitCast conversion to
    perform a load with no TBAA. — rsmith / ViewSVN
  14. gn build: no-op style tweak in sync script — nico / ViewSVN
  15. [Docs] Removes Subsystem Documentation page

    Removes Subsystem Documentation page. Also moves existing topics on Subsystem Documentation page to User Guides and Reference pages. — dr87 / ViewSVN
  16. [X86][AVX] Access a scalar float/double as a free extract from a broadcast load (PR43217)

    If a fp scalar is loaded and then used as both a scalar and a vector broadcast, perform the load as a broadcast and then extract the scalar for 'free' from the 0th element.

    This involved switching the order of the X86ISD::BROADCAST combines so we only convert to X86ISD::BROADCAST_LOAD once all other canonicalizations have been attempted.

    Adds a DAGCombinerInfo::recursivelyDeleteUnusedNodes wrapper.

    Fixes PR43217

    Differential Revision: https://reviews.llvm.org/D68544 — rksimon / ViewSVN
  17. Fix signed/unsigned warning. NFCI — rksimon / ViewSVN
  18. [NFC][PowerPC] Reorganize CRNotPat multiclass patterns in PPCInstrInfo.td

    This is patch aims to group together the `CRNotPat` multi class instantiations
    within the `PPCInstrInfo.td` file.

    Integer instantiations of the multi class are grouped together into a section,
    and the floating point patterns are separated into its own section.

    Differential Revision: https://reviews.llvm.org/D67975 — amyk / ViewSVN
  19. [X86][SSE] Remove resolveTargetShuffleInputs and use getTargetShuffleInputs directly.

    Move the resolveTargetShuffleInputsAndMask call to after the shuffle mask combine before the undef/zero constant fold instead. — rksimon / ViewSVN
  20. [X86][SSE] Don't merge known undef/zero elements into target shuffle masks.

    Replaces setTargetShuffleZeroElements with getTargetShuffleAndZeroables which reports the Zeroable elements but doesn't merge them into the decoded target shuffle mask (the merging has been moved up into getTargetShuffleInputs until we can get rid of it entirely).

    This is part of the work to fix PR43024 and allow us to use SimplifyDemandedElts to simplify shuffle chains - we need to get to a point where the target shuffle mask isn't adjusted by its source inputs but instead we cache them in a parallel Zeroable mask. — rksimon / ViewSVN
  21. Implements CWG 1601 in [over.ics.rank/4.2]

    Summary:
    The overload resolution for enums with a fixed underlying type has changed in the C++14 standard. This patch implements the new rule.

    Patch by Mark de Wever!

    Reviewers: rsmith

    Reviewed By: rsmith

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D65695 — rsmith / ViewSVN
  22. [X86] Add custom type legalization for v16i64->v16i8 truncate and v8i64->v8i8 truncate when v8i64 isn't legal

    Summary:
    The default legalization for v16i64->v16i8 tries to create a multiple stage truncate concatenating after each stage and truncating again. But avx512 implements truncates with multiple uops. So it should be better to truncate all the way to the desired element size and then concatenate the pieces using unpckl instructions. This minimizes the number of 2 uop truncates. The unpcks are all single uop instructions.

    I tried to handle this by just custom splitting the v16i64->v16i8 shuffle. And hoped that the DAG combiner would leave the two halves in the state needed to make D68374 do the job for each half. This worked for the first half, but the second half got messed up. So I've implemented custom handling for v8i64->v8i8 when v8i64 needs to be split to produce the VTRUNCs directly.

    Reviewers: RKSimon, spatel

    Reviewed By: RKSimon

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68428 — ctopper / ViewSVN
  23. [LegalizeTypes][X86] When splitting a vselect for type legalization, don't split a setcc condition if the setcc input is legal and vXi1 conditions are supported

    Summary: The VSELECT splitting code tries to split a setcc input as well. But on avx512 where mask registers are well supported it should be better to just split the mask and use a single compare.

    Reviewers: RKSimon, spatel, efriedma

    Reviewed By: spatel

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68359 — ctopper / ViewSVN
  24. [Sema] Avoids an assertion failure when an invalid conversion declaration is used

    Summary:
    When using a user-defined conversion function template with a deduced return type the compiler gives a set of warnings:
    ```
    bug.cc:252:44: error: cannot specify any part of a return type in the declaration of a conversion function; use an alias template to declare a conversion to 'auto (Ts &&...) const'
      template <typename... Ts> operator auto()(Ts &&... xs) const;
                                               ^~~~~~~~~~~~~~~~~~~
    bug.cc:252:29: error: conversion function cannot convert to a function type
      template <typename... Ts> operator auto()(Ts &&... xs) const;
                                ^
    error: pointer to function type cannot have 'const' qualifier
    ```
    after which it triggers an assertion failure. It seems the last error is incorrect and doesn't have any location information. This patch stops the compilation after the second warning.

    Fixes bug 31422.

    Patch by Mark de Wever!

    Reviewers: rsmith

    Reviewed By: rsmith

    Subscribers: bbannier, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D64820 — rsmith / ViewSVN
  25. gn build: make windows build less broken — nico / ViewSVN
  26. [LOOPGUARD] Remove asserts in getLoopGuardBranch
    Summary: The assertion in getLoopGuardBranch can be a 'return nullptr'
    under if condition.
    Authored By: DTharun
    Reviewer: Whitney, fhahn
    Reviewed By: Whitney, fhahn
    Subscribers: fhahn, llvm-commits
    Tag: LLVM
    Differential Revision: https://reviews.llvm.org/D66084 — whitneyt / ViewSVN
  27. [Docs] Removes Programming Documentation page

    Removes Programming Documentation page. Also moves existing topics on Programming Documentation page to User Guides and Reference pages. — dr87 / ViewSVN

#5505 (Oct 6, 2019 8:45:48 AM)

  1. [X86][SSE] resolveTargetShuffleInputs - call getTargetShuffleInputs instead of using setTargetShuffleZeroElements directly. NFCI. — rksimon / ViewSVN
  2. [Docs] Adds new Getting Started/Tutorials page

    Adds a new page for Getting Started/Tutorials topics. Also updates existing topic categories on the User Guides and Reference pages. — dr87 / ViewSVN
  3. Revert [DAGCombine] Match more patterns for half word bswap

    This reverts r373850 (git commit 25ba49824d2d4f2347b4a7cb1623600a76ce9433)

    This patch appears to cause multiple codegen regression test failures - http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10680 — spatel / ViewSVN
  4. [NFC] Replace 'isDarwin' with 'IsDarwin'

    Summary: Replace 'isDarwin' with 'IsDarwin' based on LLVM naming convention.

    Differential Revision: https://reviews.llvm.org/D68336 — xiangling_liao / ViewSVN
  5. [InstCombine] fold fneg disguised as select+fmul (PR43497)

    Extends rL373230 and solves the motivating bug (although in a narrow way):
    https://bugs.llvm.org/show_bug.cgi?id=43497 — spatel / ViewSVN
  6. [DAGCombine] Match more patterns for half word bswap

    Summary: It ensures that the bswap is generated even when a part of the subtree already matches a bswap transform.

    Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68250 — deadalnix / ViewSVN
  7. [X86][AVX] combineExtractSubvector - merge duplicate variables. NFCI. — rksimon / ViewSVN
  8. [InstCombine] add fast-math-flags for better test coverage; NFC — spatel / ViewSVN
  9. [InstCombine] don't assume 'inbounds' for bitcast pointer to GEP transform (PR43501)

    https://bugs.llvm.org/show_bug.cgi?id=43501
    We can't declare a GEP 'inbounds' in general. But we may salvage that information if
    we have known dereferenceable bytes on the source pointer.

    Differential Revision: https://reviews.llvm.org/D68244 — spatel / ViewSVN
  10. [X86][SSE] matchVectorShuffleAsBlend - use Zeroable element mask directly.

    We can make use of the Zeroable mask to indicate which elements we can safely set to zero instead of creating a target shuffle mask on the fly.

    This allows us to remove createTargetShuffleMask.

    This is part of the work to fix PR43024 and allow us to use SimplifyDemandedElts to simplify shuffle chains - we need to get to a point where the target shuffle masks isn't adjusted by its source inputs in setTargetShuffleZeroElements but instead we cache them in a parallel Zeroable mask. — rksimon / ViewSVN
  11. [X86] Enable AVX512BW for memcmp() — davezarzycki / ViewSVN
  12. [clang-format][docs] Fix the Google C++ and Chromium style guide URLs

    Summary: The Google C++ and Chromium style guides are broken in the clang-format docs. This patch updates them.

    Reviewers: djasper, MyDeveloperDay

    Reviewed By: MyDeveloperDay

    Subscribers: cfe-commits

    Tags: #clang

    Patch by: m4tx

    Differential Revision: https://reviews.llvm.org/D61256 — paulhoad / ViewSVN
  13. AMDGPU/GlobalISel: Fall back on weird G_EXTRACT offsets — arsenm / ViewSVN
  14. AMDGPU/GlobalISel: RegBankSelect mul24 intrinsics — arsenm / ViewSVN
  15. AMDGPU/GlobalISel: RegBankSelect DS GWS intrinsics — arsenm / ViewSVN
  16. AMDGPU/GlobalISel: Lower G_ATOMIC_CMPXCHG_WITH_SUCCESS — arsenm / ViewSVN
  17. GlobalISel: Partially implement lower for G_EXTRACT

    Turn into shift and truncate. Doesn't yet handle pointers. — arsenm / ViewSVN
  18. AMDGPU/GlobalISel: Fix RegBankSelect for sendmsg intrinsics

    This wasn't updated for the immarg handling change. — arsenm / ViewSVN
  19. [FastISel] Copy the inline assembly dialect to the INLINEASM instruction.

    Fixes PR43575. — ctopper / ViewSVN
  20. [X86][AVX] Push sign extensions of comparison bool results through bitops (PR42025)

    As discussed on PR42025, with more complex boolean math we can end up with many truncations/extensions of the comparison results through each bitop.

    This patch handles the cases introduced in combineBitcastvxi1 by pushing the sign extension through the AND/OR/XOR ops so its just the original SETCC ops that gets extended.

    Differential Revision: https://reviews.llvm.org/D68226 — rksimon / ViewSVN

#5504 (Oct 5, 2019 1:37:54 PM)

  1. [SLP] avoid reduction transform on patterns that the backend can load-combine

    I don't see an ideal solution to these 2 related, potentially large, perf regressions:
    https://bugs.llvm.org/show_bug.cgi?id=42708
    https://bugs.llvm.org/show_bug.cgi?id=43146

    We decided that load combining was unsuitable for IR because it could obscure other
    optimizations in IR. So we removed the LoadCombiner pass and deferred to the backend.
    Therefore, preventing SLP from destroying load combine opportunities requires that it
    recognizes patterns that could be combined later, but not do the optimization itself (
    it's not a vector combine anyway, so it's probably out-of-scope for SLP).

    Here, we add a scalar cost model adjustment with a conservative pattern match and cost
    summation for a multi-instruction sequence that can probably be reduced later.
    This should prevent SLP from creating a vector reduction unless that sequence is
    extremely cheap.

    In the x86 tests shown (and discussed in more detail in the bug reports), SDAG combining
    will produce a single instruction on these tests like:

      movbe   rax, qword ptr [rdi]

    or:

      mov     rax, qword ptr [rdi]

    Not some (half) vector monstrosity as we currently do using SLP:

      vpmovzxbq       ymm0, dword ptr [rdi + 1] # ymm0 = mem[0],zero,zero,..
      vpsllvq ymm0, ymm0, ymmword ptr [rip + .LCPI0_0]
      movzx   eax, byte ptr [rdi]
      movzx   ecx, byte ptr [rdi + 5]
      shl     rcx, 40
      movzx   edx, byte ptr [rdi + 6]
      shl     rdx, 48
      or      rdx, rcx
      movzx   ecx, byte ptr [rdi + 7]
      shl     rcx, 56
      or      rcx, rdx
      or      rcx, rax
      vextracti128    xmm1, ymm0, 1
      vpor    xmm0, xmm0, xmm1
      vpshufd xmm1, xmm0, 78          # xmm1 = xmm0[2,3,0,1]
      vpor    xmm0, xmm0, xmm1
      vmovq   rax, xmm0
      or      rax, rcx
      vzeroupper
      ret

    Differential Revision: https://reviews.llvm.org/D67841 — spatel / ViewSVN
  2. [X86] lowerShuffleAsLanePermuteAndRepeatedMask - variable renames. NFCI.

    Rename some variables to match lowerShuffleAsRepeatedMaskAndLanePermute - prep work toward adding some equivalent sublane functionality. — rksimon / ViewSVN
  3. Try to fix sphinx indentation error — rksimon / ViewSVN
  4. [SelectionDAG] Add tests for LKK algorithm

    Added some tests testing urem and srem operations with a constant divisor.

    Patch by TG908 (Tim Gymnich)

    Differential Revision: https://reviews.llvm.org/D68421 — xbolva00 / ViewSVN
  5. RewriteObjC - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  6. [Diagnostics] Highlight expr's source range for -Wbool-operation

    Warning message looks better; and GCC adds it too. — xbolva00 / ViewSVN
  7. SemaTemplate - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  8. TreeTransform - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  9. Remove redundant !HasDependentValue check. NFCI.

    Fixes cppcheck warning. — rksimon / ViewSVN
  10. SemaStmt - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  11. BranchFolding - IsBetterFallthrough - assert non-null pointers. NFCI.

    Silences static analyzer null dereference warnings. — rksimon / ViewSVN
  12. [clang-format] SpacesInSquareBrackets should affect lambdas with parameters too

    Summary:
    This patch makes the `SpacesInSquareBrackets` setting also apply to C++ lambdas with parameters.

    Looking through the revision history, it appears support for only array brackets was added, and lambda brackets were ignored. Therefore, I am inclined to think it was simply an omission, rather than a deliberate choice.

    See https://bugs.llvm.org/show_bug.cgi?id=17887 and https://reviews.llvm.org/D4944.

    Reviewers: MyDeveloperDay, reuk, owenpan

    Reviewed By: MyDeveloperDay

    Subscribers: cfe-commits

    Patch by: mitchell-stellar

    Tags: #clang-format, #clang

    Differential Revision: https://reviews.llvm.org/D68473 — paulhoad / ViewSVN
  13. [UnitTests] Try and pacify gcc-5

    This looks like a defect in gcc-5 where it chooses a constexpr
    constructor from the initializer-list that it considers to be explicit.

    I've tried to reproduce but I can't install anything prior to gcc-6 easily
    on my system, and that doesn't have the error. So this is speculative
    pacification.

    Reported by Steven Wan. — jamesm / ViewSVN
  14. [NFCI] Slightly improve warning message — xbolva00 / ViewSVN
  15. [Diagnostics] Use Expr::isKnownToHaveBooleanValue() to check bitwise negation of bool in languages without a bool type

    Thanks for this advice, Richard Trieu! — xbolva00 / ViewSVN

#5503 (Oct 4, 2019 7:52:21 PM)

  1. Expose ProvidePositionalOption as a public API

    The motivation is to reuse the key value parsing logic here to
    parse instance specific pass options within the context of MLIR.
    The primary functionality exposed is the "," splitting for
    arrays and the logic for properly handling duplicate definitions
    of a single flag.

    Patch by: Parker Schuh <parkers@google.com>

    Differential Revision: https://reviews.llvm.org/D68294 — Mehdi Amini / ViewSVN
  2. Fix a *nasty* miscompile in experimental unordered atomic lowering

    This is an omission in rL371441.  Loads which happened to be unordered weren't being added to the PendingLoad set, and thus weren't be ordered w/respect to side effects which followed before the end of the block.

    Included test case is how I spotted this.  We had an atomic load being folded into a using instruction after a fence that load was supposed to be ordered with.  I'm sure it showed up a bunch of other ways as well.

    Spotted via manual inspecting of assembly differences in a corpus w/and w/o the new experimental mode.  Finding this with testing would have been "unpleasant". — reames / ViewSVN
  3. [Test] Add a test case fo a missed oppurtunity in implicit null checking — reames / ViewSVN
  4. [RISCV] Added missing ImmLeaf predicates

    simm9_lsb0 and simm12_lsb0 operand types were missing predicates. — apazos / ViewSVN
  5. Add a unittest to verify for assumption cache

    Reviewers: vsk, tejohnson

    Reviewed By: vsk

    Differential Revision: https://reviews.llvm.org/D68095 — hiraditya / ViewSVN
  6. [libc++] Guard cxx_experimental settings behind LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY

    If you explicitly set LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY to OFF, your
    project will fail to configure because the cxx_experimental target
    doesn't exist. — xiaobai / ViewSVN
  7. [libc++] Localize common build flags into a single CMake function

    Also, set those flags for the cxx_experimental target. Otherwise,
    cxx_experimental doesn't build properly when neither the static nor
    the shared library is compiled (yes, that is a weird setup). — Louis Dionne / ViewSVN
  8. Invalidate assumption cache before outlining.

    Subscribers: llvm-commits

    Tags: #llvm

    Reviewers: compnerd, vsk, sebpop, fhahn, tejohnson

    Reviewed by: vsk

    Differential Revision: https://reviews.llvm.org/D68478 — hiraditya / ViewSVN
  9. Revert [CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

    This reverts r371177 (git commit f879c6875563c0a8cd838f1e13b14dd33558f1f8)

    It caused PR43566 by removing empty, address-taken MachineBasicBlocks.
    Such blocks may have references from blockaddress or other operands, and
    need more consideration to be removed.

    See the PR for a test case to use when relanding. — rnk / ViewSVN
  10. [InstCombine] Fold 'icmp eq/ne (?trunc (lshr/ashr %x, bitwidth(x)-1)), 0' -> 'icmp sge/slt %x, 0'

    We do indeed already get it right in some cases, but only transitively,
    with one-use restrictions. Since we only need to produce a single
    comparison, it makes sense to match the pattern directly:
      https://rise4fun.com/Alive/kPg — lebedevri / ViewSVN
  11. [InstCombine] Right-shift shift amount reassociation with truncation (PR43564, PR42391)

    Initially (D65380) i believed that if we have rightshift-trunc-rightshift,
    we can't do any folding. But as it usually happens, i was wrong.

    https://rise4fun.com/Alive/GEw
    https://rise4fun.com/Alive/gN2O

    In https://bugs.llvm.org/show_bug.cgi?id=43564 we happen to have
    this very sequence, of two right shifts separated by trunc.
    And "just" so that happens, we apparently can fold the pattern
    if the total shift amount is either 0, or it's equal to the bitwidth
    of the innermost widest shift - i.e. if we are left with only the
    original sign bit. Which is exactly what is wanted there. — lebedevri / ViewSVN
  12. [NFC][InstCombine] Autogenerate shift.ll test — lebedevri / ViewSVN
  13. [NFC][InstCombine] Autogenerate icmp-shr-lt-gt.ll test — lebedevri / ViewSVN
  14. [NFC][InstCombine] Tests for bit test via highest sign-bit extract (w/ trunc) (PR43564)

    https://rise4fun.com/Alive/x5IS — lebedevri / ViewSVN
  15. [NFC][InstCombine] Tests for right-shift shift amount reassociation (w/ trunc) (PR43564, PR42391)

    https://rise4fun.com/Alive/GEw — lebedevri / ViewSVN
  16. Add an off-by-default option to enable testing for gdb pretty printers.

    Summary:
    The current version of the pretty printers are not python3 compatible,
    so turn them off by default until sufficiently improved.

    Reviewers: MaskRay, tamur

    Subscribers: mgorny, christof, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68477 — saugustine / ViewSVN
  17. [lit] Use better name for "test in parallel" concept

    In the past, lit used threads to run tests in parallel. Today we use
    `multiprocessing.Pool`, which uses processes. Let's stay more abstract
    and use "worker" everywhere.

    Reviewed By: rnk

    Differential Revision: https://reviews.llvm.org/D68475 — yln / ViewSVN
  18. [clang] fix a typo from r372531

    Reviewers: xbolva00

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68482 — yuanfang / ViewSVN
  19. [MachineOutliner] Disable outlining from noreturn functions

    Outlining from noreturn functions doesn't do the correct thing right now. The
    outliner should respect that the caller is marked noreturn. In the event that
    we have a noreturn function, and the outlined code is in tail position, the
    outliner will not see that the outlined function should be tail called. As a
    result, you end up with a regular call containing a return.

    Fixing this requires that we check that all candidates live inside noreturn
    functions. So, for the sake of correctness, don't outline from noreturn
    functions right now.

    Add machine-outliner-noreturn.mir to test this. — paquette / ViewSVN
  20. [InstCombine] add tests for fneg disguised as fmul; NFC — spatel / ViewSVN
  21. [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible

    Use clang_target_link_libraries() in order to support linking against
    libclang-cpp instead of static libraries.

    Differential Revision: https://reviews.llvm.org/D68448 — mgorny / ViewSVN
  22. [clang] [cmake] Use add_clang_tool() to install all tools

    Switch clang-check, clang-extdef-mapping and clang-offload-bundler
    to use add_clang_tool() rather than add_clang_executable() with a custom
    install rule.  This makes them LLVM_DISTRIBUTION_COMPONENTS-friendly.

    Differential Revision: https://reviews.llvm.org/D68429 — mgorny / ViewSVN
  23. [NFC] Add { } to silence compiler warning [-Wmissing-braces].

    ../llvm-project/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:355:48: warning: suggest braces around initialization of subobject [-Wmissing-braces]
          return addMappingFromTable<1>(MI, MRI, { 0 }, Table);
                                                   ^
                                                   {} — huihuiz / ViewSVN
  24. [ScheduleDAG] When a node is cloned, add an edge between the nodes.

    InstrEmitter's virtual register handling assumes that clones are emitted
    after the cloned node.  Make sure this assumption actually holds.

    Fixes a "Node emitted out of order - early" assertion on the testcase.

    This is probably a very rare case to actually hit in practice; even
    without the explicit edge, the scheduler will usually end up scheduling
    the nodes in the expected order due to other constraints.

    Differential Revision: https://reviews.llvm.org/D68068 — efriedma / ViewSVN
  25. [test] Remove another two unnecessary uses of REQUIRES: target-windows. NFC.

    Differential Revision: https://reviews.llvm.org/D68449 — mstorsjo / ViewSVN
  26. [JITLink] Silence GCC warnings. NFC.

    Use parentheses in an expression with mixed && and ||.

    Differential Revision: https://reviews.llvm.org/D68447 — mstorsjo / ViewSVN
  27. [Sema] Split out -Wformat-type-confusion from -Wformat-pedantic

    The warnings now in -Wformat-type-confusion don't align with how we interpret
    'pedantic' in clang, and don't belong in -pedantic.

    Differential revision: https://reviews.llvm.org/D67775 — epilk / ViewSVN
  28. [libc++] Make the modules-related flags PUBLIC instead of PRIVATE

    It appears that those need to be propagated to targets that use libc++
    as well, otherwise they don't build properly. — Louis Dionne / ViewSVN
  29. Add missing null pointer check in -ftime-trace code

    createOutputFile diagnoses the error for the caller already, so recover
    by not writing the output.

    Fixes PR43555

    No test, since I couldn't think of a good, portable, simple way to make
    the regular -o output file writable, but outputfile.json not writable. — rnk / ViewSVN
  30. [CMake] Clang: Don't use object libraries with Xcode

    Undoes some of the effects of r360946 when using the Xcode CMake
    generator---it doesn't handle object libraries correctly at all.
    Attempts to still honor BUILD_SHARED_LIBS for Xcode, but I didn't
    actually test it. Should have no effect on non-Xcode generators.

    https://reviews.llvm.org/D68430 — jrose / ViewSVN
  31. [libc++] Move more CMake flags to per-target definitions

    This daily refactoring tackles flags related to modules,
    exceptions and RTTI. — Louis Dionne / ViewSVN
  32. [X86] Remove isel patterns for mask vpcmpgt/vpcmpeq. Switch vpcmp to these based on the immediate in MCInstLower

    The immediate form of VPCMP can represent these completely. The
    vpcmpgt/eq are just shorter encodings.

    This patch removes the isel patterns and just swaps the opcodes
    and removes the immediate in MCInstLower. This matches where we do
    some other encodings tricks.

    Removes over 10K bytes from the isel table.

    Differential Revision: https://reviews.llvm.org/D68446 — ctopper / ViewSVN
  33. [X86] Add DAG combine to form saturating VTRUNCUS/VTRUNCS from VTRUNC

    We already do this for ISD::TRUNCATE, but we can do the same for X86ISD::VTRUNC

    Differential Revision: https://reviews.llvm.org/D68432 — ctopper / ViewSVN
  34. Add few docs and implementation of strcpy and strcat.

    Summary:
    This patch illustrates some of the features like modularity we want
    in the new libc. Few other ideas like different kinds of testing, redirectors
    etc are not yet present.

    Reviewers: dlj, hfinkel, theraven, jfb, alexshap, jdoerfert

    Subscribers: mgorny, dexonsmith, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67867 — sivachandra / ViewSVN
  35. [Automaton] Fix invalid iterator reference

    Found by the expensive checks bot. — jamesm / ViewSVN
  36. [ModuloSchedule] Do not remap terminators

    This is a trivial point fix. Terminator instructions aren't scheduled, so
    we shouldn't expect to be able to remap them.

    This doesn't affect Hexagon and PPC because their terminators are always
    hardware loop backbranches that have no register operands. — jamesm / ViewSVN
  37. [FPEnv] Strict FP tests should use the requisite function attributes.

    A set of function attributes is required in any function that uses constrained
    floating point intrinsics. None of our tests use these attributes.

    This patch fixes this.

    These tests have been tested against the IR verifier changes in D68233.

    Reviewed by: andrew.w.kaylor, cameron.mcinally, uweigand
    Approved by: andrew.w.kaylor
    Differential Revision: https://reviews.llvm.org/D67925 — kpn / ViewSVN
  38. [utils] Fix incompatibility of bisect[-skip-count] with Python 3

    Summary:
    This change replaces the print statements with print function calls
    and also replaces the '/' operator (which is integer division in Py2,
    but becomes floating point division in Py3) with the '//' operator
    which has the same semantics in Py2 and Py3.

    Reviewers: greened, michaelplatings, gottesmm

    Reviewed By: greened

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68138 — miyuki / ViewSVN
  39. [OPENMP50]Suppport for multiple vendors in the same vendor context
    selector.

    According to OpenMP 5.0, multiple vendors could be specified in the
    vendor context selector via ',' as a separator. — abataev / ViewSVN
  40. [NFC] [FileCheck] Reapply fix init of objects in unit tests

    Summary:
    Fix initialization style of objects allocated on the stack and member
    objects in unit test to use the "Type Var(init list)" and
    "Type Member{init list}" convention. The latter fixes the buildbot
    breakage.

    Reviewers: jhenderson, probinson, arichardson, grimar, jdenny

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68425 — thopre / ViewSVN
  41. [scudo][standalone] Make malloc_info return a minimal XML

    Summary:
    Initially, our malloc_info was returning ENOTSUP, but Android would
    rather have it return successfully and write a barebone XML to the
    stream, so we will oblige.

    Add an associated test.

    Reviewers: cferris, morehouse, hctim, eugenis, vitalybuka

    Reviewed By: morehouse

    Subscribers: delcypher, #sanitizers, llvm-commits

    Tags: #llvm, #sanitizers

    Differential Revision: https://reviews.llvm.org/D68427 — cryptoad / ViewSVN
  42. SemaDeclAttr - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  43. CGBlocks - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  44. [clang-format] C++11 braced lists should respect the SpacesInParentheses setting

    Summary:
    According to the clang-format documentation, "Fundamentally, C++11 braced lists are formatted exactly like function calls would be formatted in their place. If the braced list follows a name (e.g. a type or variable name), clang-format formats as if the `{}` were the parentheses of a function call with that name."

    This patch furthers the treatment of C++11 braced list braces as parentheses by respecting the `SpacesInParentheses` setting.

    Reviewers: MyDeveloperDay, reuk, owenpan

    Reviewed By: MyDeveloperDay

    Subscribers: cfe-commits

    Tags: #clang-format, #clang

    Patch By: mitchell-stellar

    Differential Revision: https://reviews.llvm.org/D68415 — paulhoad / ViewSVN
  45. [clang-format] [PR43531] clang-format damages "alternative representations" for operators

    Summary:
    https://bugs.llvm.org/show_bug.cgi?id=43531

    Fix for clang-format incorrectly handles "alternative operators" as described by https://en.cppreference.com/w/cpp/language/operator_alternative

    compl = ~
    not = !

    these are unary operators, and clang-format will remove the space between them and a numeric constant

    this incorrectly formats the following code

    ```
    int a compl 5;
    int a not 5;
    ```

    into:

    ```
    int a compl5;
    int a not5;
    ```

    The code adds FIXME unit tests for "alternative token" representations for {} [] and # as defined by the same link, which would require a more detailed change to the FormatTokenLexer

    Reviewers: klimek, reuk, owenpan, mitchell-stellar, STL_MSFT

    Reviewed By: mitchell-stellar

    Subscribers: cfe-commits

    Tags: #clang-format, #clang-tools-extra, #clang

    Differential Revision: https://reviews.llvm.org/D68332 — paulhoad / ViewSVN
  46. Further improve -Wbool-operation bitwise negation message — sammccall / ViewSVN
  47. [clang-rename] Fix a crash when renaming a class without definition.

    Reviewers: sammccall

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68459 — hokein / ViewSVN
  48. [clang-format] [PR42417] clang-format inserts a space after '->' for operator->() overloading

    Summary:
    https://bugs.llvm.org/show_bug.cgi?id=42417

    This revision removes the extra space between the opertor-> and the parens ()

    ```
    class Bug {
        auto operator-> () -> int*;
        auto operator++(int) -> int;
    };
    ```

    Reviewers: klimek, owenpan, byoungyoung, mitchell-stellar

    Reviewed By: mitchell-stellar

    Subscribers: cfe-commits

    Tags: #clang-format, #clang

    Differential Revision: https://reviews.llvm.org/D68242 — paulhoad / ViewSVN
  49. [AMDGPU][MC][GFX10][WS32] Corrected decoding of dst operand for v_cmp_*_sdwa opcodes

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

    Reviewers: arsenm, rampitec

    Differential Revision: https://reviews.llvm.org/D68349 — dpreobra / ViewSVN
  50. [clang] Prevent false positives in arm-mfpu-none codegen test.

    A user pointed out to me in private email that this test will fail if
    it sees the letter 's' followed by a digit in any part of clang's
    assembly output after the function label. That includes the .ident at
    the end, which can include a full pathname or hostname or both from
    the system clang was built on. So if that path or hostname includes
    any text like 's5' then it will cause the test to fail.

    Fixed by adding a check for `.fnend`, to limit the scope of the
    `CHECK-NOT` to only the actual generated code for the test function.

    (Committed without prior review on the basis that it's a simple and
    obvious pure test-suite fix and also in a test I contributed myself.) — statham / ViewSVN
  51. [NFCI] Improve the -Wbool-operation's warning message

    Based on the request from the post commit review. Also added one new test. — xbolva00 / ViewSVN
  52. Fix uninitialized variable warnings in directory_entry default constructor. NFCI — rksimon / ViewSVN
  53. Fix MSVC "not all control paths return a value" warning. NFCI. — rksimon / ViewSVN
  54. [AMDGPU][MC][GFX10] Enabled decoding of 'null' operand

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

    Reviewers: arsenm, rampitec

    Differential Revision: https://reviews.llvm.org/D68348 — dpreobra / ViewSVN
  55. [clangd] update the package-lock.json. — hokein / ViewSVN
  56. ARM-Darwin: keep the frame register reserved even if not updated.

    Darwin platforms need the frame register to always point at a valid record even
    if it's not updated in a leaf function. Backtraces are more important than one
    extra GPR. — Tim Northover / ViewSVN
  57. [llvm-ar][test] Clarified comment

    The test is dependant on the installation of the en_US.UTF-8
    locale. The reasoning for this is clarified in the amended comment. — gbreynoo / ViewSVN
  58. [AMDGPU][MC][GFX10] Corrected definition of FLAT GLOBAL/SCRATCH instructions

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

    Reviewers: arsenm, rampitec

    Differential Revision: https://reviews.llvm.org/D68347 — dpreobra / ViewSVN
  59. [llvm-readobj] Remove redundant semicolon. NFC — atanasyan / ViewSVN
  60. [llvm-readobj][mips] Inline `printMipsPLTGOT` method — atanasyan / ViewSVN
  61. [llvm-readobj][mips] Implement GNU-style printing of .MIPS.abiflags section

    In this patch `llvm-readobj` prints ASEs flags on a single line
    separated by a comma. GNU `readelf` prints each ASEs flag on
    a separate line. It will be fixed later. — atanasyan / ViewSVN
  62. [llvm-readobj] Replace arch-specific ObjDumper methods by the single `printArchSpecificInfo`

    Initially llvm-readobj supports multiple command line options like
    `--arm-attributes` and `--mips-plt-got` for display ELF arch-specific
    information. Now all these options are superseded by the
    `--arch-specific` one. It makes sense to have a single `printArchSpecificInfo`
    method in the base `ObjDumper`, and hide all ELF/target specific details
    in the `ELFDumper::printArchSpecificInfo` override.

    Differential Revision: https://reviews.llvm.org/D68385 — atanasyan / ViewSVN
  63. Fix MSVC "not all control paths return a value" warning. NFCI. — rksimon / ViewSVN
  64. Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI. — rksimon / ViewSVN
  65. Revert [test] Remove locale dependency for mri-utf8.test

    This reverts r373700 (git commit b455ebf921c5c940c2366bec226959e3a4127fee) — gbreynoo / ViewSVN
  66. [DebugInfo] LiveDebugValues: move DBG_VALUE creation into VarLoc class

    Rather than having a mixture of location-state shared between DBG_VALUEs
    and VarLoc objects in LiveDebugValues, this patch makes VarLoc the
    master record of variable locations. The refactoring means that the
    transfer of locations from one place to another is always a performed by
    an operation on an existing VarLoc, that produces another transferred
    VarLoc. DBG_VALUEs are only created at the end of LiveDebugValues, once
    all locations are known. As a plus, there is now only one method where
    DBG_VALUEs can be created.

    The test case added covers a circumstance that is now impossible to
    express in LiveDebugValues: if an already-indirect DBG_VALUE is spilt,
    previously it would have been restored-from-spill as a direct DBG_VALUE.
    We now don't lose this information along the way, as VarLocs always
    refer back to the "original" non-transfer DBG_VALUE, and we can always
    work out whether a location was "originally" indirect.

    Differential Revision: https://reviews.llvm.org/D67398 — jmorse / ViewSVN
  67. gn build: (manually) merge r373718 — nico / ViewSVN
  68. [Format] Fix docs after r373439 — sammccall / ViewSVN
  69. Revert "[NFC] [FileCheck] Fix init of stack objects in unit tests"

    This reverts commit r373717. It broke the build:
    http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18721. — gribozavr / ViewSVN
  70. [DebugInfo] LiveDebugValues: defer DBG_VALUE creation during analysis

    When transfering variable locations from one place to another,
    LiveDebugValues immediately creates a DBG_VALUE representing that
    transfer. This causes trouble if the variable location should
    subsequently be invalidated by a loop back-edge, such as in the added
    test case: the transfer DBG_VALUE from a now-invalid location is used
    as proof that the variable location is correct. This is effectively a
    self-fulfilling prophesy.

    To avoid this, defer the insertion of transfer DBG_VALUEs until after
    analysis has completed. Some of those transfers are still sketchy, but
    we don't propagate them into other blocks now.

    Differential Revision: https://reviews.llvm.org/D67393 — jmorse / ViewSVN
  71. [TableGen] Introduce a generic automaton (DFA) backend

    Summary:
    This patch introduces -gen-automata, a backend for generating deterministic finite-state automata.

    DFAs are already generated by the -gen-dfa-packetizer backend. This backend is more generic and will
    hopefully be used to implement the DFA generation (and determinization) for the packetizer in the
    future.

    This backend allows not only generation of a DFA from an NFA (nondeterministic finite-state
    automaton), it also emits sidetables that allow a path through the DFA under a sequence of inputs to
    be analyzed, and the equivalent set of all possible NFA transitions extracted.

    This allows a user to not just answer "can my problem be solved?" but also "what is the
    solution?". Clearly this analysis is more expensive than just playing a DFA forwards so is
    opt-in. The DFAPacketizer has this behaviour already but this is a more compact and generic
    representation.

    Examples are bundled in unittests/TableGen/Automata.td. Some are trivial, but the BinPacking example
    is a stripped-down version of the original target problem I set out to solve, where we pack values
    (actually immediates) into bins (an immediate pool in a VLIW bundle) subject to a set of esoteric
    constraints.

    Reviewers: t.p.northover

    Subscribers: mgorny, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67968 — jamesm / ViewSVN
  72. [NFC] [FileCheck] Fix init of stack objects in unit tests

    Summary:
    Fix initialization style of objects allocated on the stack in unit test
    to use the "Type Var(init list)" convention.

    Reviewers: jhenderson, probinson, arichardson, grimar, jdenny

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68425 — thopre / ViewSVN
  73. AMDGPU/GlobalISel: Fix using wrong addrspace for aperture

    This was always passing the destination flat address space, when it
    should be picking between the two valid source options. — arsenm / ViewSVN
  74. AMDGPU/GlobalISel: Select G_PTRTOINT — arsenm / ViewSVN
  75. AMDGPU/GlobalISel: Support wave32 waterfall loops — arsenm / ViewSVN
  76. [Driver] NFC: Remove duplicate call to getLibGccType

    Reviewed By: saugustine

    Differential Revision: https://reviews.llvm.org/D68380 — c-rhodes / ViewSVN
  77. [lldb][modern-type-lookup] No longer import temporary declarations into the persistent AST

    Summary:
    As we figured out in D67803, importing declarations from a temporary ASTContext that were originally from a persistent ASTContext
    causes a bunch of duplicated declarations where we end up having declarations in the target AST that have no associated ASTImporter that
    can complete them.

    I haven't figured out how/if we can solve this in the current way we do things in LLDB, but in the modern-type-lookup this is solvable
    as we have a saner architecture with the ExternalASTMerger. As we can (hopefully) make modern-type-lookup the default mode in the future,
    I would say we try fixing this issue here. As we don't use the hack that was reinstated in D67803 during modern-type-lookup, the test case for this
    is essentially just printing any kind of container in `std::` as we would otherwise run into the issue that required a hack like D67803.

    What this patch is doing in essence is that instead of importing a declaration from a temporary ASTContext, we instead check if the
    declaration originally came from a persistent ASTContext (e.g. the debug information) and we directly import from there. The ExternalASTMerger
    is already connected with ASTImporters to these different sources, so this patch is essentially just two parts:
    1. Mark our temporary ASTContext/ImporterSource as temporary when we import from the expression AST.
    2. If the ExternalASTMerger sees we import from the expression AST, instead of trying to import these temporary declarations, check if we
    can instead import from the persistent ASTContext that is already connected. This ensures that all records from the persistent source actually
    come from the persistent source and are minimally imported in a way that allows them to be completed later on in the target AST.

    The next step is to run the ASTImporter for these temporary expressions with the MinimalImport mode disabled, but that's a follow up patch.

    This patch fixes most test failures with modern-type-lookup enabled by default (down to 73 failing tests, which includes the 22 import-std-module tests
    which need special treatment).

    Reviewers: shafik, martong

    Reviewed By: martong

    Subscribers: aprantl, rnkovacs, christof, abidh, JDevlieghere, lldb-commits

    Tags: #lldb

    Differential Revision: https://reviews.llvm.org/D68326 — Raphael Isemann / ViewSVN
  78. [CodeComplete] Ensure object is the same in compareOverloads()

    Summary:
    This fixes a regression that led to size() not being available in clangd
    when completing 'deque().^' and using libc++.

    Reviewers: sammccall

    Reviewed By: sammccall

    Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68335 — ibiryukov / ViewSVN
  79. [clang-format] [PR43338] C# clang format has space issues betweern C# only keywords

    Summary:
    When formatting C# there can be issues with a lack of spaces between `using (` , `foreach (` and generic types

    The C# code

    ```
    public class Foo
    {
        Dictionary<string,string> foo;
    }

    ```
    will be formatted as

    ```
    public class Foo
    {
        Dictionary<string, string>foo;
                               ^^^^^   missing a space
    }
    ```

    This revision also reverts some of {D66662} in order to make this cleaner and resolve an issues seen by @owenpan that the formatting didn't add a space when not in a code block

    This also transforms C# foreach commands to be seen as tok::kw_for commands (to ensure foreach gets the same Brace Wrapping behavior as for without littering the code with `if(Style.isCSharp())`

    Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

    Reviewed By: mitchell-stellar

    Subscribers: cfe-commits

    Tags: #clang, #clang-format

    Differential Revision: https://reviews.llvm.org/D67660 — paulhoad / ViewSVN
  80. [clang-format] [PR43333] Fix C# breaking before function name when using Attributes

    Summary:
    This is  a fix for https://bugs.llvm.org/show_bug.cgi?id=43333

    This comes with 3 main parts

      - C# attributes cause function names on a new line even when AlwaysBreakAfterReturnType is set to None
      - Add AlwaysBreakAfterReturnType  to None by default in the Microsoft style,
      - C# unit tests are not using Microsoft style (which we created to define the default C# style to match a vanilla C# project).

    Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

    Reviewed By: mitchell-stellar

    Subscribers: cfe-commits

    Tags: #clang-tools-extra, #clang, #clang-format

    Differential Revision: https://reviews.llvm.org/D67629 — paulhoad / ViewSVN
  81. [X86] Enable inline memcmp() to use AVX512 — davezarzycki / ViewSVN
  82. [compiler-rt] Remove O1 tests from signal_line.cpp

    It does not work on arm — Vitaly Buka / ViewSVN
  83. Revert "[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC."

    This reverts SVN r373698, as it broke sanitizer tests, e.g. in
    http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52441. — mstorsjo / ViewSVN
  84. [test] Remove locale dependency for mri-utf8.test

    Summary:
    llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be
    installed for its last RUN line to work. If not installed, the unicode
    string gets encoded (interpreted) as ascii which fails since the most
    significant byte is non zero. This commit changes the call to open to
    use a binary literal of the UTF-8 encoding for the pound sign instead,
    thus bypassing the encoding step.

    Note that the echo to create the <pound sign>.txt file will work
    regardless of the locale because both the shell and the echo (in case
    it's not a builtin of the shell concerned) only care about ascii
    character to operate. Indeed, the mri-utf8.test file (and in particular
    the pound sign) is encoded in UTF-8 and UTF-8 guarantees only ascii
    characters can create bytes that can be interpreted as ascii characters
    (i.e. bytes with the most significant bit null).

    So the process to break down the filename in the line goes something
    along:
    - find an ascii chevron '>'
    - find beginning of the filename by removing ascii space-like characters
    - find ascii newline character indicating the end of the redirection (no
      semicolon ';', closing curly bracket '}' or parenthesis ')' or the
      like
    - create a file whose name is made of all the bytes in between beginning
      and end of filename *without interpretting them*

    Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68418 — thopre / ViewSVN
  85. [AMDGPU][SILoadStoreOptimizer] NFC: Refactor code

    Summary:
    This patch fixes a potential aliasing problem in InstClassEnum,
    where local values were mixed with machine opcodes.

    Introducing InstSubclass will keep them separate and help extending
    InstClassEnum with other instruction types (e.g. MIMG) in the future.

    This patch also makes getSubRegIdxs() more concise.

    Reviewers: nhaehnle, arsenm, tstellar

    Reviewed By: arsenm

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68384 — Piotr Sobczak / ViewSVN
  86. [Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC.

    This allows making a couple llvm-symbolizer tests run in all
    environments.

    Differential Revision: https://reviews.llvm.org/D68133 — mstorsjo / ViewSVN
  87. [test] Remove a needless declaration of REQUIRES: target-windows

    This test only relies on running on a case insensitive file system,
    the exact target triple of the toolchain shouldn't matter.

    Differential Revision: https://reviews.llvm.org/D68136 — mstorsjo / ViewSVN
  88. [JITLink] Remove a redundant semicolon, silencing -Wpedantic warnings with GCC. NFC. — mstorsjo / ViewSVN
  89. [clang] [cmake] Add distribution install targets for remaining components

    Add install targets as necessary to install bash-autocomplete,
    scan-build and scan-view via LLVM_DISTRIBUTION_TARGETS.

    Differential Revision: https://reviews.llvm.org/D68413 — mgorny / ViewSVN
  90. [clang-tools-extra] [cmake] Use add_clang_tool() to install tools

    Replace add_clang_executable() calls with add_clang_tool() that takes
    care of creating correct, distribution-friendly install target.  While
    at it, remove redundant install calls.

    This change also causes clang-move and pp-trace to be installed.

    Differential Revision: https://reviews.llvm.org/D68423 — mgorny / ViewSVN
  91. [JITLink] Explicitly destroy bumpptr-allocated blocks to avoid a memory leak. — Lang Hames / ViewSVN
  92. [JITLink] Fix an unused variable warning. — Lang Hames / ViewSVN
  93. Make libc++ gdb pretty printer Python 3 compatible — maskray / ViewSVN
  94. gn build: Merge r373689 — gnsyncbot / ViewSVN
  95. [JITLink] Switch from an atom-based model to a "blocks and symbols" model.

    In the Atom model the symbols, content and relocations of a relocatable object
    file are represented as a graph of atoms, where each Atom represents a
    contiguous block of content with a single name (or no name at all if the
    content is anonymous), and where edges between Atoms represent relocations.
    If more than one symbol is associated with a contiguous block of content then
    the content is broken into multiple atoms and layout constraints (represented by
    edges) are introduced to ensure that the content remains effectively contiguous.
    These layout constraints must be kept in mind when examining the content
    associated with a symbol (it may be spread over multiple atoms) or when applying
    certain relocation types (e.g. MachO subtractors).

    This patch replaces the Atom model in JITLink with a blocks-and-symbols model.
    The blocks-and-symbols model represents relocatable object files as bipartite
    graphs, with one set of nodes representing contiguous content (Blocks) and
    another representing named or anonymous locations (Symbols) within a Block.
    Relocations are represented as edges from Blocks to Symbols. This scheme
    removes layout constraints (simplifying handling of MachO alt-entry symbols,
    and hopefully ELF sections at some point in the future) and simplifies some
    relocation logic. — Lang Hames / ViewSVN
  96. [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore

    We would like to split the SP adjustment to reduce the instructions in
    prologue and epilogue as the following case. In this way, the offset of
    the callee saved register could fit in a single store.

        add     sp,sp,-2032
        sw      ra,2028(sp)
        sw      s0,2024(sp)
        sw      s1,2020(sp)
        sw      s3,2012(sp)
        sw      s4,2008(sp)
        add     sp,sp,-64

    Differential Revision: https://reviews.llvm.org/D68011 — shiva / ViewSVN
  97. Properly handle instantiation-dependent array bounds.

    We previously failed to treat an array with an instantiation-dependent
    but not value-dependent bound as being an instantiation-dependent type.
    We now track the array bound expression as part of a constant array type
    if it's an instantiation-dependent expression. — rsmith / ViewSVN
  98. [compiler-rt] Fix signal_line.cpp test

    r373682 committed wrong experimental version — Vitaly Buka / ViewSVN
  99. [dsymutil] Fix stack-use-after-scope

    The lambda is taking the stack-allocated Verify boolean by reference and
    it would go out of scope on the next iteration. Moving it out of the
    loop should fix the issue.

    Fixes https://bugs.llvm.org/show_bug.cgi?id=43549 — Jonas Devlieghere / ViewSVN
  100. [compiler-rt] Remove O2, O3 from signal_line test for fix android tests — Vitaly Buka / ViewSVN
  101. compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM

    Summary: Fixes https://github.com/google/oss-fuzz/issues/2836

    Reviewers: eugenis

    Subscribers: dberris, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68178 — Vitaly Buka / ViewSVN
  102. LowerTypeTests: Rename local functions to avoid collisions with identically named functions in ThinLTO modules.

    Without this we can encounter link errors or incorrect behaviour
    at runtime as a result of the wrong function being referenced.

    Differential Revision: https://reviews.llvm.org/D67945 — pcc / ViewSVN
  103. [llvm-objdump][test] Move test to X86 dir to avoid errors disassembling on non-x86 — rupprecht / ViewSVN
  104. [MemorySSA] Don't hoist stores if interfering uses (as calls) exist. — asbirlea / ViewSVN
  105. [OPENMP]Fix the test on Windows, NFC. — abataev / ViewSVN
  106. [llvm-objdump] Further rearrange llvm-objdump sections for compatability

    Summary:
    rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.

    I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
    * Archive headers
    * File headers
    * Section headers
    * Symbol table
    * Dwarf debugging
    * Relocations (if `--disassemble` is not used)
    * Section contents
    * Disassembly

    Reviewers: jhenderson, justice_adams, grimar, ychen, espindola

    Reviewed By: jhenderson

    Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68066 — rupprecht / ViewSVN
  107. ASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.

    We can also remove a number of explicit asserts and reply on the internal asserts in castAs<> — rksimon / ViewSVN
  108. [DAGCombiner] add operation legality checks before creating shift ops (PR43542)

    As discussed on llvm-dev and:
    https://bugs.llvm.org/show_bug.cgi?id=43542
    ...we have transforms that assume shift operations are legal and transforms to
    use them are profitable, but that may not hold for simple targets.

    In this case, the MSP430 target custom lowers shifts by repeating (many)
    simpler/fixed ops. That can be avoided by keeping this code as setcc/select.

    Differential Revision: https://reviews.llvm.org/D68397 — spatel / ViewSVN
  109. OverloadCandidate::getNumParams - silence static analyzer getAs<FunctionProtoType> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use castAs<FunctionProtoType> directly and if not assert will fire for us.

    Also replaces an auto to make the type more obvious. — rksimon / ViewSVN
  110. Reland r349624: Let TableGen write output only if it changed, instead of doing so in cmake

    Move the write-if-changed logic behind a flag and don't pass it
    with the MSVC generator. msbuild doesn't have a restat optimization,
    so not doing write-if-change there doesn't have a cost, and it
    should fix whatever causes PR43385. — nico / ViewSVN
  111. DebugInfo: Generalize rnglist emission as a precursor to reusing it for loclist emission — dblaikie / ViewSVN
  112. [OPENMP50]Codegen support for scores in context selectors.

    If the context selector has associated score and several contexts
    selectors matches current context, the function with the highest score
    must be selected. — abataev / ViewSVN
  113. gn build: (manually) merge 373651 better

    The reland uses a static library, not an object library.
    Doesn't really matter for the gn build, but it's probalby
    nice to have the same semantics for the target type. — nico / ViewSVN
  114. [Tests] Add a unordered atomic load combine test — reames / ViewSVN
  115. [Test] Fix inconsistency in alignment in test case

    The IR was using a fixed 8 byte alignment, but the MIR portion was using native alignment.  Since the test doesn't appear to be deliberately testing overalignment, just make the IR match the MIR. — reames / ViewSVN
  116. [AArch64][SVE] Move the testcase into CodeGen dir

    https://reviews.llvm.org/rL373600 added an AArch64 testcase in top dir
    which should be moved to Codegen dir. — jsji / ViewSVN
  117. [AArch64InstPrinter] prefer bfi to bfc for < armv8.2-a

    Summary:
    Fixes pr/42576.

    Link: https://github.com/ClangBuiltLinux/linux/issues/697

    Reviewers: t.p.northover

    Reviewed By: t.p.northover

    Subscribers: kristof.beyls, hiraditya, llvm-commits, srhines

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68356 — nickdesaulniers / ViewSVN
  118. Reland "gn build: (manually) merge r373551"

    373551 relanded in 373651. — nico / ViewSVN
  119. Attempt to remove linker workaround on the buildbots: Attempt 2

    The first commit removed the workaround in a old script.
    This patch removes it in the file actually used by the bots.

    I have no idea if this is still needed, but removing the
    workaround seems like the easiest way to test.

    I'll revert this change if the bots go red. — ericwf / ViewSVN
  120. [PowerPC] Adjust the naming and operand order of fnmsub patterns

    Summary:
    This is follow up patch of https://reviews.llvm.org/D67595.
    Adjust naming and the Commutable operands for additional patterns
    to make it easier to read.

    The testcase update also show that we can save some unecessary fmr as
    well.

    Reviewers: #powerpc, steven.zhang, hfinkel, nemanjai

    Reviewed By: #powerpc, nemanjai

    Subscribers: wuzish, hiraditya, kbarton, MaskRay, shchenz, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68112 — jsji / ViewSVN
  121. [gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion

    Summary:
    This will handle expansion of C++ fragments in the declarative combiner
    including custom predicates, and escapes into C++ to aid the migration
    effort.

    Fixed the -DLLVM_LINK_LLVM_DYLIB=ON using DISABLE_LLVM_LINK_LLVM_DYLIB when
    creating the library. Apparently it automatically links to libLLVM.dylib
    and we don't want that from tablegen.

    Reviewers: bogner, volkan

    Subscribers: mgorny, llvm-commits

    Tags: #llvm

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

    llvm-svn: 373551 — dsanders / ViewSVN
  122. Attempt to remove linker workaround on the buildbots.

    I have no idea if this is still needed, but removing the
    workaround seems like the easiest way to test.

    I'll revert this change if the bots go red. — ericwf / ViewSVN
  123. [HIP] Use option -nogpulib to disable linking device lib

    Differential Revision: https://reviews.llvm.org/D68300 — yaxunl / ViewSVN
  124. Check for qualified function types after substituting into the operand
    of 'typeid'.

    This is a rare place where it's valid for a function type to be
    substituted but not valid for a qualified function type to be
    substituted, so needs a special check. — rsmith / ViewSVN
  125. [clang-format] Add ability to wrap braces after multi-line control statements

    Summary:
    Change the BraceWrappingFlags' AfterControlStatement from a bool to an enum with three values:

    * "Never": This is the default, and does not do any brace wrapping after control statements.
    * "MultiLine": This only wraps braces after multi-line control statements (this really only happens when a ColumnLimit is specified).
    * "Always": This always wraps braces after control statements.

    The first and last options are backwards-compatible with "false" and "true", respectively.

    The new "MultiLine" option is useful for when a wrapped control statement's indentation matches the subsequent block's indentation. It makes it easier to see at a glance where the control statement ends and where the block's code begins. For example:

    ```
    if (
      foo
      && bar )
    {
      baz();
    }
    ```

    vs.

    ```
    if (
      foo
      && bar ) {
      baz();
    }
    ```

    Short control statements (1 line) do not wrap the brace to the next line, e.g.

    ```
    if (foo) {
      bar();
    } else {
      baz();
    }
    ```

    Reviewers: sammccall, owenpan, reuk, MyDeveloperDay, klimek

    Reviewed By: MyDeveloperDay

    Subscribers: MyDeveloperDay, cfe-commits

    Patch By: mitchell-stellar

    Tags: #clang-format, #clang, #clang-tools-extra

    Differential Revision: https://reviews.llvm.org/D68296 — paulhoad / ViewSVN
  126. [NFC] Fix unused variable in release builds — rupprecht / ViewSVN
  127. [X86] Add v32i8 shuffle lowering strategy to recognize two v4i64 vectors truncated to v4i8 and concatenated into the lower 8 bytes with undef/zero upper bytes.

    This patch recognizes the shuffle pattern we get from a
    v8i64->v8i8 truncate when v8i64 isn't a legal type.

    With VLX we can use two VTRUNCs, unpckldq, and a insert_subvector.

    Diffrential Revision: https://reviews.llvm.org/D68374 — ctopper / ViewSVN
  128. PR43547: substitute into the type of a non-type template parameter if
    it's instantiation-dependent, even if it's not dependent.

    There might be a SFINAE check in the parameter type. — rsmith / ViewSVN
  129. [compiler-rt] More optimization levels in signal_line.cpp test — Vitaly Buka / ViewSVN
  130. [X86] matchShuffleWithSHUFPD - use Zeroable element mask directly. NFCI.

    We can make use of the Zeroable mask to indicate which elements we can safely set to zero instead of creating a target shuffle mask on the fly.

    This only leaves one user of createTargetShuffleMask which we can hopefully get rid of in a similar manner.

    This is part of the work to fix PR43024 and allow us to use SimplifyDemandedElts to simplify shuffle chains - we need to get to a point where the target shuffle masks isn't adjusted by its source inputs in setTargetShuffleZeroElements but instead we cache them in a parallel Zeroable mask. — rksimon / ViewSVN
  131. [dsymutil] Don't overload LinkOptions.

    This should fix the build bots:

      error: declaration of ‘llvm::dsymutil::LinkOptions
      DsymutilOptions::LinkOptions’ [-fpermissive] — Jonas Devlieghere / ViewSVN
  132. AMDGPU/GlobalISel: Handle RegBankSelect of G_INSERT_VECTOR_ELT — arsenm / ViewSVN
  133. AMDGPU/GlobalISel: Split 64-bit vector extracts during RegBankSelect

    Register indexing 64-bit elements is possible on the SALU, but not the
    VALU. Handle splitting this into two 32-bit indexes. Extend waterfall
    loop handling to allow moving a range of instructions. — arsenm / ViewSVN
  134. AMDGPU/GlobalISel: Allow VGPR to index SGPR register

    We can still do a waterfall loop over the index if using a VGPR to
    index an SGPR. The result will still be a VGPR, but we can avoid the
    wide copy of the source register to a VGPR. — arsenm / ViewSVN
  135. AMDGPU/GlobalISel: Add some more tests for G_INSERT legalization — arsenm / ViewSVN
  136. AMDGPU/GlobalISel: Fix mutationIsSane assert v8s8 and

    This would try to do FewerElements to v9s8 — arsenm / ViewSVN
  137. [HIP] Enable specifying different default gpu arch for HIP/CUDA.

    Reviewers: tra, yaxunl

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68394 — hliao / ViewSVN
  138. Fix build failure with GCC on identifier reusing.

    - GCC is different from clang and other compilers on that.
      https://godbolt.org/z/CeQE1V — hliao / ViewSVN
  139. compiler-rt: move all __GLIBC_PREREQ into own header file

    Reviewers: eugenis

    Subscribers: dberris, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68177 — Vitaly Buka / ViewSVN
  140. [libc++] Add a per-target flag to include the generated config_site

    This allows propagating the include automatically to targets that
    depend on one of the libc++ targets such as the benchmarks. Note
    that the GoogleBenchmark build itself still needs to manually specify
    the -include, since I don't know of any way to have an external project
    link against one of the libc++ targets (which would propagate the -include
    automatically). — Louis Dionne / ViewSVN
  141. AMDGPU/SILoadStoreOptimizer: Optimize scanning for mergeable instructions

    Summary:
    This adds a pre-pass to this optimization that scans through the basic
    block and generates lists of mergeable instructions with one list per unique
    address.

    In the optimization phase instead of scanning through the basic block for mergeable
    instructions, we now iterate over the lists generated by the pre-pass.

    The decision to re-optimize a block is now made per list, so if we fail to merge any
    instructions with the same address, then we do not attempt to optimize them in
    future passes over the block.  This will help to reduce the time this pass
    spends re-optimizing instructions.

    In one pathological test case, this change reduces the time spent in the
    SILoadStoreOptimizer from 0.2s to 0.03s.

    This restructuring will also make it possible to implement further solutions in
    this pass, because we can now add less expensive checks to the pre-pass and
    filter instructions out early which will avoid the need to do the expensive
    scanning during the optimization pass. For example, checking for adjacent
    offsets is an inexpensive test we can move to the pre-pass.

    Reviewers: arsenm, pendingchaos, rampitec, nhaehnle, vpykhtin

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D65961 — tstellar / ViewSVN
  142. [ModuloSchedule] removeBranch() *before* creating the trip count condition

    The Hexagon code assumes there's no existing terminator when inserting its
    trip count condition check.

    This causes swp-stages5.ll to break. The generated code looks good to me,
    it is likely a permutation. I have disabled the new codegen path to keep
    everything green and will investigate along with the other 3-4 tests
    that have different codegen.

    Fixes expensive-checks build. — jamesm / ViewSVN
  143. gn build: (manually) merge r373622 — nico / ViewSVN
  144. DeclBase/DeclCXX/DeclTemplate - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  145. [libc++] Add missing revision number in ABI changelog — Louis Dionne / ViewSVN
  146. [OPENMP]Fix emission of the declare target variables in device mode.

    Declare target variables must be emitted in device mode, target triples
    can be empty in this case. — abataev / ViewSVN
  147. [dsymutil] Improve consistency by removing redundant namespaces (NFC)

    The dsymutil implementation file has a using-directive for the llvm
    namespace. This patch just removes redundant namespace qualifiers. — Jonas Devlieghere / ViewSVN
  148. [dsymutil] Tablegenify option parsing

    This patch reimplements command line option parsing in dsymutil with
    Tablegen and libOption. The main motivation for this change is to
    prevent clashes with other cl::opt options defined in llvm. Although
    it's a bit more heavyweight, it has some nice advantages such as no
    global static initializers and better separation between the code and
    the option definitions.

    I also used this opportunity to improve how dsymutil deals with
    incompatible options. Instead of having checks spread across the code,
    everything is now grouped together in verifyOptions. The fact that the
    options are no longer global means that we need to pass them around a
    bit more, but I think it's worth the trade-off.

    Differential revision: https://reviews.llvm.org/D68361 — Jonas Devlieghere / ViewSVN
  149. [BPF] Handle offset reloc endpoint ending in the middle of chain properly

    During studying support for bitfield, I found an issue for
    an example like the one in test offset-reloc-middle-chain.ll.
      struct t1 { int c; };
      struct s1 { struct t1 b; };
      struct r1 { struct s1 a; };
      #define _(x) __builtin_preserve_access_index(x)
      void test1(void *p1, void *p2, void *p3);
      void test(struct r1 *arg) {
        struct s1 *ps = _(&arg->a);
        struct t1 *pt = _(&arg->a.b);
        int *pi = _(&arg->a.b.c);
        test1(ps, pt, pi);
      }

    The IR looks like:
      %0 = llvm.preserve.struct.access(base, ...)
      %1 = llvm.preserve.struct.access(%0, ...)
      %2 = llvm.preserve.struct.access(%1, ...)
      using %0, %1 and %2

    In this case, we need to generate three relocatiions
    corresponding to chains: (%0), (%0, %1) and (%0, %1, %2).
    After collecting all the chains, the current implementation
    process each chain (in a map) with code generation sequentially.
    For example, after (%0) is processed, the code may look like:
      %0 = base + special_global_variable
      // llvm.preserve.struct.access(base, ...) is delisted
      // from the instruction stream.
      %1 = llvm.preserve.struct.access(%0, ...)
      %2 = llvm.preserve.struct.access(%1, ...)
      using %0, %1 and %2

    When processing chain (%0, %1), the current implementation
    tries to visit intrinsic llvm.preserve.struct.access(base, ...)
    to get some of its properties and this caused segfault.

    This patch fixed the issue by remembering all necessary
    information (kind, metadata, access_index, base) during
    analysis phase, so in code generation phase there is
    no need to examine the intrinsic call instructions.
    This also simplifies the code.

    Differential Revision: https://reviews.llvm.org/D68389 — yhs / ViewSVN
  150. [OPENMP]Improve diagnostics for not found declare target entries.

    We can point to the target region + emit parent functions names/real var
    names if they were not found in host module during device codegen. — abataev / ViewSVN
  151. Revert "[Alignment][NFC] Allow constexpr Align"

    This reverts commit b3af236fb5fc6e50fcc1b54d868f0bff557f3fb1. — gchatelet / ViewSVN
  152. [RISCV] Add obsolete aliases of fscsr, frcsr (fssr, frsr)

    These old aliases were renamed, but are still used by some projects (eg newlib).

    Differential Revision: https://reviews.llvm.org/D68392 — edjones / ViewSVN
  153. [NFC] Added missing changes for rL373614 — xbolva00 / ViewSVN
  154. [Diagnostics] Bitwise negation of a boolean expr always evaluates to true; warn with -Wbool-operation

    Requested here:
    http://lists.llvm.org/pipermail/cfe-dev/2019-October/063452.html — xbolva00 / ViewSVN
  155. Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI. — rksimon / ViewSVN
  156. ExprConstant - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  157. Remove duplicate P->getAs<PointerType>() call. NFCI. — rksimon / ViewSVN
  158. [yaml2obj] - Add a Size tag support for SHT_LLVM_ADDRSIG sections.

    It allows using "Size" with or without "Content" in YAML descriptions of
    SHT_LLVM_ADDRSIG sections.

    Differential revision: https://reviews.llvm.org/D68334 — grimar / ViewSVN
  159. Test commit. — sgundapa / ViewSVN
  160. [MSP430] add tests for unwanted shift codegen; NFC (PR43542) — spatel / ViewSVN
  161. Recommit r373598 "[yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDRSIG sections."

    Fix: call `consumeError()` for a case missed.

    Original commit message:

    SHT_LLVM_ADDRSIG is described here:
    https://llvm.org/docs/Extensions.html#sht-llvm-addrsig-section-address-significance-table

    This patch teaches tools to dump them and to parse the YAML declarations of such sections.

    Differential revision: https://reviews.llvm.org/D68333 — grimar / ViewSVN
  162. [UpdateTestChecks] add basic support for parsing msp430 asm — spatel / ViewSVN
  163. gn build: Merge r373601 — gnsyncbot / ViewSVN
  164. [PGO] Refactor Value Profiling into a plugin based oracle and create a well defined API for the plugins.

    Summary: This PR creates a utility class called ValueProfileCollector that tells PGOInstrumentationGen and PGOInstrumentationUse what to value-profile and where to attach the profile metadata. It then refactors logic scattered in PGOInstrumentation.cpp into two plugins that plug into the ValueProfileCollector.

    Authored By: Wael Yehia <wyehia@ca.ibm.com>

    Reviewer: davidxl, tejohnson, xur

    Reviewed By: davidxl, tejohnson, xur

    Subscribers: llvm-commits

    Tag: #llvm

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

    Patch By Wael Yehia <wyehia@ca.ibm.com> — bmahjour / ViewSVN
  165. [AArch64][SVE] Adding patterns for floating point SVE add instructions. — amehsan / ViewSVN
  166. Revert r373598 "[yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDRSIG sections."

    It broke BB:
    http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18655/steps/test/logs/stdio — grimar / ViewSVN
  167. [yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDRSIG sections.

    SHT_LLVM_ADDRSIG is described here:
    https://llvm.org/docs/Extensions.html#sht-llvm-addrsig-section-address-significance-table

    This patch teaches tools to dump them and to parse the YAML declarations of such sections.

    Differential revision: https://reviews.llvm.org/D68333 — grimar / ViewSVN
  168. [NFC][InstCombine] Some tests for sub-of-negatible pattern

    As we have previously estabilished, `sub` is an outcast,
    and should be considered non-canonical iff it can be converted to `add`.

    It can be converted to `add` if it's second operand can be negated.
    So far we mostly only do that for constants and negation itself,
    but we should be more through. — lebedevri / ViewSVN
  169. [llvm-locstats] Copy the script only when needed; NFC — djtodoro / ViewSVN
  170. [Alignment][NFC] Remove StoreInst::setAlignment(unsigned)

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet, bollu, jdoerfert

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

    Tags: #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D68268 — gchatelet / ViewSVN
  171. [llvm-readobj] - Stop using a precompiled binary in all.test

    Having a precompiled binary here is excessive.
    I also added a few missing tags.

    Differential revision: https://reviews.llvm.org/D68386 — grimar / ViewSVN
  172. [libTooling] Add various Stencil combinators for expressions.

    Summary:
    This revision adds three new Stencil combinators:
    * `expression`, which idiomatically constructs the source for an expression,
      including wrapping the expression's source in parentheses if needed.
    * `deref`, which constructs an idiomatic dereferencing expression.
    * `addressOf`, which constructs an idiomatic address-taking expression.

    Reviewers: gribozavr

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68315 — ymandel / ViewSVN
  173. [Alignment][Clang][NFC] Add CharUnits::getAsAlign

    Summary:
    This is a prerequisite to removing `llvm::GlobalObject::setAlignment(unsigned)`.
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: jholewinski, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68274 — gchatelet / ViewSVN
  174. [mips] Push `fixup_Mips_LO16` fixup for `jialc` and `jic` instructions — atanasyan / ViewSVN
  175. [llvm-readobj][mips] Remove non-standard --misp-xxx flags

    llvm-readobj "non-standard" flags `--mips-plt-got`, `--mips-abi-flags`,
    `--mips-reginfo`, and `--mips-options` are superseded by the `--arch-specific`
    flag and can be removed now. — atanasyan / ViewSVN
  176. [mips] Use llvm-readobj `-A` flag in test cases. NFC — atanasyan / ViewSVN
  177. [llvm-readobj][mips] Display MIPS specific info under --arch-specific flag

    Old options `--mips-plt-got`, `--mips-abi-flags`, '--mips-reginfo`,
    and `--mips-options` wiil be deleted in a separate patch. — atanasyan / ViewSVN
  178. [llvm-readobj][mips] Do not show an error if GOT is missed

    It is not an error if a file does not contain GOT. — atanasyan / ViewSVN
  179. gn build: Revert 373554 "gn build: (manually) merge r373551"

    r373551 was reverted in r373581. — nico / ViewSVN
  180. [AArch64] Static (de)allocation of SVE stack objects.

    Adds support to AArch64FrameLowering to allocate fixed-stack SVE objects.

    The focus of this patch is purely to allow the stack frame to
    allocate/deallocate space for scalable SVE objects. More dynamic
    allocation (at compile-time, i.e. determining placement of SVE objects
    on the stack), or resolving frame-index references that include
    scalable-sized offsets, are left for subsequent patches.

    SVE objects are allocated in the stack frame as a separate region below
    the callee-save area, and above the alignment gap. This is done so that
    the SVE objects can be accessed directly from the FP at (runtime)
    VL-based offsets to benefit from using the VL-scaled addressing modes.

    The layout looks as follows:

         +-------------+
         | stack arg   |  
         +-------------+
         | Callee Saves|
         |   X29, X30  |       (if available)
         |-------------| <- FP (if available)
         |     :       |  
         |  SVE area   |  
         |     :       |  
         +-------------+
         |/////////////| alignment gap.
         |     :       |  
         | Stack objs  |
         |     :       |  
         +-------------+ <- SP after call and frame-setup

    SVE and non-SVE stack objects are distinguished using different
    StackIDs. The offsets for objects with TargetStackID::SVEVector should be
    interpreted as purely scalable offsets within their respective SVE region.

    Reviewers: thegameg, rovka, t.p.northover, efriedma, rengolin, greened

    Reviewed By: efriedma

    Differential Revision: https://reviews.llvm.org/D61437 — s.desmalen / ViewSVN
  181. Silence static analyzer getAs<RecordType> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<RecordType> directly and if not assert will fire for us. — rksimon / ViewSVN
  182. Fix uninitialized variable warning. NFCI — rksimon / ViewSVN
  183. Fix uninitialized variable warning. NFCI — rksimon / ViewSVN
  184. Revert 373551 (CodeExpander.cpp CMake issue)

    Fix buildbots and revert the CodeExpander commit.

    (See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190930/699857.html ) — Kristina Brooks / ViewSVN
  185. [Alignment][NFC] Allow constexpr Align

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
    See this patch for the introduction of the type: https://reviews.llvm.org/D64790

    Reviewers: courbet

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68329 — gchatelet / ViewSVN
  186. Revert 373555: libLLVM+modules failure with CMake 3.10.2

    This reverts rL373555. I've sent an email out regarding the issue.

    Commit on GitHub:
    https://github.com/llvm/llvm-project/commit/45f682f47129c05414d4c5ae7be851772273978f — Kristina Brooks / ViewSVN
  187. [clang][NFC] Fix misspellings in ExternalASTMerger.h — Raphael Isemann / ViewSVN
  188. Update the FAQ: remove stuff related to the previous license +
    update info about the portability of LLVM. — sylvestre / ViewSVN
  189. [llvm-exegesis][NFC] Rename ExegesisTarget::decrementLoopCounterAndLoop()

    Summary: To decrementLoopCounterAndJump, and explicitely take the jump target.

    Reviewers: gchatelet

    Subscribers: tschuett, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68375 — courbet / ViewSVN
  190. Fix libc++ pretty printer test for Python 3 after D67238 (take 2)

    In both Python 2 and Python 3, gdb.Value.string returns a 'str'. We just
    need to delete a `encode("utf-8")` which would return a 'bytes' in
    Python 3. — maskray / ViewSVN
  191. [X86] Add test case for v8i64->v8i8 truncate with avx512 and prefer-vector-width/min-legal-vector-width=256. NFC

    With vpmovqb, we should be able to do better here until we get
    AVX512VBMI on Cannonlake/Icelake. — ctopper / ViewSVN
  192. AMDGPU/GlobalISel: Don't re-get subtarget

    It's already available in the class. — arsenm / ViewSVN
  193. AMDGPU/GlobalISel: Expand G_BITCAST legality — arsenm / ViewSVN
  194. [X86] Add DAG combine to turn (bitcast (vbroadcast_load)) into just a vbroadcast_load if the scalar size is the same.

    This improves broadcast load folding of i64 elements on 32-bit
    targets where i64 isn't legal.

    Previously we had to represent these as vXf64 vbroadcast_loads and
    a bitcast to vXi64. But we didn't have any isel patterns
    looking for that.

    This also allows us to remove or simplify some isel patterns that
    were looking for bitcasted vbroadcast_loads. — ctopper / ViewSVN
  195. Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`

    Some Driver tests relied on the default resource direcory having per-os per-arch
    subdirectory layout, and when clang is built with `-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON`,
    those test fail, because clang by default assumes per-target subdirectories.

    Explicitly set `-resource-dir` flag to point to a tree with per-os per-arch layout.

    See also: D45604, D62469

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

    Patch by Sergej Jaskiewicz <jaskiewiczs@icloud.com>. — sepavloff / ViewSVN
  196. [HIP] Support -emit-llvm for device compilation

    Sometimes it is useful to compile HIP device code to LLVM BC. It is not convenient to use clang -cc1 since
    there are lots of options needed.

    This patch allows clang driver to compile HIP device code to LLVM BC with -emit-llvm -c.

    Differential Revision: https://reviews.llvm.org/D68284 — yaxunl / ViewSVN
  197. [X86] Add broadcast load folding patterns to NoVLX VPMULLQ/VPMAXSQ/VPMAXUQ/VPMINSQ/VPMINUQ patterns.

    More fixes for PR36191. — ctopper / ViewSVN
  198. [X86] Remove a couple redundant isel patterns that look to have been copy/pasted from right above them. NFC — ctopper / ViewSVN

#5501 (Oct 2, 2019 7:59:31 PM)

  1. gn build: Merge r373556 — gnsyncbot / ViewSVN
  2. Revert 373538 and follow-ups 373549 and 373552.

    They break tests on (at least) macOS. — nico / ViewSVN
  3. [gicombiner] Make rL373551 compatible with older cmakes

    Newer cmakes appear to be more flexible w.r.t object libraries. Convert to
    a static library so that it works with older cmakes too — dsanders / ViewSVN
  4. gn build: (manually) merge r373551 — nico / ViewSVN
  5. PR43519: don't inject a diagnostic when constant-evaulation of a
    pointer-to-member call can't determine a callee.

    We will have produced a diagnostic already if the callee is known to be
    unevaluatable, and diagnosing here rejects valid code during potential
    constant expression checking. — rsmith / ViewSVN
  6. Fixing broken builds due to r373538, issues with filepath and hexagon toolchain.

    It appears there are some issues with the hexagon toolchain, and also the file
    path for the library file. If this doesn't fix the remaining breakages I will
    attempt a revert. — zer0 / ViewSVN
  7. [gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion

    Summary:
    This will handle expansion of C++ fragments in the declarative combiner
    including custom predicates, and escapes into C++ to aid the migration
    effort.

    Reviewers: bogner, volkan

    Subscribers: mgorny, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68288 — dsanders / ViewSVN
  8. gn build: Merge r373538 — gnsyncbot / ViewSVN
  9. Fixing broken builds due to r373538 due to test that should have been deleted.

    test/InterfaceStubs/object.cpp should have been deleted. — zer0 / ViewSVN
  10. Mark P0784R7 as complete and start defining its feature-test macro.

    Note that this only covers the language side of this feature. (The
    library side has its own feature test macro.) — rsmith / ViewSVN
  11. For P0784R7: support placement new-expressions in constant evaluation.

    For now, we restrict this support to use from within the standard
    library implementation, since we're required to make parts of the
    standard library that use placement new work, but not permitted to
    make uses of placement new from user code work. — rsmith / ViewSVN
  12. For P0784R7: allow direct calls to operator new / operator delete from
    std::allocator::{allocate,deallocate} in constant evaluation. — rsmith / ViewSVN
  13. [gicombiner] Fix windows issue where single quotes in the command are passed through to tablegen — dsanders / ViewSVN
  14. [AMDGPU] Fix illegal agpr use by VALU

    When SIFixSGPRCopies attempts to fix an illegal copy from vector to
    scalar register it calls moveToVALU(). A copy from an agpr to sgpr
    becomes a copy from agpr to agpr, which may result in the illegal
    register class at a use of this copy.

    Solution is to copy it always into a vgpr. This may result in a
    subsequent copy into an agpr if that is what really needed, however
    should not happen too often and likely will be folded later.

    The opposite situation may not happen because an sgpr is always
    illegal where agpr is legal, so such user instructions may not
    exist.

    Differential Revision: https://reviews.llvm.org/D68358 — rampitec / ViewSVN
  15. [gicombiner] Fix a nullptr dereference when -combiners is given a name that isn't defined

    This is unlikely to be the root cause for the windows bot failures but
    it would explain the stack trace seen. — dsanders / ViewSVN
  16. [InstCombine] Bypass high bit extract before variable sign-extension (PR43523)

    https://rise4fun.com/Alive/8BY - valid for lshr+trunc+variable sext
    https://rise4fun.com/Alive/7jk - the variable sext can be redundant

    https://rise4fun.com/Alive/Qslu - 'exact'-ness of first shift can be preserver

    https://rise4fun.com/Alive/IF63 - without trunc we could view this as
                                      more general "drop redundant mask before right-shift",
                                      but let's handle it here for now
    https://rise4fun.com/Alive/iip - likewise, without trunc, variable sext can be redundant.

    There's more patterns for sure - e.g. we can have 'lshr' as the final shift,
    but that might be best handled by some more generic transform, e.g.
    "drop redundant masking before right-shift" (PR42456)

    I'm singling-out this sext patch because you can only extract
    high bits with `*shr` (unlike abstract bit masking),
    and i *know* this fold is wanted by existing code.

    I don't believe there is much to review here,
    so i'm gonna opt into post-review mode here.

    https://bugs.llvm.org/show_bug.cgi?id=43523 — lebedevri / ViewSVN
  17. [NFC][InstCombine] Add tests for 'variable sext of variable high bit extract' pattern (PR43523)

    https://bugs.llvm.org/show_bug.cgi?id=43523 — lebedevri / ViewSVN
  18. DebugInfo: Rename DebugLocStream::Entry::Begin/EndSym to just Begin/End

    Brings this struct in line with the RangeSpan class so they might
    eventually be used by common template code for generating range/loc
    lists with less duplicate code. — dblaikie / ViewSVN
  19. Move SanitizerInitializeUnwinder outside anonymous namespace.

    Fixes the Android build breakage introduced in r373528. — morehouse / ViewSVN
  20. [clang][ifs] Clang Interface Stubs ToolChain plumbing.

    This patch enables end to end support for generating ELF interface stubs
    directly from clang. Now the following:

    clang -emit-interface-stubs -o libfoo.so a.cpp b.cpp c.cpp

    will product an ELF binary with visible symbols populated. Visibility attributes
    and -fvisibility can be used to control what gets populated.

    * Adding ToolChain support for clang Driver IFS Merge Phase
    * Implementing a default InterfaceStubs Merge clang Tool, used by ToolChain
    * Adds support for the clang Driver to involve llvm-ifs on ifs files.
    * Adds -emit-merged-ifs flag, to tell llvm-ifs to emit a merged ifs text file
      instead of the final object format (normally ELF)


    Differential Revision: https://reviews.llvm.org/D63978 — zer0 / ViewSVN
  21. [InstCombine] Transform bcopy to memmove

    bcopy is still widely used mainly for network apps. Sadly, LLVM has no optimizations for bcopy, but there are some for memmove.
    Since bcopy == memmove, it is profitable to transform bcopy to memmove and use current optimizations for memmove for free here. — xbolva00 / ViewSVN
  22. [X86] Add test cases for suboptimal vselect+setcc splitting.

    If the vselect result type needs to be split, it will try to
    also try to split the condition if it happens to be a setcc.

    With avx512 where k-registers are legal, its probably better
    to just use a kshift to split the mask register. — ctopper / ViewSVN
  23. [LegalizeTypes] Check for already split condition before calilng SplitVecRes_SETCC in SplitRes_SELECT.

    No point in manually splitting the SETCC if it was already done. — ctopper / ViewSVN
  24. gn build: (manually) merge r373527 — nico / ViewSVN
  25. DebugInfo: Simplify RangeSpan to be a plain struct

    This is an effort to make RangeSpan and DebugLocStream::Entry more
    similar to share code for their emission (to reuse the more complicated
    code for using (& choosing when to use) base address selection entries,
    etc).

    It didn't seem like this struct was worth the complexity of
    encapsulation - when the members could be initialized by the ctor to any
    value (no validation) and the type is assignable (so there's no
    mutability or other constraint being implemented by its interface). — dblaikie / ViewSVN
  26. [sanitizer_common] Declare __sanitizer_on_print in Windows interception.

    Speculative fix for Windows bot. — morehouse / ViewSVN
  27. [sanitizer_common] Disable onprint.cpp on Android.

    The test fails to find the written file on Android. — morehouse / ViewSVN
  28. [sanitizer_common] Add __sanitizer_on_print to interface list.

    Should fix the current Windows buildbot failure. — morehouse / ViewSVN
  29. [compiler-rt] Use GetNextInstructionPc in signal handlers

    Summary:
    All other stack trace callers assume that PC contains return address.
    HWAsan already use GetNextInstructionPc in similar code.

    PR43339

    Reviewers: eugenis, kcc, jfb

    Subscribers: dexonsmith, dberris, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68313 — Vitaly Buka / ViewSVN
  30. NFC: add namespace {} — Vitaly Buka / ViewSVN
  31. [gicombiner] Add the boring boilerplate for the declarative combiner

    Summary:
    This is the first of a series of patches extracted from a much bigger WIP
    patch. It merely establishes the tblgen pass and the way empty combiner
    helpers are declared and integrated into a combiner info.

    The tablegen pass takes a -combiners option to select the combiner helper
    that will be generated. This can be given multiple values to generate
    multiple combiner helpers at once. Doing so helps to minimize parsing
    overhead.

    The reason for creating a GlobalISel subdirectory in utils/TableGen is that
    there will be quite a lot of non-pass files (~15) by the time the patch
    series is done.

    Reviewers: volkan

    Subscribers: mgorny, hiraditya, simoncook, Petar.Avramovic, s.egerton, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68286 — dsanders / ViewSVN
  32. Fix uninitialized variable warning in CodeGenPGO constructor. NFCI. — rksimon / ViewSVN
  33. ItaniumCXXABI - silence static analyzer getAs<RecordType> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use castAs<RecordType> directly and if not assert will fire for us. — rksimon / ViewSVN
  34. [Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments.

    Differential Revision: https://reviews.llvm.org/D68355 — sdmitriev / ViewSVN
  35. Recommit "[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing."

    The cause for the revert should be fixed by r373513 /
    a80b6c15425f82521c624ff24c5c0a34cd534d54

    This reverts commit 47dbcbd8ec6bf6c0b9cbe5811e81a37cc55e73ef. — fhahn / ViewSVN
  36. CGObjCMac - silence static analyzer dyn_cast<>/getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use cast<>/castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  37. [PowerPC] Fix SH field overflow issue

    Store rlwinm Rx, Ry, 32, 0, 31 as rlwinm Rx, Ry, 0, 0, 31 and store
    rldicl Rx, Ry, 64, 0 as rldicl Rx, Ry, 0, 0. Otherwise SH field is overflow and
    fails assertion in assembly printing stage.

    Differential Revision: https://reviews.llvm.org/D66991 — yi-hong.lyu / ViewSVN
  38. [sanitizer_common] Rename OnPrint to __sanitizer_on_print.

    Summary:
    https://reviews.llvm.org/D28596 exposed OnPrint in the global namespace,
    which can cause collisions with user-defined OnPrint() functions.

    Reviewers: vitalybuka, dvyukov

    Reviewed By: vitalybuka, dvyukov

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67987 — morehouse / ViewSVN
  39. [libc++] Use functions instead of global variables to set libc++ build flags

    This commit follows the trend of doing things per-target instead of
    modifying the C++ flags globally. It does so for visibility-related
    flags, other basic build flags and Windows-specific flags. — Louis Dionne / ViewSVN
  40. Fix inconsistent indentation in TableGen.cpp

    The anonymous namespace starts out (incorrectly) indented but isn't
    indented from the TimeRegionsOpt declaration onwards. — dsanders / ViewSVN
  41. Handle llvm.launder.invariant.group in msan.

    Summary:
    [MSan] handle llvm.launder.invariant.group

        Msan used to give false-positives in

        class Foo {
         public:
          virtual ~Foo() {};
        };

        // Return true iff *x is set.
        bool f1(void **x, bool flag);

        Foo* f() {
          void *p;
          bool found;
          found = f1(&p,flag);
          if (found) {
            // p is always set here.
            return static_cast<Foo*>(p); // False positive here.
          }
          return nullptr;
        }

    Patch by Ilya Tokar.

    Reviewers: #sanitizers, eugenis

    Reviewed By: #sanitizers, eugenis

    Subscribers: eugenis, Prazek, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68236 — eugenis / ViewSVN
  42. [TableGen] Improve error reporting of overlapping definitions (NFC) — evandro / ViewSVN
  43. [Local] Handle terminators with users in removeUnreachableBlocks.

    Terminators like invoke can have users outside the current basic block.
    We have to replace those users with undef, before replacing the
    terminator.

    This fixes a crash exposed by rL373430.

    Reviewers: brzycki, asbirlea, davide, spatel

    Reviewed By: asbirlea

    Differential Revision: https://reviews.llvm.org/D68327 — fhahn / ViewSVN
  44. [libc++] Use a function to set warning flags per target

    This is part of a larger shift to move to per-target settings and
    eradicate global variables from the CMake build. I'm starting small
    with warnings only because those are easy to transition over and I
    want to see how it pans out, but we can handle all flags like exceptions
    and RTTI in the future. — Louis Dionne / ViewSVN
  45. [libc++] Revert to using PUBLIC instead of PRIVATE when linking system libs

    It turns out the benchmarks need to link against those libraries
    explicitly too, so CMake's propagation of PUBLIC dependencies is
    used. — Louis Dionne / ViewSVN
  46. [MemorySSA] Update Phi creation when inserting a Def.

    MemoryPhis should be added in the IDF of the blocks newly gaining Defs.
    This includes the blocks that gained a Phi and the block gaining a Def,
    if the block did not have one before.
    Resolves PR43427. — asbirlea / ViewSVN
  47. [Stencil] Hide implementaion detai. NFC. — d0k / ViewSVN
  48. [ARM] Make helpers static. NFC. — d0k / ViewSVN
  49. [OPENMP50]Add parsing/sema analysis for declare variant score.

    Context selectors may include optional score clause in format
    `score(<expr>):`, where `<expr>` must be a constant integer expression.
    Added parsing/sema analysis only. — abataev / ViewSVN
  50. [X86] Rewrite to the vXi1 subvector insertion code to not rely on the value of bits that might be undef

    The previous code tried to do a trick where we would extract the subvector from the location we were inserting. Then xor that with the new value. Take the xored value and clear out the bits above the subvector size. Then shift that xored subvector to the insert location. And finally xor that with the original vector. Since the old subvector was used in both xors, this would leave just the new subvector at the inserted location. Since the surrounding bits had been zeroed no other bits of the original vector would be modified.

    Unfortunately, if the old subvector came from undef we might aggressively propagate the undef. Then we end up with the XORs not cancelling because they aren't using the same value for the two uses of the old subvector. @bkramer gave me a case that demonstrated this, but we haven't reduced it enough to make it easily readable to see what's happening.

    This patch uses a safer, but more costly approach. It isolate the bits above the insertion and bits below the insert point and ORs those together leaving 0 for the insertion location. Then widens the subvector with 0s in the upper bits, shifts it into position with 0s in the lower bits. Then we do another OR.

    Differential Revision: https://reviews.llvm.org/D68311 — ctopper / ViewSVN
  51. Fix: Actually erase remove the elements from AssumeHandles

    Reviewers: sdmitriev, tejohnson

    Reviewed by: tejohnson

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68318 — hiraditya / ViewSVN
  52. [WebAssembly] Error when using wasm64 for ISel

    Summary:
    64-bit WebAssembly (wasm64) is not specified and not supported in the
    WebAssembly backend. We do have support for it in clang, however, and
    we would like to keep that support because we expect wasm64 to be
    specified and supported in the future. For now add an error when
    trying to use wasm64 from the backend to minimize user confusion from
    unexplained crashes.

    Reviewers: aheejin, dschuff, sunfish

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68254 — tlively / ViewSVN
  53. gn build: Merge r373489 — gnsyncbot / ViewSVN
  54. [AMDGPU] Extend buffer intrinsics with swizzling

    Summary:
    Extend cachepolicy operand in the new VMEM buffer intrinsics
    to supply information whether the buffer data is swizzled.
    Also, propagate this information to MIR.

    Intrinsics updated:
    int_amdgcn_raw_buffer_load
    int_amdgcn_raw_buffer_load_format
    int_amdgcn_raw_buffer_store
    int_amdgcn_raw_buffer_store_format
    int_amdgcn_raw_tbuffer_load
    int_amdgcn_raw_tbuffer_store
    int_amdgcn_struct_buffer_load
    int_amdgcn_struct_buffer_load_format
    int_amdgcn_struct_buffer_store
    int_amdgcn_struct_buffer_store_format
    int_amdgcn_struct_tbuffer_load
    int_amdgcn_struct_tbuffer_store

    Furthermore, disable merging of VMEM buffer instructions
    in SI Load/Store optimizer, if the "swizzled" bit on the instruction
    is on.

    The default value of the bit is 0, meaning that data in buffer
    is linear and buffer instructions can be merged.

    There is no difference in the generated code with this commit.
    However, in the future it will be expected that front-ends
    use buffer intrinsics with correct "swizzled" bit set.

    Reviewers: arsenm, nhaehnle, tpr

    Reviewed By: nhaehnle

    Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68200 — Piotr Sobczak / ViewSVN
  55. Add the misc-init-local-variables check.

    This checks finds all primitive type local variables (integers, doubles, pointers) that are declared without an initial value. Includes fixit functionality to initialize said variables with a default value. This is zero for most types and NaN for floating point types. The use of NaNs is copied from the D programming language.

    Patch by Jussi Pakkanen. — aaronballman / ViewSVN
  56. [Local] Remove unused LazyValueInfo pointer from removeUnreachableBlock.

    There are no users that pass in LazyValueInfo, so we can simplify the
    function a bit.

    Reviewers: brzycki, asbirlea, davide

    Reviewed By: davide

    Differential Revision: https://reviews.llvm.org/D68297 — fhahn / ViewSVN
  57. [libc++] Use PRIVATE instead of PUBLIC when linking against system libs — Louis Dionne / ViewSVN
  58. [ThinLTO/WPD] Ensure devirtualized targets use promoted symbol when necessary

    Summary:
    This fixes a hole in the handling of devirtualized targets that were
    local but need promoting due to devirtualization in another module. We
    were not correctly referencing the promoted symbol in some cases. Make
    sure the code that updates the name also looks at the ExportedGUIDs set
    by utilizing a callback that checks all conditions (the callback
    utilized by the internalization/promotion code).

    Reviewers: pcc, davidxl, hiraditya

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68159 — tejohnson / ViewSVN
  59. [CodeGen] Remove unused MachineMemOperand::print wrappers (PR41772)

    As noted on PR41772, the static analyzer reports that the MachineMemOperand::print partial wrappers set a number of args to null pointers that were then dereferenced in the actual implementation.

    It turns out that these wrappers are not being used at all (hence why we're not seeing any crashes), so I'd like to propose we just get rid of them.

    Differential Revision: https://reviews.llvm.org/D68208 — rksimon / ViewSVN
  60. [SLP] add test for vectorization of different widths (PR28457); NFC — spatel / ViewSVN
  61. [llvm] [cmake] Add install targets for missing distribution components

    Add install targets as necessary to include all files normally installed
    in LLVM_DISTRIBUTION_COMPONENTS.  This includes targets for Sphinx docs,
    opt-viewer Python modules and TableGens.

    Differential Revision: https://reviews.llvm.org/D68339 — mgorny / ViewSVN
  62. LowerExpectIntrinsic handlePhiDef - silence static analyzer dyn_cast<PHINode> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<PHINode> directly and if not assert will fire for us. — rksimon / ViewSVN
  63. Type - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  64. [CodeExtractor] NFC: Refactor sanity checks into isEligible

    Reviewers: fhahn

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68331 — hiraditya / ViewSVN
  65. Silence static analyzer getAs<VectorType> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<VectorType> directly and if not assert will fire for us. — rksimon / ViewSVN
  66. Reapply r373431 "Switch lowering: omit range check for bit tests when default is unreachable (PR43129)"

    This was reverted in r373454 due to breaking the expensive-checks bot.
    This version addresses that by omitting the addSuccessorWithProb() call
    when omitting the range check.

    > Switch lowering: omit range check for bit tests when default is unreachable (PR43129)
    >
    > This is modeled after the same functionality for jump tables, which was
    > added in r357067.
    >
    > Differential revision: https://reviews.llvm.org/D68131 — hans / ViewSVN
  67. [llvm-readelf] - Report a warning when .hash section contains a chain with a cycle.

    It is possible to craft a .hash section that triggers an infinite loop
    in llvm-readelf code. This patch fixes the issue and introduces
    a warning.

    Differential revision: https://reviews.llvm.org/D68086 — grimar / ViewSVN
  68. SemaOverload - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  69. SemaInit - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  70. [yaml2obj] - Alow Size tag for describing SHT_HASH sections.

    This is a follow-up for D68085 which allows using "Size"
    tag together with "Content" tag or alone.

    Differential revision: https://reviews.llvm.org/D68216 — grimar / ViewSVN
  71. [Clangd] ExtractFunction: Don't extract body of enclosing function.

    Summary:
    This patch disable extraction of the body of the enclosing function.
    `void f() [[{}]]`

    Extracting this CompoundStmt would leave the enclosing function without
    a body.

    Reviewers: sammccall, kadircet

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68245 — sureyeaah / ViewSVN
  72. [Clangd] Ensure children are always RootStmt in ExtractFunction (Fixes #153)

    Summary:
    We weren't always checking if children are RootStmts in ExtractFunction.

    For `void f([[int a]]);`, the ParmVarDecl appeared as a RootStmt since
    we didn't perform the check and ended up being casted to a (null) Stmt.

    Reviewers: sammccall, kadircet

    Subscribers: kristof.beyls, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68182 — sureyeaah / ViewSVN
  73. [llvm-dwarfdump] Fix dumping of wrong locstats map — djtodoro / ViewSVN
  74. [AArch64][SVE] Implement int_aarch64_sve_cnt intrinsic

    Summary: This patch includes tests for the VecOfBitcastsToInt type added by D68021

    Reviewers: c-rhodes, sdesmalen, rovka

    Reviewed By: c-rhodes

    Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits, cfe-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68023 — kmclaughlin / ViewSVN
  75. MemorySSAUpdater::applyInsertUpdates - silence static analyzer dyn_cast<MemoryAccess> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<MemoryAccess> directly and if not assert will fire for us. — rksimon / ViewSVN
  76. MemorySSA tryOptimizePhi - assert that we've found a DefChainEnd. NFCI.

    Silences static analyzer null dereference warning. — rksimon / ViewSVN
  77. LoopAccessAnalysis isConsecutiveAccess() - silence static analyzer dyn_cast<SCEVConstant> null dereference warning. NFCI.

    The static analyzer is warning about potential null dereferences, but in these cases we should be able to use cast<SCEVConstant> directly and if not assert will fire for us. — rksimon / ViewSVN
  78. AsmPrinter - emitGlobalConstantFP - silence static analyzer null dereference warning. NFCI.

    All the calls to emitGlobalConstantFP should provide a nonnull Type for the float. — rksimon / ViewSVN
  79. gn build: Merge r373462 — gnsyncbot / ViewSVN
  80. [ModuloSchedule] Peel out prologs and epilogs, generate actual code

    Summary:
    This extends the PeelingModuloScheduleExpander to generate prolog and epilog code,
    and correctly stitch uses through the prolog, kernel, epilog DAG.

    The key concept in this patch is to ensure that all transforms are *local*; only a
    function of a block and its immediate predecessor and successor. By defining the problem in this way
    we can inductively rewrite the entire DAG using only local knowledge that is easy to
    reason about.

    For example, we assume that all prologs and epilogs are near-perfect clones of the
    steady-state kernel. This means that if a block has an instruction that is predicated out,
    we can redirect all users of that instruction to that equivalent instruction in our
    immediate predecessor. As all blocks are clones, every instruction must have an equivalent in
    every other block.

    Similarly we can make the assumption by construction that if a value defined in a block is used
    outside that block, the only possible user is its immediate successors. We maintain this
    even for values that are used outside the loop by creating a limited form of LCSSA.

    This code isn't small, but it isn't complex.

    Enabled a bunch of testing from Hexagon. There are a couple of tests not enabled yet;
    I'm about 80% sure there isn't buggy codegen but the tests are checking for patterns
    that we don't produce. Those still need a bit more investigation. In the meantime we
    (Google) are happy with the code produced by this on our downstream SMS implementation,
    and believe it generates correct code.

    Subscribers: mgorny, hiraditya, jsji, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68205 — jamesm / ViewSVN
  81. [llvm-objcopy] Add --set-section-alignment

    Fixes PR43181. This option was recently added to GNU objcopy (binutils
    PR24942).

    `llvm-objcopy -I binary -O elf64-x86-64 --set-section-alignment .data=8` can set the alignment of .data.

    Reviewed By: grimar, jhenderson, rupprecht

    Differential Revision: https://reviews.llvm.org/D67656 — maskray / ViewSVN
  82. [InstCombine] Simplify fma multiplication to nan for undef or nan operands.

    In similar fashion to D67721, we can simplify FMA multiplications if any
    of the operands is NaN or undef. In instcombine, we will simplify the
    FMA to an fadd with a NaN operand, which in turn gets folded to NaN.

    Note that this just changes SimplifyFMAFMul, so we still not catch the
    case where only the Add part of the FMA is Nan/Undef.

    Reviewers: cameron.mcinally, mcberg2017, spatel, arsenm

    Reviewed By: cameron.mcinally

    Differential Revision: https://reviews.llvm.org/D68265 — fhahn / ViewSVN
  83. [InstCombine] Precommit tests for D68265 — fhahn / ViewSVN
  84. NFC: directly return when CommonExitBlock != Succ

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68330 — hiraditya / ViewSVN
  85. [InstSimplify] fold fma/fmuladd with a NaN or undef operand

    This is intended to be similar to the constant folding results from
    D67446
    and earlier, but not all operands are constant in these tests, so the
    responsibility for folding is left to InstSimplify.

    Differential Revision: https://reviews.llvm.org/D67721 — spatel / ViewSVN
  86. Revert r373431 "Switch lowering: omit range check for bit tests when default is unreachable (PR43129)"

    This broke http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/19967

    > Switch lowering: omit range check for bit tests when default is unreachable (PR43129)
    >
    > This is modeled after the same functionality for jump tables, which was
    > added in r357067.
    >
    > Differential revision: https://reviews.llvm.org/D68131 — hans / ViewSVN
  87. LICM - remove unused variable and reduce scope of another variable. NFCI.

    Appeases both clang static analyzer and cppcheck — rksimon / ViewSVN
  88. Fix libc++ pretty printer test for Python 3 after D67238 — maskray / ViewSVN
  89. Log2_32 returns an unsigned. NFCI.

    Silences clang static analyzer warning about out of bounds (negative) shifts. — rksimon / ViewSVN
  90. Fix uninitialized variable warning. NFCI. — rksimon / ViewSVN
  91. WinException::emitExceptHandlerTable - silence static analyzer dyn_cast<Function> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<Function> directly and if not assert will fire for us. — rksimon / ViewSVN
  92. MetadataLoader upgradeCUVariables() - silence static analyzer dyn_cast_or_null<> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we know that the source won't be null so just use dyn_cast, which will assert if the value somehow is actually null. — rksimon / ViewSVN
  93. ASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us. — rksimon / ViewSVN
  94. [ARM] Identity shuffles are legal

    Identity shuffles, of the form (0, 1, 2, 3, ...) are perfectly OK under MVE
    (they essentially just become bitcasts). We were not catching that in the
    existing set of what we considered legal though. On NEON, they would be covered
    by vext's, but that is not generally available in MVE.

    This uses ShuffleVectorInst::isIdentityMask which is a little odd to use here
    but does what we want and prevents us from just rewriting what is the same
    function.

    Differential Revision: https://reviews.llvm.org/D68241 — dmgreen / ViewSVN
  95. [Support, ARM64] Define getHostCPUFeatures for Windows on ARM64 platform

    Patch by Adam Kallai!

    Differential Revision: https://reviews.llvm.org/D68139 — mstorsjo / ViewSVN
  96. [clangd] Bail out early if we are sure that the symbol is used outside of the file.

    Summary:
    This would reduce the false positive when the static index is in an
    unavailable state, e.g. background index is not finished.

    Reviewers: sammccall

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68325 — hokein / ViewSVN
  97. [clangd] SelectionTree should mark a node as fully-selected if the only claimed tokens were early-claimed.

    Summary:
    Previously they would be marked as partially-selected based on the early claim,
    and never updated as no more tokens were claimed.
    This affects simple VarDecls like "int x".

    Reviewers: SureYeaah

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D66872 — sammccall / ViewSVN
  98. [ClangFormat] relnotes for r373439 — sammccall / ViewSVN
  99. [clang-rename] Better renaming the typedef decl.

    Summary:
    when renaming a typedef decl, we used to rename the underlying decl of the
    typedef, we should rename the typedef itself.

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68322 — hokein / ViewSVN
  100. [ClangFormat] Future-proof Standard option, allow floating or pinning to arbitrary lang version

    Summary:
    The historical context:
    - clang-format was written when C++11 was current,
      and the main language-version concern was >> vs > > template-closers.
      An option was added to allow selection of the 03/11 behavior, or auto-detection.
    - there was no option to choose simply "latest standard" so anyone who didn't
      ever want 03 behavior or auto-detection specified Cpp11.
    - In r185149 this option started to affect lexer mode.
    - no options were added to cover c++14, as parsing/formatting
      didn't change that much. The usage of Cpp11 to mean "latest" became
      codified e.g. in r206263
    - c++17 added some new constructs. These were mostly backwards-compatible and so
      not used in old programs, so having no way to turn them off was OK.
    - c++20 added some new constructs and keywords (e.g. co_*) that changed the
      meaning of existing programs, and people started to complain that
      the c++20 parsing couldn't be turned off.

    New plan:
    - Default ('Auto') behavior remains unchanged: parse as latest, format
       template-closers based on input.
    - Add new 'Latest' option that more clearly expresses the intent "use
       modern features" that many projects have chosen for their .clang-format files.
    - Allow pinning to *any* language version, using the same name as clang -std:
       c++03, c++11, c++14 etc. These set precise lexer options, and any
       clang-format code depending on these can use a >= check.
    - For backwards compatibility, `Cpp11` is an alias for `Latest`, not `c++11`.
       This matches the historical documented semantics of this option.
       This spelling (and `Cpp03`) are deprecated.

    Reviewers: klimek, modocache

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D67541 — sammccall / ViewSVN
  101. gn build: (manually) merge r373425 — nico / ViewSVN
  102. [IntrinsicEmitter] Add overloaded type VecOfBitcastsToInt for SVE intrinsics

    Summary:
    This allows intrinsics such as the following to be defined:
    - declare <n x 4 x i32> @llvm.something.nxv4f32(<n x 4 x i32>, <n x 4 x i1>, <n x 4 x float>)

    ...where <n x 4 x i32> is derived from <n x 4 x float>, but
    the element needs bitcasting to int.

    Reviewers: c-rhodes, sdesmalen, rovka

    Reviewed By: c-rhodes

    Subscribers: tschuett, hiraditya, jdoerfert, llvm-commits, cfe-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68021 — kmclaughlin / ViewSVN
  103. [clang-tidy] Fix typo in r373428 — sammccall / ViewSVN
  104. [clangd] Always send file URIs to editors

    Summary:
    Editors only know about file URIs, make sure we do not use any custom
    schemes while sending edits.

    Reviewers: sammccall

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68324 — kadircet / ViewSVN
  105. Remove an unnecessary cast. NFC. — foad / ViewSVN
  106. [AMDGPU] Make printf lowering faster when there are no printfs

    Summary:
    Printf lowering unconditionally visited every instruction in the module.
    To make it faster in the common case where there are no printfs, look up
    the printf function (if any) and iterate over its users instead.

    Reviewers: rampitec, kzhuravl, alex-t, arsenm

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68145 — foad / ViewSVN
  107. Revert [GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.

    This breaks http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52310

    This reverts r373430 (git commit 70f70035484ba199a329f9f8d9bd67e37bc2b408) — fhahn / ViewSVN
  108. Switch lowering: omit range check for bit tests when default is unreachable (PR43129)

    This is modeled after the same functionality for jump tables, which was
    added in r357067.

    Differential revision: https://reviews.llvm.org/D68131 — hans / ViewSVN
  109. [GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.

    removeUnreachableBlocks knows how to preserve the DomTree, so make use
    of it instead of re-computing the DT.

    Reviewers: davide, kuhar, brzycki

    Reviewed By: davide, kuhar

    Differential Revision: https://reviews.llvm.org/D68298 — fhahn / ViewSVN
  110. [Local] Simplify function removeUnreachableBlocks() to avoid (re-)computation.

    Two small changes in llvm::removeUnreachableBlocks() to avoid unnecessary (re-)computation.

    First, replace the use of count() with find(), which has better time complexity.

    Second, because we have already computed the set of dead blocks, replace the second loop over all basic blocks to a loop only over the already computed dead blocks. This simplifies the loop and avoids recomputation.

    Patch by Rodrigo Caetano Rocha <rcor.cs@gmail.com>

    Reviewers: efriedma, spatel, fhahn, xbolva00

    Reviewed By: fhahn, xbolva00

    Differential Revision: https://reviews.llvm.org/D68191 — fhahn / ViewSVN
  111. [clang-tidy] Fix for commits rL372706 and rL372711

    The patch committed was not the accepted version but the
    previous one. This commit fixes this issue.

    Differential Revision: https://reviews.llvm.org/D64736 — baloghadamsoftware / ViewSVN
  112. Reland "[utils] Implement the llvm-locstats tool"

    The tool reports verbose output for the DWARF debug location coverage.
    The llvm-locstats for each variable or formal parameter DIE computes what
    percentage from the code section bytes, where it is in scope, it has
    location description. The line 0 shows the number (and the percentage) of
    DIEs with no location information, but the line 100 shows the number (and
    the percentage) of DIEs where there is location information in all code
    section bytes (where the variable or parameter is in the scope). The line
    50..59 shows the number (and the percentage) of DIEs where the location
    information is in between 50 and 59 percentage of its scope covered.

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

    The cause of the test failure was resolved. — djtodoro / ViewSVN
  113. [llvm-lib] Detect duplicate input files

    Differential Revision: https://reviews.llvm.org/D68320 — ruiu / ViewSVN
  114. Rename TypeNodes.def to TypeNodes.inc for consistency across all
    our autogenerated files.  NFC.

    As requested by Nico Weber. — rjmccall / ViewSVN
  115. [llvm-lib] Correctly handle .lib input files

    If archive files are passed as input files, llvm-lib needs to append
    the members of the input archive files to the output file. This patch
    implements that behavior.

    This patch splits an existing function into smaller functions.
    Effectively, the new code is only `if (Magic == file_magic::archive)
    { ... }` part.

    Fixes https://bugs.llvm.org/show_bug.cgi?id=32674

    Differential Revision: https://reviews.llvm.org/D68204 — ruiu / ViewSVN
  116. [X86] Add broadcast load folding patterns to the NoVLX compare patterns.

    These patterns use zmm registers for 128/256-bit compares when
    the VLX instructions aren't available. Previously we only
    supported registers, but as PR36191 notes we can fold broadcast
    loads, but not regular loads. — ctopper / ViewSVN
  117. Fix GCC -Wreturn-type warnings. NFC. — hliao / ViewSVN

#5500 (Oct 1, 2019 8:29:06 PM)

  1. Revert r368237 - Update fix-it hints for std::move warnings.

    r368237 attempted to improve fix-its for move warnings, but introduced some
    regressions to -Wpessimizing-move.  Revert that change and add the missing
    test cases to the pessimizing move test to prevent future regressions. — rtrieu / ViewSVN
  2. DebugInfo: Update support for detecting C++ language variants in debug info emission — dblaikie / ViewSVN
  3. gn build: (manually) merge r373407 — nico / ViewSVN
  4. Fix crash on constant-evaluation of pseudo-destruction of a pointer.

    We got confused and thought we might be pseudo-destroying the pointee
    instead. — rsmith / ViewSVN
  5. AMDGPU/GlobalISel: Use getIntrinsicID helper — arsenm / ViewSVN
  6. Remove TypeNodes.def from the modulemap.

    We currently just look for files named in the modulemap in its
    associated source directory.  This means that we can't name
    generated files, like TypeNodes.def now is, which means we can't
    explicitly mark it as textual.  But fortunately that's okay
    because (as I understand it) the most important purpose of naming
    the header in the modulemap is to ensure that it's not treated as
    public, and the search for public headers also only considers
    files in the associated source directory.  This isn't an elegant
    solution, since among other things it means that a build which
    wrote the generated files directly into the source directory would
    result in something that wouldn't build as a module, but that's
    a problem for all our other generated files as well. — rjmccall / ViewSVN
  7. AMDGPU/GlobalISel: Assume VGPR for G_FRAME_INDEX

    In principle this should behave as any other constant. However
    eliminateFrameIndex currently assumes a VALU use and uses a vector
    shift. Work around this by selecting to VGPR for now until
    eliminateFrameIndex is fixed. — arsenm / ViewSVN
  8. AMDGPU/GlobalISel: Private loads always use VGPRs — arsenm / ViewSVN
  9. AMDGPU/GlobalISel: Legalize 1024-bit G_BUILD_VECTOR

    This will be needed to support AGPR operations. — arsenm / ViewSVN
  10. AMDGPU/GlobalISel: Fix RegBankSelect for 1024-bit values — arsenm / ViewSVN

#5499 (Oct 1, 2019 5:50:53 PM)

  1. [AMDGPU] separate accounting for agprs

    Account and report agprs separately on gfx908. Other targets
    do not change the reporting.

    Differential Revision: https://reviews.llvm.org/D68307 — rampitec / ViewSVN
  2. Fix unused variable warning. NFCI. — hliao / ViewSVN
  3. [X86] Add a DAG combine to shrink vXi64 gather/scatter indices that are constant with sufficient sign bits to fit in vXi32

    The gather/scatter instructions can implicitly sign extend the indices. If we're operating on 32-bit data, an v16i64 index can force a v16i32 gather to be split in two since the index needs 2 registers. If we can shrink the index to the i32 we can avoid the split. It should always be safe to shrink the index regardless of the number of elements. We have gather/scatter instructions that can use v2i32 index stored in a v4i32 register with v2i64 data size.

    I've limited this to before legalize types to avoid creating a v2i32 after type legalization. We could check for it, but we'd also need testing. I'm also only handling build_vectors with no bitcasts to be sure the truncate will constant fold.

    Differential Revision: https://reviews.llvm.org/D68247 — ctopper / ViewSVN
  4. Emit TypeNodes.def with tblgen.

    The primary goal here is to make the type node hierarchy available to
    other tblgen backends, although it should also make it easier to generate
    more selective x-macros in the future.

    Because tblgen doesn't seem to allow backends to preserve the source
    order of defs, this is not NFC because it significantly re-orders IDs.
    I've fixed the one (fortunately obvious) place where we relied on
    the old order.  Unfortunately, I wasn't able to share code with the
    existing AST-node x-macro generators because the x-macro schema we use
    for types is different in a number of ways.  The main loss is that
    subclasses aren't ordered together, which doesn't seem important for
    types because the hierarchy is generally very shallow with little
    clustering. — rjmccall / ViewSVN
  5. Use scope qualifiers in Clang's tblgen backends to get useful
    redeclaration checking.  NFC. — rjmccall / ViewSVN
  6. [CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #3.

    The main problem here is that `-*-version_min=` was not being passed to
    the compiler when building test cases. This can cause problems when
    testing on devices running older OSs because Clang would previously
    assume the minimum deployment target is the the latest OS in the SDK
    which could be much newer than what the device is running.

    Previously the generated value looked like this:

    `-arch arm64 -isysroot
    <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`

    With this change it now looks like:

    `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot
    <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`

    This mirrors the setting of config.target_cflags on macOS.

    This change is made for ASan, LibFuzzer, TSan, and UBSan.

    To implement this a new `get_test_cflags_for_apple_platform()` function
    has been added that when given an Apple platform name and architecture
    returns a string containing the C compiler flags to use when building
    tests. This also calls a new helper function `is_valid_apple_platform()`
    that validates Apple platform names.

    This is the third attempt at landing the patch.

    The first attempt (r359305) had to be reverted (r359327) due to a buildbot
    failure. The problem was that calling `get_test_cflags_for_apple_platform()`
    can trigger a CMake error if the provided architecture is not supported by the
    current CMake configuration. Previously, this could be triggered by passing
    `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were
    generating test configurations for a list of architectures without checking if
    the relevant Sanitizer actually supported that architecture. We now intersect
    the list of architectures for an Apple platform with
    `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer name) to
    iterate through the correct list of architectures.

    The second attempt (r363633) had to be reverted (r363779) due to a build
    failure. The failed build was using a modified Apple toolchain where the iOS
    simulator SDK was missing. This exposed a bug in the existing UBSan test
    generation code where it was assumed that `COMPILER_RT_ENABLE_IOS` implied that
    the toolchain supported both iOS and the iOS simulator. This is not true. This
    has been fixed by using the list `SANITIZER_COMMON_SUPPORTED_OS` for the list
    of supported Apple platforms for UBSan. For consistency with the other
    Sanitizers we also now intersect the list of architectures with
    UBSAN_SUPPORTED_ARCH.

    rdar://problem/50124489

    Differential Revision: https://reviews.llvm.org/D61242 — delcypher / ViewSVN
  7. AMDGPU: Fix an out of date assert in addressing FrameIndex

    Reviewers:
      arsenm

    Differential Revision:
      https://reviews.llvm.org/D67574 — chfang / ViewSVN
  8. [libFuzzer] Remove lazy counters.

    Summary: Lazy counters haven't improved performance for large fuzz targets.

    Reviewers: kcc

    Reviewed By: kcc

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67476 — morehouse / ViewSVN
  9. Determine endianness at a time when it doesn't inadvertantly clear gdb's wrap_buffer via gdb.execute.

    Summary:
    I haven't managed a small reproduction for this bug, it involves
    complicated and deeply nested data structures with a wide variety
    of pretty printers. But in general, we shouldn't be combining
    gdb's command line interface (via gdb.execute) with pretty-printers.

    Subscribers: christof, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68306 — saugustine / ViewSVN
  10. Revert r373172 "[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops."

    This seems to be causing some performance regresions that I'm
    trying to investigate.

    One thing that stands out is that this transform can increase
    the live range of the operands of the earlier logic op. This
    can be bad for register allocation. If there are two logic
    op inputs we should really combine the one that is closest, but
    SelectionDAG doesn't have a good way to do that. Maybe we need
    to do this as a basic block transform in Machine IR. — ctopper / ViewSVN
  11. [clang][OpenMP][NFC] #include GlobalDecl.h to avoid incomplete class type — rupprecht / ViewSVN
  12. CGVTables - silence static analyzer getAs<FunctionProtoType> null dereference warnings. NFCI.

    The static analyzer is warning about potential null dereferences, but we should be able to use castAs<FunctionProtoType> directly and if not assert will fire for us. — rksimon / ViewSVN
  13. [X86] convertToThreeAddress, make sure second operand of SUB32ri is really an immediate before calling getImm().

    It might be a symbol instead. We can't fold those since we can't
    negate them.

    Similar for other SUB with immediates.

    Fixes PR43529. — ctopper / ViewSVN
  14. CGExprAgg - remove duplicate code. NFCI.

    Remove duplicate getAs<> call, avoiding a clang static analyzer null dereference warning. — rksimon / ViewSVN
  15. [FileCheck] Move private interface to its own header

    Summary:
    Most of the class definition in llvm/include/llvm/Support/FileCheck.h
    are actually implementation details that should not be relied upon. This
    commit moves all of it in a new header file under
    llvm/lib/Support/FileCheck. It also takes advantage of the code movement
    to put the code into a new llvm::filecheck namespace.

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

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67649 — thopre / ViewSVN
  16. [BypassSlowDivision][CodeGenPrepare] avoid crashing on unused code (PR43514)

    https://bugs.llvm.org/show_bug.cgi?id=43514 — spatel / ViewSVN
  17. gn build: Merge r373392 — gnsyncbot / ViewSVN
  18. [clang-tidy] Rename objc-avoid-spinlock check to darwin-avoid-spinlock

    Summary:
    OSSpinLock* are Apple/Darwin functions, but were previously located with ObjC checks as those were most closely tied to Apple platforms before.

    Now that there's a specific Darwin module, relocating the check there.

    This change was prepared by running rename_check.py.

    Contributed By: mwyman

    Reviewers: stephanemoore, dmaclach

    Reviewed By: stephanemoore

    Subscribers: Eugene.Zelenko, mgorny, xazax.hun, cfe-commits

    Tags: #clang-tools-extra, #clang, #llvm

    Differential Revision: https://reviews.llvm.org/D68148 — stephanemoore / ViewSVN
  19. [ASan][NFC] Address remaining comments for https://reviews.llvm.org/D68287

    I submitted that patch after I got the LGTM, but the comments didn't
    appear until after I submitted the change. This adds `const` to the
    constructor argument and makes it a pointer. — leonardchan / ViewSVN
  20. [NFC] Fix typos in libc++ documentation — Louis Dionne / ViewSVN
  21. [ASan] Make GlobalsMD member a const reference.

    PR42924 points out that copying the GlobalsMetadata type during
    construction of AddressSanitizer can result in exteremely lengthened
    build times for translation units that have many globals. This can be addressed
    by just making the GlobalsMD member in AddressSanitizer a reference to
    avoid the copy. The GlobalsMetadata type is already passed to the
    constructor as a reference anyway.

    Differential Revision: https://reviews.llvm.org/D68287 — leonardchan / ViewSVN
  22. [clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed

    Summary:
    This is a patch to fix PR43372 (https://bugs.llvm.org/show_bug.cgi?id=43372) - clang-format can't format file with includes, ( which really keep providing replacements for already sorted headers.)

    A similar issue was addressed by @krasimir in {D60199}, however, this seemingly only prevented the issue when the files being formatted did not contain windows line endings (\r\n)

    It's possible this is related to https://twitter.com/StephanTLavavej/status/1176722938243895296 given who @STL_MSFT  works for!

    As people often used the existence of replacements to determine if a file needs clang-formatting, this is probably pretty important for windows users

    There may be a better way of comparing 2 strings and ignoring \r (which appear in both Results and Code), I couldn't choose between this idiom or the copy_if approach, but I'm happy to change it to whatever people consider more performant.

    Reviewers: krasimir, klimek, owenpan, ioeric

    Reviewed By: krasimir

    Subscribers: cfe-commits, STL_MSFT, krasimir

    Tags: #clang-format, #clang, #clang-tools-extra

    Differential Revision: https://reviews.llvm.org/D68227 — paulhoad / ViewSVN
  23. [OPENMP50]Initial codegen for declare variant implementation vendor.

    Initial implementation of global aliases emission for the declare
    variant pragma with implementation vendor context selector set. — abataev / ViewSVN
  24. [DDG] Data Dependence Graph - Root Node

    Summary:
    This patch adds Root Node to the DDG. The purpose of the root node is to create a single entry node that allows graph walk iterators to iterate through all nodes of the graph, making sure that no node is left unvisited during a graph walk (eg. SCC or DFS). Once the DDG is fully constructed it will have exactly one root node. Every node in the graph is reachable from the root. The algorithm for connecting the root node is based on depth-first-search that keeps track of visited nodes to try to avoid creating unnecessary edges.

    Authored By: bmahjour

    Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

    Reviewed By: Meinersbur

    Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack

    Tag: #llvm

    Differential Revision: https://reviews.llvm.org/D67970 — bmahjour / ViewSVN
  25. [libc++] Re-apply workaround for D63883

    In reality, this workaround is for the fact that LIBCXX_CXX_ABI=libcxxabi
    can't be specified on Linux, since libc++abi isn't shipped with the system.
    Since the build bots explicitly specify LIBCXX_CXX_ABI=libcxxabi, they fail
    unless we apply the workaround. — Louis Dionne / ViewSVN
  26. [libc++] Remove workaround for D63883

    I tried applying D63883 three times and could never get around to
    making it work. I'm giving up on that for now, but soon this should
    be irrelevant anyway since all builds will move to the monorepo
    (where we're always using the in-tree libc++abi unless explicitly
    specified otherwise). — Louis Dionne / ViewSVN
  27. [MemorySSA] Check for unreachable blocks when getting last definition.

    If a single predecessor is found, still check if the block is
    unreachable. The test that found this had a self loop unreachable block.
    Resolves PR43493. — asbirlea / ViewSVN
  28. Add a missing pass in ARM O3 pipeline — kuhar / ViewSVN
  29. [MemorySSA] Update last_access_in_block check.

    The check for "was there an access in this block" should be: is the last
    access in this block and is it not a newly inserted phi.
    Resolves new test in PR43438.

    Also fix a typo when simplifying trivial Phis to match the comment. — asbirlea / ViewSVN
  30. [Dominators][CodeGen] Don't mark MachineDominatorTree as preserved in MachineLICM — kuhar / ViewSVN
  31. [Dominators][CodeGen] Fix MachineDominatorTree preservation in PHIElimination

    Summary:
    PHIElimination modifies CFG and marks MachineDominatorTree as preserved. Therefore, it the CFG changes it should also update the MDT, when available. This patch teaches PHIElimination to recalculate MDT when necessary.

    This fixes the `tailmerging_in_mbp.ll` test failure discovered after switching to generic DomTree verification algorithm in MachineDominators in D67976.

    Reviewers: arsenm, hliao, alex-t, rampitec, vpykhtin, grosser

    Reviewed By: rampitec

    Subscribers: MatzeB, wdng, hiraditya, javed.absar, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68154 — kuhar / ViewSVN
  32. Reapply [Dominators][CodeGen] Clean up MachineDominators

    This reverts r373117 (git commit 159ef37735f21ae373282e0c53cbd9b6af1e0dfd)

    Phabricator review: https://reviews.llvm.org/D67976. — kuhar / ViewSVN
  33. [NFC] Updated tests after rL373371

    Forgot to run check-clang-semacxx. — xbolva00 / ViewSVN
  34. [OPENMP]Fix PR43330: OpenMP target: Mapping of partial arrays fails.

    Fixed calculation the size of the array sections. — abataev / ViewSVN
  35. [Diagnostics] Make -Wenum-compare-conditional off by default

    Too many false positives, eg. in Chromium. — xbolva00 / ViewSVN
  36. [ThinLTO] Enable index-only WPD from clang

    Summary:
    To trigger the index-only Whole Program Devirt support added to LLVM, we
    need to be able to specify -fno-split-lto-unit in conjunction with
    -fwhole-program-vtables. Keep the default for -fwhole-program-vtables as
    -fsplit-lto-unit, but don't error on that option combination.

    Reviewers: pcc

    Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, arphaman, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68029 — tejohnson / ViewSVN
  37. [PGO] Fix typos from r359612. NFC. — xur / ViewSVN
  38. [ARM] Some MVE shuffle plus extend tests. NFC — dmgreen / ViewSVN
  39. Revert "compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM"
    Revert "compiler-rt: move all __GLIBC_PREREQ into own header file"

    "move all __GLIBC_PREREQ" breaks build on some bots

    This reverts commit 2d75ee937397c209dbd95aefc88da6301fed07da.
    This reverts commit 7a6461fcc2ed8e28c43993c561721af0bbe97f3a. — Vitaly Buka / ViewSVN
  40. AMDGPU/SILoadStoreOptimizer: Add helper functions for working with CombineInfo

    Summary:
    This is a refactoring that will make future improvements to this pass easier.
    This change should not change the behavior of the pass.

    Reviewers: arsenm, pendingchaos, rampitec, nhaehnle, vpykhtin

    Reviewed By: nhaehnle, vpykhtin

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D65496 — tstellar / ViewSVN
  41. [InstCombine] Deal with -(trunc(X >>u 63)) -> trunc(X >>s 63)

    Identical to it's trunc-less variant, just pretent-to hoist
    trunc, and everything else still holds:
    https://rise4fun.com/Alive/JRU — lebedevri / ViewSVN
  42. [InstCombine] Preserve 'exact' in -(X >>u 31) -> (X >>s 31) fold

    https://rise4fun.com/Alive/yR4 — lebedevri / ViewSVN
  43. [NFC][InstCombine] (Better) tests for sign-bit-smearing pattern

    https://rise4fun.com/Alive/JRU
    https://rise4fun.com/Alive/yR4 <- we can preserve 'exact' — lebedevri / ViewSVN
  44. [llvm-mca] Add a -mattr flag

    This adds a -mattr flag to llvm-mca, for cases where the -mcpu option does not
    contain all optional features.

    Differential Revision: https://reviews.llvm.org/D68190 — dmgreen / ViewSVN
  45. [ReleaseProcess] Document requirement to set MACOSX_DEPLOYMENT_TARGET — Vedant Kumar / ViewSVN
  46. [IndVars] An implementation of loop predication without a need for speculation

    This patch implements a variation of a well known techniques for JIT compilers - we have an implementation in tree as LoopPredication - but with an interesting twist. This version does not assume the ability to execute a path which wasn't taken in the original program (such as a guard or widenable.condition intrinsic). The benefit is that this works for arbitrary IR from any frontend (including C/C++/Fortran). The tradeoff is that it's restricted to read only loops without implicit exits.

    This builds on SCEV, and can thus eliminate the loop varying portion of the any early exit where all exits are understandable by SCEV. A key advantage is that fixing deficiency exposed in SCEV - already found one while writing test cases - will also benefit all of full redundancy elimination (and most other loop transforms).

    I haven't seen anything in the literature which quite matches this. Given that, I'm not entirely sure that keeping the name "loop predication" is helpful. Anyone have suggestions for a better name? This is analogous to partial redundancy elimination - since we remove the condition flowing around the backedge - and has some parallels to our existing transforms which try to make conditions invariant in loops.

    Factoring wise, I chose to put this in IndVarSimplify since it's a generally applicable to all workloads. I could split this off into it's own pass, but we'd then probably want to add that new pass every place we use IndVars.  One solid argument for splitting it off into it's own pass is that this transform is "too good". It breaks a huge number of existing IndVars test cases as they tend to be simple read only loops.  At the moment, I've opted it off by default, but if we add this to IndVars and enable, we'll have to update around 20 test files to add side effects or disable this transform.

    Near term plan is to fuzz this extensively while off by default, reflect and discuss on the factoring issue mentioned just above, and then enable by default.  I also need to give some though to supporting widenable conditions in this framing.

    Differential Revision: https://reviews.llvm.org/D67408 — reames / ViewSVN
  47. AMDGPU/GlobalISel: Increase max legal size to 1024

    There are 1024 bit register classes defined for AGPRs. Additionally
    OpenCL defines vectors up to 16 x i64, and this helps those tests
    legalize. — arsenm / ViewSVN
  48. [X86] Add a VBROADCAST_LOAD ISD opcode representing a scalar load broadcasted to a vector.

    Summary:
    This adds the ISD opcode and a DAG combine to create it. There are
    probably some places where we can directly create it, but I'll
    leave that for future work.

    This updates all of the isel patterns to look for this new node.
    I had to add a few additional isel patterns for aligned extloads
    which we should probably fix with a DAG combine or something. This
    does mean that the broadcast load folding for avx512 can no
    longer match a broadcasted aligned extload.

    There's still some work to do here for combining a broadcast of
    a broadcast_load. We also need to improve extractelement or
    demanded vector elements of a broadcast_load. I'll try to get
    those done before I submit this patch.

    Reviewers: RKSimon, spatel

    Reviewed By: RKSimon

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68198 — ctopper / ViewSVN
  49. [OPENMP]Fix PR43516: Compiler crash with collapse(2) on non-rectangular
    loop.

    Missed check if the condition is also dependent when building final
    expressions for the collapsed loop directives. — abataev / ViewSVN
  50. [AMDGPU] Add VerifyScheduling support.

    Summary:
    This is cut and pasted from the corresponding GenericScheduler
    functions.

    Reviewers: arsenm, atrick, tstellar, vpykhtin

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68264 — foad / ViewSVN
  51. [Diagnostics] Move warning into the subgroup (-Wenum-compare-conditional) — xbolva00 / ViewSVN
  52. [DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a target hook (PR42863)

    This patch converts the DAGCombine isNegatibleForFree/GetNegatedExpression into overridable TLI hooks.

    The intention is to let us extend existing FNEG combines to work more generally with negatible float ops, allowing it work with target specific combines and opcodes (e.g. X86's FMA variants).

    Unlike the SimplifyDemandedBits, we can't just handle target nodes through a Target callback, we need to do this as an override to allow targets to handle generic opcodes as well. This does mean that the target implementations has to duplicate some checks (recursion depth etc.).

    Partial reversion of rL372756 - I've identified the infinite loop issue inside the X86 override but haven't fixed it yet so I've only (re)committed the common TargetLowering refactoring part of the patch.

    Differential Revision: https://reviews.llvm.org/D67557 — rksimon / ViewSVN
  53. [Dominators][CodeGen] Add MachinePostDominatorTree verification

    Summary:
    This patch implements Machine PostDominator Tree verification and ensures that the verification doesn't fail the in-tree tests.

    MPDT verification can be enabled using `verify-machine-dom-info` -- the same flag used by Machine Dominator Tree verification.

    Flipping the flag revealed that MachineSink falsely claimed to preserve CFG and MDT/MPDT. This patch fixes that.

    Reviewers: arsenm, hliao, rampitec, vpykhtin, grosser

    Reviewed By: hliao

    Subscribers: wdng, hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68235 — kuhar / ViewSVN
  54. [clang] Make handling of unnamed template params similar to function params

    Summary:
    Clang uses the location identifier should be inserted for declarator
    decls when a decl is unnamed. But for type template and template template
    paramaters it uses the location of "typename/class" keyword, which makes it hard
    for tooling to insert/change parameter names.

    This change tries to unify these two cases by making template parameter
    parsing and sourcerange operations similar to function params/declarator decls.

    Reviewers: ilya-biryukov

    Subscribers: arphaman, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68143 — kadircet / ViewSVN
  55. Revert rL349624 : Let TableGen write output only if it changed, instead of doing so in cmake, attempt 2

    Differential Revision: https://reviews.llvm.org/D55842
    -----------------
    As discussed on PR43385 this is causing Visual Studio msbuilds to perpetually rebuild all tablegen generated files — rksimon / ViewSVN
  56. Revert "Reland "[utils] Implement the llvm-locstats tool""

    This reverts commit rL373317 due to test failure on the
    clang-s390x-linux build bot. — djtodoro / ViewSVN
  57. Revert [InstCombine] sprintf(dest, "%s", str) -> memccpy(dest, str, 0, MAX)

    Seems to be slower than memcpy + strlen. — xbolva00 / ViewSVN
  58. [InstCombine] sprintf(dest, "%s", str) -> memccpy(dest, str, 0, MAX) — xbolva00 / ViewSVN
  59. [llvm-exegesis/lib] Fix missing linkage to MCParser

    Otherwise, shared-lib build fails with:

    lib64/libLLVMExegesis.a(SnippetFile.cpp.o): In function `llvm::exegesis::readSnippets(llvm::exegesis::LLVMState const&, llvm::StringRef)':
    SnippetFile.cpp:(.text._ZN4llvm8exegesis12readSnippetsERKNS0_9LLVMStateENS_9StringRefE+0x31f): undefined reference to `llvm::createMCAsmParser(llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo const&, unsigned int)'
    SnippetFile.cpp:(.text._ZN4llvm8exegesis12readSnippetsERKNS0_9LLVMStateENS_9StringRefE+0x41c): undefined reference to `llvm::MCAsmParser::setTargetParser(llvm::MCTargetAsmParser&)'
    collect2: error: ld returned 1 exit status — mgorny / ViewSVN
  60. [NFC][ARM][MVE] More tests

    Add some tail predication tests with fast math. — sam_parker / ViewSVN
  61. [libc++] Harden usage of static_assert against C++03

    In C++03, we emulate static_assert with a macro, and we must parenthesize
    multiple arguments. — Louis Dionne / ViewSVN
  62. [clang] Ignore builtin namespaces in test/Import/cxx-anon-namespace

    Some platforms (e.g. AArch64) put __va_list in the 'std' namespace which might
    end up being the first namespace we match in this test. Instead let
    the first namespace match via file name/line so that we skip the
    builtin namespaces. — Raphael Isemann / ViewSVN
  63. DIExpression::createFragmentExpression - silence static analyzer DIExpression* null dereference warning with an assertion. NFCI. — rksimon / ViewSVN
  64. VirtualFileSystem - replace dyn_cast<>+assert with cast<> calls. NFCI.

    Silences a number of clang static analyzer null dereference warnings. — rksimon / ViewSVN
  65. ObjectFile makeTriple - silence static analyzer dyn_cast<COFFObjectFile> null dereference warning. NFCI.

    The static analyzer is warning about a potential null dereference, but we should be able to use cast<COFFObjectFile> directly and if not assert will fire for us. — rksimon / ViewSVN
  66. [clangd] Implement getBeginning for overloaded operators.

    Summary:
    This will fix some bugs where navigation doesn't work on cases like
    `std::cout <^< "hello"`.

    Reviewers: ilya-biryukov

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

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D67695 — hokein / ViewSVN
  67. InstrProf - avoid static analyzer dyn_cast<ConstantInt> null dereference warning.

    The static analyzer is warning about a potential null dereference, as we're already earlying-out for a null Constant pointer I've just folded this into a dyn_cast_or_null<ConstantInt>.

    No test case, this is by inspection only. — rksimon / ViewSVN
  68. ConstantFold - ConstantFoldSelectInstruction - assume constant vector elements are constant. NFCI.

    Goes a bit further than rL372743 which added the early out - elements should be Constant so use cast<Constant> instead (and rely on the assert if anything fails). — rksimon / ViewSVN
  69. [clangd] Use the index-based API to do the header-source switch.

    Summary:
    If the file heuristic fails, we try to use the index&AST to do the
    header/source inference.

    Reviewers: kadircet

    Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68211 — hokein / ViewSVN
  70. [obj2yaml] - Fix BB after r373315.

    The success return value for data extractor's cursor
    should also be checked. — grimar / ViewSVN
  71. [clangd] Handle template arguments in findExplicitReferences

    Reviewers: kadircet

    Reviewed By: kadircet

    Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68137 — ibiryukov / ViewSVN
  72. Reland "[utils] Implement the llvm-locstats tool"

    The tool reports verbose output for the DWARF debug location coverage.
    The llvm-locstats for each variable or formal parameter DIE computes what
    percentage from the code section bytes, where it is in scope, it has
    location description. The line 0 shows the number (and the percentage) of
    DIEs with no location information, but the line 100 shows the number (and
    the percentage) of DIEs where there is location information in all code
    section bytes (where the variable or parameter is in the scope). The line
    50..59 shows the number (and the percentage) of DIEs where the location
    information is in between 50 and 59 percentage of its scope covered.

    Differential Revision: https://reviews.llvm.org/D66526 — djtodoro / ViewSVN
  73. [yaml2obj] - Allow specifying custom Link values for SHT_HASH section.

    This allows setting any sh_link values for SHT_HASH sections.

    Differential revision: https://reviews.llvm.org/D68214 — grimar / ViewSVN
  74. [yaml2obj/obj2yaml] - Add support for SHT_HASH sections.

    SHT_HASH specification is:
    http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash

    In short the format is the following: it has 2 uint32 fields
    in its header: nbucket and nchain followed by (nbucket + nchain)
    uint32 values.

    This patch allows dumping and parsing such sections.

    Differential revision: https://reviews.llvm.org/D68085 — grimar / ViewSVN
  75. Fixup r373278: Move test to X86 directory

    ...since it's using an x86 triple. — rovka / ViewSVN
  76. [llvm-exegesis][NFC] Refactor X86 tests fixtures into a base class.

    Reviewers: gchatelet, a.sidorin

    Subscribers: tschuett, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68262 — courbet / ViewSVN
  77. [clang][lldb][NFC] Encapsulate ExternalASTMerger::ImporterSource

    NFC preparation work for upcoming ExternalASTMerger patches. — Raphael Isemann / ViewSVN
  78. Revert "[OCaml] Handle nullptr in Llvm.global_initializer"

    This reverts commit r373299. It broke tests:
    http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18485 — gribozavr / ViewSVN
  79. Revert "GlobalISel: Handle llvm.read_register"

    This reverts commit r373294. It broke Clang's
    CodeGen/arm64-microsoft-status-reg.cpp:
    http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18483 — gribozavr / ViewSVN
  80. [NFC][HardwareLoops] Update some iterators — sam_parker / ViewSVN
  81. Decrease the verbosity of the -ftime-trace option
    And move the relevant information in the doc.

    Summary:
    Currently, building a large software like Firefox shows
    'Use chrome://tracing or Speedscope App (https://www.speedscope.app) for flamegraph visualization'
    for each file.

    Reviewers: anton-afanasyev

    Reviewed By: anton-afanasyev

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68260 — sylvestre / ViewSVN
  82. [clangd] Handle OverloadExpr in targetDecl

    Reviewers: sammccall

    Reviewed By: sammccall

    Subscribers: nridge, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D68119 — ibiryukov / ViewSVN
  83. [clang-tidy] Fix module registry name and description for Darwin clang-tidy module.

    Summary: When creating the module, must have copy-pasted from the misc module, and forgotten to update the name/description of the module in the registry.

    Reviewers: stephanemoore, benhamilton, gribozavr

    Reviewed By: gribozavr

    Subscribers: xazax.hun, cfe-commits

    Tags: #clang, #clang-tools-extra, #llvm

    Differential Revision: https://reviews.llvm.org/D68251 — gribozavr / ViewSVN
  84. [X86] Consider isCodeGenOnly in the EVEX2VEX pass to make VMAXPD/PS map to the non-commutable VEX instruction. Use EVEX2VEX override to fix the scalar instructions.

    Previously the match was ambiguous and VMAXPS/PD and VMAXCPS/PD
    were mapped to the same VEX instruction. But we should keep
    the commutableness when change the opcode. — ctopper / ViewSVN
  85. [WebAssembly] Make sure EH pads are preferred in sorting

    Summary:
    In CFGSort, we try to make EH pads have higher priorities as soon as
    they are ready to be sorted, to prevent creation of unwind destination
    mismatches in CFGStackify. We did that by making priority queues'
    comparison function  prefer EH pads, but it was possible for an EH pad
    to be popped from `Preferred` queue and then not sorted immediately and
    enter `Ready` queue instead in a certain condition. This patch makes
    sure that special condition does not consider EH pads as its candidates.

    Reviewers: dschuff

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68229 — aheejin / ViewSVN
  86. [WebAssembly] Unstackify regs after fixing unwinding mismatches

    Summary:
    Fixing unwind mismatches for exception handling can result in splicing
    existing BBs and moving some of instructions to new BBs. In this case
    some of stackified def registers in the original BB can be used in the
    split BB. For example, we have this BB and suppose %r0 is a stackified
    register.
    ```
    bb.1:
      %r0 = call @foo
      ... use %r0 ...
    ```

    After fixing unwind mismatches in CFGStackify, `bb.1` can be split and
    some instructions can be moved to a newly created BB:
    ```
    bb.1:
      %r0 = call @foo

    bb.split (new):
      ... use %r0 ...
    ```

    In this case we should make %r0 un-stackified, because its use is now in
    another BB.

    When spliting a BB, this CL unstackifies all def registers that have
    uses in the new split BB.

    Reviewers: dschuff

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

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68218 — aheejin / ViewSVN
  87. [OCaml] Handle nullptr in Llvm.global_initializer

    LLVMGetInitializer returns nullptr in case there is no
    initializer. There is not much that can be done with nullptr in OCaml,
    not even test if it is null. Also, there does not seem to be a C or
    OCaml API to test if there is an initializer. So this diff changes
    Llvm.global_initializer to return an option.

    Differential Revision: https://reviews.llvm.org/D65195
    Reviewed by: whitequark
    Authored by: kren1 — hiraditya / ViewSVN
  88. AMDGPU/GlobalISel: Select s1 src G_SITOFP/G_UITOFP — arsenm / ViewSVN
  89. Remove a undefined constructor introduced by r373244. — yuanfang / ViewSVN
  90. AMDGPU/GlobalISel: Add support for init.exec intrinsics

    TThe existing wave32 behavior seems broken and incomplete, but this
    reproduces it. — arsenm / ViewSVN
  91. AMDGPU/GlobalISel: Allow scc/vcc alternative mappings for s1 constants — arsenm / ViewSVN
  92. GlobalISel: Handle llvm.read_register

    SelectionDAG has a bunch of machinery to defer this to selection time
    for some reason. Just directly emit a copy during IRTranslator. The
    x86 usage does somewhat questionably check hasFP, which could depend
    on the whole function being at minimum translated.

    This does lose the convergent bit if the callsite had it, which may be
    a problem. We also lose that in general for intrinsics, which may also
    be a problem. — arsenm / ViewSVN
  93. AMDGPU/GlobalISel: Avoid creating shift of 0 in arg lowering

    This is sort of papering over the fact that we don't run a combiner
    anywhere, but avoiding creating 2 instructions in the first place is
    easy. — arsenm / ViewSVN
  94. TLI: Remove DAG argument from getRegisterByName

    Replace with the MachineFunction. X86 is the only user, and only uses
    it for the function. This removes one obstacle from using this in
    GlobalISel. The other is the more tolerable EVT argument.

    The X86 use of the function seems questionable to me. It checks hasFP,
    before frame lowering. — arsenm / ViewSVN
  95. [llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)

    D68110 added --arch-specific (supported by GNU readelf) and made
    --arm-attributes an alias for it. The tests were later migrated to use
    --arch-specific.

    Note, llvm-readelf --arch-specific currently just uses llvm-readobj
    style output for ARM attributes. The readelf-style output is not
    implemented.

    Reviewed By: compnerd, kongyi, rupprecht

    Differential Revision: https://reviews.llvm.org/D68196 — maskray / ViewSVN
  96. [X86] Add test case to show missed opportunity to shrink a constant index to a gather in order to avoid splitting.

    Also add a test case for an index that could be shrunk, but
    would create a narrow type. We can go ahead and do it we just
    need to be before type legalization.

    Similar test cases for scatter as well. — ctopper / ViewSVN
  97. Don't elide the use of the thread wrapper for a thread_local constinit
    variable with non-trivial destruction.

    We still need to invoke the thread wrapper to trigger registration of
    the destructor call on thread shutdown. — rsmith / ViewSVN
  98. AMDGPU/GlobalISel: Select G_UADDO/G_USUBO — arsenm / ViewSVN
  99. GlobalISel: Implement widenScalar for G_SITOFP/G_UITOFP sources

    Legalize 16-bit G_SITOFP/G_UITOFP for AMDGPU. — arsenm / ViewSVN
  100. AMDGPU/GlobalISel: Legalize G_GLOBAL_VALUE

    Handle other cases besides LDS. Mostly a straight port of the existing
    handling, without the intermediate custom nodes. — arsenm / ViewSVN

#5498 (Sep 30, 2019 5:38:30 PM)

  1. compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM

    Summary: Fixes https://github.com/google/oss-fuzz/issues/2836

    Reviewers: eugenis

    Subscribers: dberris, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68178 — Vitaly Buka / ViewSVN
  2. compiler-rt: move all __GLIBC_PREREQ into own header file

    Reviewers: eugenis

    Subscribers: dberris, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68177 — Vitaly Buka / ViewSVN
  3. Rename tsan_interceptors.cpp into tsan_interceptors_posix.cpp

    Summary:
    It's needed to use __GLIBC_PREREQ from <features.h>

    tsan didn't let us to include <features.h> by using --sysroot=. to disable system includes on
    anything that is not named as "tsan*posix*", "tsan*mac*", "tsan*linux*".
    See compiler-rt/lib/tsan/CMakeLists.txt

    Reviewers: eugenis, dvyukov, kcc

    Reviewed By: kcc

    Subscribers: mgorny, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68176 — Vitaly Buka / ViewSVN
  4. [c++20] Add a C++20 version of the existing turing machine test.

    Unlike the C++11 version, this one uese mutable state and dynamic
    allocation instead of a carefully balanced and ever-accumulating pile of
    temporaries. — rsmith / ViewSVN
  5. During constant evaluation, handle CXXBindTemporaryExprs for
    array-of-class types, not just for class types. — rsmith / ViewSVN
  6. DebugInfo: Add parsing support for debug_loc base address specifiers — dblaikie / ViewSVN
  7. [c++20] Fix crash when constant-evaluating an assignment with a
    reference member access on its left-hand side. — rsmith / ViewSVN
  8. Fix Driver/modules.cpp test to work when build directory name contains '.s'

    Reviewers: dyung, rsmith, hansw

    Subscribers: mati865, mgorny, cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D66176 — tstellar / ViewSVN
  9. [SimplifyLibCalls] Define the value of the Euler number

    This patch fixes the build break on Windows hosts.

    There must be a better way of accessing the equivalent POSIX math constant
    `M_E`. — evandro / ViewSVN
  10. DebugInfo: Simplify section label caching/usage — dblaikie / ViewSVN
  11. Fix crash on value-dependent delete-expressions.

    We used to miscompute the 'value-dependent' bit, and would crash if we
    tried to evaluate a delete expression that should be value-dependent. — rsmith / ViewSVN
  12. Add partial bswap test to the X86 backend. NFC — deadalnix / ViewSVN
  13. [DAGCombiner] Clang format MatchRotate. NFC — deadalnix / ViewSVN
  14. Make function static that didn't need linkage.

    In r373247 I added a helper function, but neglected to make it static. — erichkeane / ViewSVN
  15. Remove else-after-return — dblaikie / ViewSVN
  16. [bugpoint] Update runPasses to take ArrayRef instead of a pointer (NFC)

    This makes it slightly easier to pass extra arguments to runPasses
    and simplifies the code slightly.

    Reviewers: efriedma, bogner, dblaikie, diegotf, hiraditya

    Reviewed By: dblaikie, hiraditya

    Differential Revision: https://reviews.llvm.org/D68228 — fhahn / ViewSVN
  17. [globalisel][knownbits] Allow targets to call GISelKnownBits::computeKnownBitsImpl()

    Summary:
    It seems we missed that the target hook can't query the known-bits for the
    inputs to a target instruction. Fix that oversight

    Reviewers: aditya_nandakumar

    Subscribers: rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67380 — dsanders / ViewSVN
  18. Refactor default constructor SFINAE in pair and tuple.

    Refactor the  recent implicit default constructor changes to match the
    existing SFINAE style. — ericwf / ViewSVN
  19. [ConstantFolding] Fold constant calls to log2()

    Somehow, folding calls to `log2()` with a constant was missing.

    Differential revision: https://reviews.llvm.org/D67300 — evandro / ViewSVN
  20. [InstCombine] Expand the simplification of log()

    Expand the simplification of special cases of `log()` to include `log2()`
    and `log10()` as well as intrinsics and more types.

    Differential revision: https://reviews.llvm.org/D67199 — evandro / ViewSVN
  21. [DAGCombiner] Update MatchRotate so that it returns an SDValue. NFC — deadalnix / ViewSVN
  22. Fix failure caused by r373247

    I incorrectly thought that the 'isLambda' check never fired, so when
    splitting up a helper function, I lost the 'nullptr' return value.
    ClangD Hover functionality apparently uses this, so the Unittest caught
    that.

    This patch correctly propogates the nullptr from the helper function. — erichkeane / ViewSVN
  23. [NFC] Fix tests, second try — xbolva00 / ViewSVN
  24. [OPENMP50]Mark declare variant attribute as inheritable.

    Attribute must be inherited by the redeclarations. — abataev / ViewSVN
  25. [NFCI] Updated broken test — xbolva00 / ViewSVN
  26. [LegacyPassManager] Deprecate the BasicBlockPass/Manager.

    Summary:
    The BasicBlockManager is potentially broken and should not be used.
    Replace all uses of the BasicBlockPass with a FunctionBlockPass+loop on
    blocks.

    Reviewers: chandlerc

    Subscribers: jholewinski, sanjoy.google, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68234 — asbirlea / ViewSVN
  27. build: serialise `LLVM_ENABLE_UNWIND_TABLES` into LLVMConfig

    Serialize the value of the configuration option into the configuration so that
    builds which integrate LLVM can identify the value of the flag that was used to
    build the libraries.  This is intended to be used by Swift to control tests
    which rely on the unwind information. — Saleem Abdulrasool / ViewSVN
  28. [Diagnostics] Warn if enumeration type mismatch in conditional expression

    Summary:
    - Useful warning
    - GCC compatibility (GCC warns in C++ mode)

    Reviewers: rsmith, aaron.ballman

    Reviewed By: aaron.ballman

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D67919 — xbolva00 / ViewSVN
  29. [FunctionAttrs] Added noalias for memccpy/mempcpy arguments — xbolva00 / ViewSVN
  30. [InstCombine][NFC] visitShl(): call SimplifyQuery::getWithInstruction() once — lebedevri / ViewSVN
  31. [NFC][InstCombine] Redundant-left-shift-input-masking: add some more undef tests — lebedevri / ViewSVN
  32. Teach CallGraph to look into Generic Lambdas.

    CallGraph visited LambdaExpr by getting the Call Operator from
    CXXRecordDecl (LambdaExpr::getCallOperator calls
    CXXRecordDecl::getLambdaCallOperator), which replaced generic lambda
    call operators with the non-instantiated FunctionDecl.  The result was
    that the CallGraph would only pick up non-dependent calls.

    This patch does a few things:
    1- Extend CXXRecordDecl to have a getDependentLambdaCallOperator, which
    will get the FunctionTemplateDecl, rather than immediately getting the
    TemplateDecl.
    2- Define getLambdaCallOperator and getDependentLambdaCallOperator in
    terms of a common function.
    3- Extend LambdaExpr with a getDependentCallOperator, which just calls
    the above function.
    4- Changes CallGraph to handle Generic LambdaExprs. — erichkeane / ViewSVN
  33. [X86] Mask off upper bits of splat element in LowerBUILD_VECTORvXi1 when forming a SELECT.

    The i1 scalar would have been type legalized to i8, but that
    doesn't guarantee anything about the upper bits. If we're going
    to use it as condition we need to make sure the upper bits are 0.

    I've special cased ISD::SETCC conditions since that should
    guarantee zero upper bits. We could go further and use
    computeKnownBits, but we have no tests that would need that.

    Fixes PR43507. — ctopper / ViewSVN
  34. [X86] Address post-commit review from code I accidentally commited in r373136.

    See https://reviews.llvm.org/D68167 — ctopper / ViewSVN
  35. Fix build warning for r373240. — yuanfang / ViewSVN
  36. [OPENMP50]Do not emit warning for the function with the currently
    defined body.

    If the function is currently defined, we should not emit a warning that
    it might be emitted already because it was not really emitted. — abataev / ViewSVN
  37. Revert "[MC] Emit unused undefined symbol even if its binding is not set"

    This reverts r373168. It caused PR43511. — nico / ViewSVN
  38. [PGO] Don't group COMDAT variables for compiler generated profile variables in ELF

    With this patch, compiler generated profile variables will have its own COMDAT
    name for ELF format, which syncs the behavior with COFF. Tested with clang
    PGO bootstrap. This shows a modest reduction in object sizes in ELF format.

    Differential Revision: https://reviews.llvm.org/D68041 — xur / ViewSVN
  39. [NewPM] Port MachineModuleInfo to the new pass manager.

    Existing clients are converted to use MachineModuleInfoWrapperPass. The
    new interface is for defining a new pass manager API in CodeGen.

    Reviewers: fedor.sergeev, philip.pfaffe, chandlerc, arsenm

    Reviewed By: arsenm, fedor.sergeev

    Differential Revision: https://reviews.llvm.org/D64183 — yuanfang / ViewSVN
  40. [msan] Intercept __getrlimit.

    Summary:
    This interceptor is useful on its own, but the main purpose of this
    change is to intercept libpthread initialization on linux/glibc in
    order to run __msan_init before any .preinit_array constructors.

    We used to trigger on pthread_initialize_minimal -> getrlimit(), but
    that call has changed to __getrlimit at some point.

    Reviewers: vitalybuka, pcc

    Subscribers: jfb, #sanitizers, llvm-commits

    Tags: #sanitizers, #llvm

    Differential Revision: https://reviews.llvm.org/D68168 — eugenis / ViewSVN
  41. Fix buildbot failure from r373217 (don't match metadata id exactly)

    Fix this failure by ignoring the id of the metadata being checked:
        http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/3046/consoleFull#-21332887158254eaf0-7326-4999-85b0-388101f2d404 — tejohnson / ViewSVN
  42. [MCA] Use references to LSUnitBase in class Scheduler and add helper methods to acquire/release LS queue entries. NFCI — adibiagio / ViewSVN
  43. [LegacyPassManager] Attempt to fix BasicBlockManager

    Temporarily fix BaiscBlockManager based on the code in the other
    managers.
    Replacement of all uses of the BasicBlockPass to follow.

    Resolves PR42264. — asbirlea / ViewSVN
  44. [X86] Add ANY_EXTEND to switch in ReplaceNodeResults, but just fall back to default handling.

    ANY_EXTEND of v8i8 is marked Custom on AVX512 for handling extends
    from v8i8. But the type legalization infrastructure will call
    ReplaceNodeResults for v8i8 results. We should just defer it the
    default handling instead of asserting in the default of the switch.

    Fixes PR43509. — ctopper / ViewSVN
  45. [AArch64][SVE] Implement punpk[hi|lo] intrinsics

    Summary:
    Adds the following two intrinsics:
      - int_aarch64_sve_punpkhi
      - int_aarch64_sve_punpklo

    This patch also contains a fix which allows LLVMHalfElementsVectorType
    to forward reference overloadable arguments.

    Reviewers: sdesmalen, rovka, rengolin

    Reviewed By: sdesmalen

    Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, greened, cfe-commits, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D67830 — kmclaughlin / ViewSVN
  46. [EarlyCSE] Pass preserves AA. — asbirlea / ViewSVN
  47. [InstCombine] fold negate disguised as select+mul

      Name: negate if true
      %sel = select i1 %cond, i32 -1, i32 1
      %r = mul i32 %sel, %x
      =>
      %m = sub i32 0, %x
      %r = select i1 %cond, i32 %m, i32 %x

      Name: negate if false
      %sel = select i1 %cond, i32 1, i32 -1
      %r = mul i32 %sel, %x
      =>
      %m = sub i32 0, %x
      %r = select i1 %cond, i32 %x, i32 %m

    https://rise4fun.com/Alive/Nlh — spatel / ViewSVN
  48. Fix doc for t inline asm constraints for ARM/Thumb

    Summary: The constraint goes up to regs d15 and q7, not d16 and q8.

    Subscribers: kristof.beyls, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68090 — pabbar01 / ViewSVN
  49. [AArch64][GlobalISel] Support lowering variadic musttail calls

    This adds support for lowering variadic musttail calls. To do this, we have
    to...

    - Detect a musttail call in a variadic function before attempting to lower the
      call's formal arguments. This is done in the IRTranslator.
    - Compute forwarded registers in `lowerFormalArguments`, and add copies for
      those registers.
    - Restore the forwarded registers in `lowerTailCall`.

    Because there doesn't seem to be any nice way to wrap these up into the outgoing
    argument handler, the restore code in `lowerTailCall` is done separately.

    Also, irritatingly, you have to make sure that the registers don't overlap with
    any passed parameters. Otherwise, the scheduler doesn't know what to do with the
    extra copies and asserts.

    Add call-translator-variadic-musttail.ll to test this. This is pretty much the
    same as the X86 musttail-varargs.ll test. We didn't have as nice of a test to
    base this off of, but the idea is the same.

    Differential Revision: https://reviews.llvm.org/D68043 — paquette / ViewSVN
  50. [mips] Fix code indentation. NFC — atanasyan / ViewSVN
  51. Add tests for rotate with demanded bits. NFC — deadalnix / ViewSVN
  52. [InstCombine] add tests for negate disguised as mul; NFC — spatel / ViewSVN
  53. [AMDGPU] SIFoldOperands should not fold register acrocc the EXEC definition

          Reviewers: rampitec

          Differential Revision: https://reviews.llvm.org/D67662 — alex-t / ViewSVN
  54. [SSP] [3/3] cmpxchg and addrspacecast instructions can now
    trigger stack protectors.  Fixes PR42238.

    Add test coverage for llvm.memset, as proxy for all llvm.mem*
    intrinsics. There are two issues here: (1) they could be lowered to a
    libc call, which could be intercepted, and do Bad Stuff; (2) with a
    non-constant size, they could overwrite the current stack frame.

    The test was mostly written by Matt Arsenault in r363169, which was
    later reverted; I tweaked what he had and added the llvm.memset part.

    Differential Revision: https://reviews.llvm.org/D67845 — probinson / ViewSVN
  55. [SSP] [2/3] Refactor an if/dyn_cast chain to switch on opcode. NFC

    Differential Revision: https://reviews.llvm.org/D67844 — probinson / ViewSVN
  56. [Clang] Use -main-file-name for source filename if not set

    -main-file-name is currently used to set the source name used in debug
    information.

    If the source filename is "-" and -main-file-name is set, then use the
    filename also for source_filename and ModuleID of the output.

    The argument is generally used outside the internal clang calls when
    running clang in a wrapper like icecc which gives the source via stdin
    but still wants to get a object file with the original source filename
    both in debug info and IR code.

    Patch by: the_jk (Joel Klinghed)

    Differential Revision: https://reviews.llvm.org/D67592 — tejohnson / ViewSVN
  57. [SSP] [1/3] Revert "StackProtector: Use PointerMayBeCaptured"
    "Captured" and "relevant to Stack Protector" are not the same thing.

    This reverts commit f29366b1f594f48465c5a2754bcffac6d70fd0b1.
    aka r363169.

    Differential Revision: https://reviews.llvm.org/D67842 — probinson / ViewSVN
  58. Fix breakage of sphinx builders. Sorry for leaving this broken over the
    weekend! — kpn / ViewSVN
  59. Support MemoryLocation::UnknownSize in TargetLowering::IntrinsicInfo

    Summary:
    Previously IntrinsicInfo::size was an unsigned what can't represent the
    64 bit value used by MemoryLocation::UnknownSize.

    Reviewers: jmolloy

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68219 — tberghammer / ViewSVN
  60. Correct function declarations; NFC.

    This header is included by C code so the functions need to have a prototype. Also, fix the function definitions so that they have C linkage rather than C++ linkage. — aaronballman / ViewSVN
  61. [FileCheck] Remove implementation types from API

    Summary:
    Remove use of FileCheckPatternContext and FileCheckString concrete types
    from FileCheck API to allow moving it and the other implementation only
    only declarations into a private header file.

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

    Subscribers: hiraditya, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68186 — thopre / ViewSVN
  62. [OPENMP] Fix comment, NFC. — abataev / ViewSVN
  63. [llvm-exegesis][NFC] Move BenchmarkFailure to own file.

    Summary: And rename to exegesis::Failure, as it's used everytwhere.

    Reviewers: gchatelet

    Subscribers: tschuett, llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D68217 — courbet / ViewSVN
  64. [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

    Summary:
    This is patch is part of a series to introduce an Alignment type.
    See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/