1. Mar 12, 2020
    • Nicolas Vasilache's avatar
      [mlir][CRunnerUtils] Enable compilation with C++11 toolchain on microcontroller platforms. · 8093e31e
      Nicolas Vasilache authored
      Summary:
      The C runner utils API was still not vanilla enough for certain use
      cases on embedded ARM SDKs, this enables such cases.
      
      Adding people more widely for historical Windows related build issues.
      
      Differential Revision: https://reviews.llvm.org/D76031
      8093e31e
    • Andrzej Warzynski's avatar
      [AArch64][SVE] Add intrinsics for non-temporal scatters/gathers · 46b9f14d
      Andrzej Warzynski authored
      Summary:
      This patch adds the following intrinsics for non-temporal gather loads
      and scatter stores:
        * aarch64_sve_ldnt1_gather_index
        * aarch64_sve_stnt1_scatter_index
      These intrinsics implement the "scalar + vector of indices" addressing
      mode.
      
      As opposed to regular and first-faulting gathers/scatters, there's no
      instruction that would take indices and then scale them. Instead, the
      indices for non-temporal gathers/scatters are scaled before the
      intrinsics are lowered to `ldnt1` instructions.
      
      The new ISD nodes, GLDNT1_INDEX and SSTNT1_INDEX, are only used as
      placeholders so that we can easily identify the cases implemented in
      this patch in performGatherLoadCombine and performScatterStoreCombined.
      Once encountered, they are replaced with:
        * GLDNT1_INDEX -> SPLAT_VECTOR + SHL + GLDNT1
        * SSTNT1_INDEX -> SPLAT_VECTOR + SHL + SSTNT1
      
      The patterns for lowering ISD::SHL for scalable vectors (required by
      this patch) were missing, so these are added too.
      
      Reviewed By: sdesmalen
      
      Differential Revision: https://reviews.llvm.org/D75601
      46b9f14d
    • Sanjay Patel's avatar
      [InstSimplify] simplify FP ops harder with FMF (part 2) · a66dc755
      Sanjay Patel authored
      This is part of the IR sibling for:
      D75576
      
      Related transform committed with:
      rG8ec71585
      a66dc755
    • Sergej Jaskiewicz's avatar
      [libcxxabi] Set LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX to ON if... · 43252c1b
      Sergej Jaskiewicz authored
      [libcxxabi] Set LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX to ON if LIBCXX_ENABLE_SHARED is not defined
      
      Differential Revision: https://reviews.llvm.org/D71894
      43252c1b
    • Sven van Haastregt's avatar
      592cec70
    • Tatyana Krasnukha's avatar
      [lldb] Clear all settings during a test's setUp · df90a15b
      Tatyana Krasnukha authored
      Global properties are shared between debugger instances and
      if a test doesn't clear changes in settings it made,
      this leads to side effects in other tests.
      
      Differential Revision: https://reviews.llvm.org/D75537
      df90a15b
    • Sanjay Patel's avatar
      [InstSimplify] simplify FP ops harder with FMF · 8ec71585
      Sanjay Patel authored
      This is part of the IR sibling for:
      D75576
      
      (I'm splitting part of the transform as a separate commit
      to reduce risk. I don't know of any bugs that might be
      exposed by this improved folding, but it's hard to see
      those in advance...)
      8ec71585
    • Simon Pilgrim's avatar
      [X86] Add FeatureFast7ByteNOP flag · 1e686d26
      Simon Pilgrim authored
      Lets us remove another SLM proc family flag usage.
      
      This is NFC, but we should probably check whether atom/glm/knl? should be using this flag as well...
      1e686d26
    • Sam McCall's avatar
      966cad0c
    • Simon Pilgrim's avatar
      fa8ce7c0
    • Sanjay Patel's avatar
      dea2b93a
    • Nico Weber's avatar
      Use `grep -F` instead of deprecated fgrep. · e51d4df4
      Nico Weber authored
      (In addition to the deprecation bit, this is useful on Windows
      where people might have grep but not fgrep.)
      e51d4df4
    • Sanjay Patel's avatar
      [InstSimplify] add tests for FP poison; NFC · d748e759
      Sanjay Patel authored
      Adapted from codegen tests seen in D75576.
      d748e759
    • Luke Drummond's avatar
      [lldb] reject `.debug_arange` sections with nonzero segment size · 0fa33209
      Luke Drummond authored
      If a producer emits a nonzero segment size, `lldb` will silently read
      incorrect values and crash, or do something worse later as the tuple
      size is expected to be 2, rather than 3.
      
      Neither LLVM, nor GCC produce segmented aranges, but this dangerous case
      should still be checked and handled.
      
      Reviewed by: clayborg, labath
      Differential Revision: https://reviews.llvm.org/D75925
      Subscribers: lldb-commits
      Tags: #lldb
      0fa33209
    • Florian Hahn's avatar
      [SCCP] Use ValueLatticeElement instead of LatticeVal (NFCI) · f1ac5d22
      Florian Hahn authored
      This patch switches SCCP to use ValueLatticeElement for lattice values,
      instead of the local LatticeVal, as first step to enable integer range support.
      
      This patch does not make use of constant ranges for additional operations
      and the only difference for now is that integer constants are represented by
      single element ranges. To preserve the existing behavior, the following helpers
      are used
      
      * isConstant(LV): returns true when LV is either a constant or a constant range with a single element. This should return true in the same cases where LV.isConstant() returned true previously.
      * getConstant(LV): returns a constant if LV is either a constant or a constant range with a single element. This should return a constant in the same cases as LV.getConstant() previously.
      * getConstantInt(LV): same as getConstant, but additionally casted to ConstantInt.
      
      Reviewers: davide, efriedma, mssimpso
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D60582
      f1ac5d22
    • LLVM GN Syncbot's avatar
      [gn build] Port d5edcb90 · f31f22ef
      LLVM GN Syncbot authored
      f31f22ef
    • Dylan McKay's avatar
      [AVR] Fix reads of uninitialized variables from constructor of AVRSubtarget · 2cf4b4de
      Dylan McKay authored
      The initialization order was not correct. These bugs were discovered by
      valgrind. They appear to work fine in practice but this patch should
      unblock switching the AVR backend on by default as now a standard AVR
      llc invocation runs without memory errors.
      
      The AVRISelLowering constructor would run before the subtarget boolean
      fields were initialized to false. Now, the initialization order is
      correct.
      2cf4b4de
    • Roman Lebedev's avatar
      [clang] Prune 'IsOMPStructuredBlock' Stmt bit · d5edcb90
      Roman Lebedev authored
      As discussed in https://reviews.llvm.org/D59214#1916596
      and in some other reviews dealing with FPenv,
      bits in Stmt are scarce, and i got so burnout with D59214
      and https://bugs.llvm.org/show_bug.cgi?id=40563 specifically
      that i never actually followed up with the usages for this bit.
      
      So let's unhoard it, at least for now?
      d5edcb90
    • Simon Pilgrim's avatar
      [X86] combineOrShiftToFunnelShift - remove shift by immediate handling. · 4689eae8
      Simon Pilgrim authored
      Now that D75114 has landed, DAGCombiner handles this case so the code is redundant.
      4689eae8
    • Simon Tatham's avatar
      [ARM,MVE] Add intrinsics and isel for MVE fused multiply-add. · 3f8e714e
      Simon Tatham authored
      Summary:
      This adds the ACLE intrinsic family for the VFMA and VFMS
      instructions, which perform fused multiply-add on vectors of floats.
      
      I've represented the unpredicated versions in IR using the cross-
      platform `@llvm.fma` IR intrinsic. We already had isel rules to
      convert one of those into a vector VFMA in the simplest possible way;
      but we didn't have rules to detect a negated argument and turn it into
      VFMS, or rules to detect a splat argument and turn it into one of the
      two vector/scalar forms of the instruction. Now we have all of those.
      
      The predicated form uses a target-specific intrinsic as usual, but
      I've stuck to just one, for a predicated FMA. The subtraction and
      splat versions are code-generated by passing an fneg or a splat as one
      of its operands, the same way as the unpredicated version.
      
      In arm_mve_defs.h, I've had to introduce a tiny extra piece of
      infrastructure: a record `id` for use in codegen dags which implements
      the identity function. (Just because you can't declare a Tablegen
      value of type dag which is //only// a `$varname`: you have to wrap it
      in something. Now I can write `(id $varname)` to get the same effect.)
      
      Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard
      
      Reviewed By: dmgreen
      
      Subscribers: kristof.beyls, hiraditya, danielkiss, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D75998
      3f8e714e
    • Simon Tatham's avatar
      [ARM,MVE] Fix user-namespace violation in arm_mve.h. · d608fee8
      Simon Tatham authored
      Summary:
      We were generating the declarations of polymorphic intrinsics using
      `__attribute__((overloadable))`. But `overloadable` is a valid
      identifier for an end user to define as a macro in a C program, and if
      they do that before including `<arm_mve.h>`, then we shouldn't cause a
      compile error.
      
      Fixed to spell the attribute name `__overloadable__` instead.
      
      Reviewers: miyuki, MarkMurrayARM, ostannard
      
      Reviewed By: miyuki
      
      Subscribers: kristof.beyls, dmgreen, danielkiss, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D75997
      d608fee8
    • Dylan McKay's avatar
      [AVR] Fix read of uninitialized variable AVRSubtarget:::ELFArch · 13be2748
      Dylan McKay authored
      Found by the LLVM MemorySanitizer tests when switching AVR to a default
      backend.
      
      ELFArch must be initialized before the call to
      initializeSubtargetDependencies().
      
      The uninitialized read would occur deep within TableGen'd code.
      13be2748
    • Sam McCall's avatar
      [clangd] Redirect documentation to clangd.llvm.org. · 57e81a2f
      Sam McCall authored
      Reviewers: hokein
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D76053
      57e81a2f
    • Max Kazantsev's avatar
      [LoopPeel] Turn incorrect assert into a check · 3dc6e53c
      Max Kazantsev authored
      Summary:
      This patch replaces incorrectt assert with a check. Previously it asserts that
      if SCEV cannot prove `isKnownPredicate(A != B)`, then it should be able to prove
      `isKnownPredicate(A == B)`.
      
      Both these fact may be not provable. It is shown in the provided test:
      
      Could not prove: `{-294,+,-2}<%bb1> !=  0`
      Asserting: `{-294,+,-2}<%bb1> == 0`
      
      Obviously, this SCEV is not equal to zero, but 0 is in its range so we cannot
      also prove that it is not zero.
      
      Instead of assert, we should be checking the required conditions explicitly.
      
      Reviewers: lebedev.ri, fhahn, sanjoy, fedor.sergeev
      Reviewed By: lebedev.ri
      Subscribers: hiraditya, zzheng, javed.absar, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D76050
      3dc6e53c
    • Marcel Hlopko's avatar
      [AST] Respect shouldTraversePostOrder when traversing type locs · b7205439
      Marcel Hlopko authored
      Summary: Copy of https://reviews.llvm.org/D72072, submitting with ilya-biryukov's permission.
      
      Reviewers: gribozavr2
      
      Reviewed By: gribozavr2
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D76001
      b7205439
    • Marek Kurdej's avatar
      [libc++] [P0646] Add feature-test macro for __cpp_lib_list_remove_return_type. · 05343588
      Marek Kurdej authored
      Summary: The return type modification has already been implemented in rL364840 and rL365290.
      
      Reviewers: ldionne, mclow.lists, EricWF, #libc!
      
      Reviewed By: ldionne
      
      Subscribers: christof, dexonsmith, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D70275
      05343588
    • Tyker's avatar
      Basis of dropping uses in llvm.assume. · f16f139d
      Tyker authored
      Summary: This patch adds the basic utilities to deal with dropable uses. dropable uses are uses that we rather drop than prevent transformations, for now they are limited to uses in llvm.assume.
      
      Reviewers: jdoerfert, sstefan1
      
      Reviewed By: jdoerfert
      
      Subscribers: uenoku, lebedev.ri, mgorny, hiraditya, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73404
      f16f139d
    • Tyker's avatar
      [NFC] Add filters to hasNItems and hasNItemsOrMore · 61211fec
      Tyker authored
      Reviewers: lebedev.ri, jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: jdoerfert, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74967
      61211fec
    • Qiu Chaofan's avatar
      [PowerPC] Add strict-fp intrinsic to FP arithmetic · 096d5453
      Qiu Chaofan authored
      This patch adds basic strict-fp intrinsics support to PowerPC backend,
      including basic arithmetic operations (add/sub/mul/div).
      
      Reviewed By: steven.zhang, andrew.w.kaylor
      
      Differential Revision: https://reviews.llvm.org/D63916
      096d5453
    • Roman Lebedev's avatar
      [SCEV] isHighCostExpansionHelper(): use correct TTI hooks · 8737dc2d
      Roman Lebedev authored
      Summary:
      Cost modelling strikes again.
      In PR44668 <https://bugs.llvm.org/show_bug.cgi?id=44668> patch series,
      i've made the same mistake of always using generic `getOperationCost()`
      that i missed in reviewing D73480/D74495 which was later fixed
      in 62dd44d7.
      
      We should be using more specific hooks instead - `getCastInstrCost()`,
      `getArithmeticInstrCost()`, `getCmpSelInstrCost()`.
      
      Evidently, this does not have an effect on the existing testcases,
      with unchanged default cost budget. But if it *does* have an effect
      on some target, we'll have to segregate tests that use this function
      per-target, much like we already do with other TTI-aware transform tests.
      
      There's also an issue that @samparker has brought up in post-commit-review:
      >>! In D73501#1905171, @samparker wrote:
      > Hi,
      > Did you get performance numbers for these patches? We track the performance
      > of our (Arm) open source DSP library and the cost model fixes were generally
      > a notable improvement, so many thanks for that! But the final patch
      > for rewriting exit values has generally been bad, especially considering
      > the gains from the modelling improvements. I need to look into it further,
      > but on my current test case I'm seeing +30% increase in stack accesses
      > with a similar decrease in performance.
      > I'm just wondering if you observed any negative effects yourself?
      
      I don't know if this addresses that, or we need D66450 for that.
      
      Reviewers: samparker, spatel, mkazantsev, reames, wmi
      
      Reviewed By: reames
      
      Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits, samparker
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75908
      8737dc2d
    • Dominik Montada's avatar
      [GlobalISel] fix crash in narrowScalarExtract if DstRegs only has one register · 6b96623d
      Dominik Montada authored
      Summary: When narrowing a scalar G_EXTRACT where the destination lines up perfectly with a single result of the emitted G_UNMERGE_VALUES a COPY should be emitted instead of unconditionally trying to emit a G_MERGE_VALUES.
      
      Reviewers: arsenm, dsanders
      
      Reviewed By: arsenm
      
      Subscribers: wdng, rovka, hiraditya, volkan, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75743
      6b96623d
    • Sebastian Neubauer's avatar
      [AMDGPU] Use progbits type for .AMDGPU.disasm section · 4327a9b4
      Sebastian Neubauer authored
      The note section type implies a specific format that this section does
      not have thus tools like readelf fail here. Progbits has no format and
      another pipeline compiler already sets the type to progbits.
      
      Differential Revision: https://reviews.llvm.org/D75913
      4327a9b4
    • Clement Courbet's avatar
      [ExpandMemCmp][NFC] Add more tests. · 4edd050c
      Clement Courbet authored
      4edd050c
    • Tres Popp's avatar
      Remove unused variable. · bbe67647
      Tres Popp authored
      Delete dead code from 8fffa404.
      bbe67647
    • Shengchen Kan's avatar
      [X86] Reduce the number of emitted fragments due to branch align · 3a503ce6
      Shengchen Kan authored
      Summary:
      Currently, a BoundaryAlign fragment may be inserted after the branch
      that needs to be aligned to truncate the current fragment, this fragment is
      unused at most of time. To avoid that, we can insert a new empty Data
      fragment instead. Non-relaxable instruction is usually emitted into Data
      fragment, so the inserted empty Data fragment will be reused at a high
      possibility.
      
      Reviewers: annita.zhang, reames, MaskRay, craig.topper, LuoYuanke, jyknight
      
      Reviewed By: reames, LuoYuanke
      
      Subscribers: llvm-commits, dexonsmith, hiraditya
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75438
      3a503ce6
    • Juneyoung Lee's avatar
    • Djordje Todorovic's avatar
      [DebugInfo] Fix build failure on the mingw · 3b984641
      Djordje Todorovic authored
      Add the workaround for the X86::MOV16ri when describing call site
      parameters.
      3b984641
    • Dylan McKay's avatar
      Revert "[AVR] Include AVR by default in LLVM builds" · 9059056e
      Dylan McKay authored
      This reverts commit dfecec65.
      
      Merging the change revealed that there is a failure on the memory
      sanitizer bots.
      
          Command Output (stderr):
          --
          ==3569==WARNING: MemorySanitizer: use-of-uninitialized-value
              #0 0x1d71bff in
                 llvm::AVRSubtarget::ParseSubtargetFeatures(llvm::StringRef,
          llvm::StringRef)
          /b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/lib/Target/AVR/AVRGenSubtargetInfo.inc:471:7
              #1 0x1d721f8 in initializeSubtargetDependencies
                 /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/AVR/AVRSubtarget.cpp:50:3
              #2 0x1d721f8 in llvm::AVRSubtarget::AVRSubtarget(llvm::Triple
                 const&, std::__1::basic_string<char, std::__1::char_traits<char>,
          std::__1::allocator<char> > const&, std::__1::basic_string<char,
          std::__1::char_traits<char>, std::__1::allocator<char> > const&,
          llvm::AVRTargetMachine const&)
          /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/AVR/AVRSubtarget.cpp:33:18
              #3 0x1d3077f in
                 llvm::AVRTargetMachine::AVRTargetMachine(llvm::Target const&,
          llvm::Triple const&, llvm::StringRef, llvm::StringRef,
          llvm::TargetOptions const&, llvm::Optional<llvm::Reloc::Model>,
          llvm::Optional<llvm::CodeModel::Model>, llvm::CodeGenOpt::Level, bool)
          /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/AVR/AVRTargetMachine.cpp:52:7
              #4 0x1d3169d in
                 llvm::RegisterTargetMachine<llvm::AVRTargetMachine>::Allocator(llvm::Target
          const&, llvm::Triple const&, llvm::StringRef, llvm::StringRef,
          llvm::TargetOptions const&, llvm::Optional<llvm::Reloc::Model>,
          llvm::Optional<llvm::CodeModel::Model>, llvm::CodeGenOpt::Level, bool)
          /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/TargetRegistry.h:1121:16
              #5 0x86662f in createTargetMachine
                 /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/TargetRegistry.h:402:12
              #6 0x86662f in compileModule(char**, llvm::LLVMContext&)
                 /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:473:52
              #7 0x861f42 in main
                 /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:356:22
              #8 0x7f76f7b072e0 in __libc_start_main
                 (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
              #9 0x7ebbc9 in _start
                 (/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llc+0x7ebbc9)
      
          SUMMARY: MemorySanitizer: use-of-uninitialized-value
          /b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/lib/Target/AVR/AVRGenSubtargetInfo.inc:471:7
          in llvm::AVRSubtarget::ParseSubtargetFeatures(llvm::StringRef,
          llvm::StringRef)
          Exiting
          FileCheck error: '<stdin>' is empty.
          --
      
      The patch wiill be re-committed once fixed.
      9059056e
    • Dylan McKay's avatar
      [AVR] Include AVR by default in LLVM builds · dfecec65
      Dylan McKay authored
      Summary:
      This patch makes the AVR backend an official target of LLVM, serving
      as a request for comments for moving the AVR backend out of
      experimental.
      
      A future patch will move the LLVM AVR buildbot (llvm-avr-linux) from the
      staging buildmaster to the production buildmaster, so error emails will
      start to go out.
      
      Summary of the backend
      ----------------------
      
        - 16-bit little endian
        - AsmParser based assembly parser
        - uses the MC library for generating AVR ELFs
        - most logic driven from standard TableGen-erated tables like other
          backends
        - passes all of the test suite under `check-all`, including generic
          CodeGen and DebugInfo tests
        - Used in two frontends
        - Limited, but functional support for DebugInfo and LLVM DWARF dumping
        - Binary compatible with AVR-GCC and avr-{libc,libgcc} for the most part
        - Cannot lower 32-bit shifts due to a bug, can lower shifts larger or
          smaller
        - Supports assembly/MC for all the entire AVR ISA, generally generates poorly
          optimized machine instructions, with most focus thus far on correctness
      
      I've added reviewers and subscribers from previous patches where backends were made official,
      and those who participated in the recent thread on llvm-dev, please add anybody I've missed.
      
      The most recent discussion on this topic can be found in the llvm-dev thread [Moving the AVR backend out of experimental](https://lists.llvm.org/pipermail/llvm-dev/2020-February/139158.html)
      
      Reviewers: chandlerc, lattner, rengolin, tstellar, arsenm, thakis, simoll, asb
      
      Reviewed By: rengolin, thakis
      
      Subscribers: CryZe, wdng, mgorny, aprantl, Jim, hans, aykevl, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75099
      dfecec65
    • LLVM GN Syncbot's avatar
      [gn build] Port 518292db · 9dd561d8
      LLVM GN Syncbot authored
      9dd561d8