1. Dec 17, 2020
    • Jez Ng's avatar
      [lld-macho] Use LC_LOAD_WEAK_DYLIB for dylibs with only weakrefs · 4c8276cd
      Jez Ng authored
      Note that dylibs without *any* refs will still be loaded in the usual
      (strong) fashion.
      
      Reviewed By: #lld-macho, thakis
      
      Differential Revision: https://reviews.llvm.org/D93435
      4c8276cd
    • Jez Ng's avatar
      [lld-macho] Add support for weak references · 811444d7
      Jez Ng authored
      Weak references need not necessarily be satisfied at runtime (but they must
      still be satisfied at link time). So symbol resolution still works as per usual,
      but we now pass around a flag -- ultimately emitting it in the bind table -- to
      indicate if a given dylib symbol is a weak reference.
      
      ld64's behavior for symbols that have both weak and strong references is
      a bit bizarre. For non-function symbols, it will emit a weak import. For
      function symbols (those referenced by BRANCH relocs), it will emit a
      regular import. I'm not sure what value there is in that behavior, and
      since emulating it will make our implementation more complex, I've
      decided to treat regular weakrefs like function symbol ones for now.
      
      Fixes PR48511.
      
      Reviewed By: #lld-macho, thakis
      
      Differential Revision: https://reviews.llvm.org/D93369
      811444d7
    • Lucas Prates's avatar
      [ARM] Adding v8.7-A command-line support for the ARM target · c5046ebd
      Lucas Prates authored
      This extends the command-line support for the 'armv8.7-a' architecture
      name to the ARM target.
      
      Based on a patch written by Momchil Velikov.
      
      Reviewed By: ostannard
      
      Differential Revision: https://reviews.llvm.org/D93231
      c5046ebd
    • Lucas Prates's avatar
      [ARM][AAarch64] Initial command-line support for v8.7-A · c4d851b0
      Lucas Prates authored
      This introduces command-line support for the 'armv8.7-a' architecture name
      (and an alias without the '-', as usual), and for the 'ls64' extension name.
      
      Based on patches written by Simon Tatham.
      
      Reviewed By: ostannard
      
      Differential Revision: https://reviews.llvm.org/D91776
      c4d851b0
    • Lucas Prates's avatar
      [AArch64] Adding the v8.7-A LD64B/ST64B Accelerator extension · 31388919
      Lucas Prates authored
      This adds support for the v8.7-A LD64B/ST64B Accelerator extension
      through a subtarget feature called "ls64". It adds four 64-byte
      load/store instructions with an operand in the new GPR64x8 register
      class, and one system register that's part of the same extension.
      
      Based on patches written by Simon Tatham.
      
      Reviewed By: ostannard
      
      Differential Revision: https://reviews.llvm.org/D91775
      31388919
    • Lucas Prates's avatar
      [AArch64] Add a GPR64x8 register class · 97c006aa
      Lucas Prates authored
      This adds a GPR64x8 register class that will be needed as the data
      operand to the LD64B/ST64B family of instructions in the v8.7-A
      Accelerator Extension, which load or store a contiguous range of eight
      x-regs. It has to be its own register class so that register allocation
      will have visibility of the full set of registers actually read/written
      by the instructions, which will be needed when we add intrinsics and/or
      inline asm access to this piece of architecture.
      
      Patch written by Simon Tatham.
      
      Reviewed By: ostannard
      
      Differential Revision: https://reviews.llvm.org/D91774
      97c006aa
    • Lucas Prates's avatar
      [ARM][AArch64] Adding basic support for the v8.7-A architecture · 42b92b31
      Lucas Prates authored
      This introduces support for the v8.7-A architecture through a new
      subtarget feature called "v8.7a". It adds two new "WFET" and "WFIT"
      instructions, the nXS limited-TLB-maintenance qualifier for DSB and TLBI
      instructions, a new CPU id register, ID_AA64ISAR2_EL1, and the new
      HCRX_EL2 system register.
      
      Based on patches written by Simon Tatham and Victor Campos.
      
      Reviewed By: ostannard
      
      Differential Revision: https://reviews.llvm.org/D91772
      42b92b31
    • Lucas Prates's avatar
      [NFC][AArch64] Capturing multiple feature requirements in AsmParser messages · 83ea17fc
      Lucas Prates authored
      This enables the capturing of multiple required features in the AArch64
      AsmParser's SysAlias error messages.
      
      Reviewed By: ostannard
      
      Differential Revision: https://reviews.llvm.org/D92388
      83ea17fc
    • Lucas Prates's avatar
      [NFC][AArch64] Move AArch64 MSR/MRS into a new decoder namespace · b5bbb4b2
      Lucas Prates authored
      This removes the general forms of the AArch64 MSR and MRS instructions
      from the same decoding table that contains many more specific
      instructions that supersede them. They're now in a separate decoding
      table of their own, called "Fallback", which is only consulted in the
      event of the main decoder table failing to produce an answer.
      
      This should avoid decoding conflicts on future specialized instructions
      in the MSR space.
      
      Patch written by Simon Tatham.
      
      Reviewed By: ostannard
      
      Differential Revision: https://reviews.llvm.org/D91771
      b5bbb4b2
    • Florian Hahn's avatar
      [IRBuilder] Generalize debug loc handling for arbitrary metadata. · 29077ae8
      Florian Hahn authored
      This patch extends IRBuilder to allow adding/preserving arbitrary
      metadata on created instructions.
      
      Instead of using references to specific metadata nodes (like DebugLoc),
      IRbuilder now keeps a vector of (metadata kind, MDNode *) pairs, which
      are added to each created instruction.
      
      The patch itself is a NFC and only moves the existing debug location
      handling over to the new system. In a follow-up patch it will be used to
      preserve !annotation metadata besides !dbg.
      
      The current approach requires iterating over MetadataToCopy to avoid
      adding duplicates, but given that the number of metadata kinds to
      copy/preserve is going to be very small initially (0, 1 (for !dbg) or 2
      (!dbg and !annotation)) that should not matter.
      
      Reviewed By: lebedev.ri
      
      Differential Revision: https://reviews.llvm.org/D93400
      29077ae8
    • Guillaume Chatelet's avatar
      [libc] revamp memory function benchmark · deae7e98
      Guillaume Chatelet authored
      The benchmarking infrastructure can now run in two modes:
       - Sweep Mode: which generates a ramp of size values (same as before),
       - Distribution Mode: allows the user to select a distribution for the size paramater that is representative from production.
      
      The analysis tool has also been updated to handle both modes.
      
      Differential Revision: https://reviews.llvm.org/D93210
      deae7e98
    • Pavel Labath's avatar
      [lldb-vscode] Speculative fix for raciness in TestVSCode_attach · e7a3c4c1
      Pavel Labath authored
      The test appears to expect the inferior to be stopped, but the custom
      "attach commands" leave it in a running state.
      
      It's unclear how this could have ever worked.
      e7a3c4c1
    • Alex Zinenko's avatar
      eb4917d1
    • Michał Górny's avatar
    • Michał Górny's avatar
    • Cullen Rhodes's avatar
      [LV] Disable epilogue vectorization for scalable VFs · 1fd3a047
      Cullen Rhodes authored
      Epilogue vectorization doesn't support scalable vectorization factors
      yet, disable it for now.
      
      Reviewed By: sdesmalen, bmahjour
      
      Differential Revision: https://reviews.llvm.org/D93063
      1fd3a047
    • Simon Pilgrim's avatar
      [DebugInfo] Fix MSVC build by adding back necessary reverse_iterator != operator · 2d6b1e9b
      Simon Pilgrim authored
      Put back the std::reverse_iterator<DWARFDie::iterator> != operator that was removed in D78938 to fix VS2019 builds
      2d6b1e9b
    • Sam McCall's avatar
      [clangd] Add llvm:: qualifier to work around GCC bug. NFC · 894c4761
      Sam McCall authored
      Some old GCC versions seem to miss the default template parameter when
      using the clang/Basic/LLVM.h forward declarations of SmallVector.
      
      See D92788
      894c4761
    • Kerry McLaughlin's avatar
    • Martin Storsjö's avatar
    • Alex Zinenko's avatar
      [mlir] Move LLVM Dialect Op documentation to ODS · ccdd8c77
      Alex Zinenko authored
      This was long overdue. The initial documentation for the LLVM dialect was
      introduced before ODS had support for long descriptions. This is now possible,
      so the documentation is moved to ODS, which can serve as a single source of
      truth. The high-level description of the dialect structure is updated to
      reflect that.
      
      Depends On: D93315
      
      Reviewed By: rriddle, mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D93425
      ccdd8c77
    • Alex Zinenko's avatar
      [mlir] partially update LLVM dialect documentation · c2751250
      Alex Zinenko authored
      Rewrite the parts of the documentation that became stale: context/module
      handling and type system. Expand the type system description.
      
      Reviewed By: nicolasvasilache
      
      Differential Revision: https://reviews.llvm.org/D93315
      c2751250
    • Kerry McLaughlin's avatar
      [SVE][CodeGen] Add bfloat16 support to scalable masked gather · 6d2a7899
      Kerry McLaughlin authored
      Reviewed By: david-arm
      
      Differential Revision: https://reviews.llvm.org/D93307
      6d2a7899
    • dfukalov's avatar
      [NFC] Reduce include files dependency and AA header cleanup (part 2). · 9ed8e0ca
      dfukalov authored
      Continuing work started in https://reviews.llvm.org/D92489:
      
      Removed a bunch of includes from "AliasAnalysis.h" and "LoopPassManager.h".
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D92852
      9ed8e0ca
    • Simon Pilgrim's avatar
      [X86] Remove extract_subvector(subv_broadcast_load()) fold. · 931e66bd
      Simon Pilgrim authored
      This was needed in an earlier version of D92645, but isn't now - and I've just noticed that it was potentially flawed depending on the relevant widths of the broadcasted and extracted subvectors.
      931e66bd
    • Krasimir Georgiev's avatar
      e71a4cc2
    • Raphael Isemann's avatar
      [lldb] Add std::array to the supported template list of the CxxModuleHandler · b8338983
      Raphael Isemann authored
      Identical to the other patches that add STL containers to the supported
      templated list.
      b8338983
    • Barry Revzin's avatar
      Make LLVM build in C++20 mode · 92310454
      Barry Revzin authored
      Part of the <=> changes in C++20 make certain patterns of writing equality
      operators ambiguous with themselves (sorry!).
      This patch goes through and adjusts all the comparison operators such that
      they should work in both C++17 and C++20 modes. It also makes two other small
      C++20-specific changes (adding a constructor to a type that cases to be an
      aggregate, and adding casts from u8 literals which no longer have type
      const char*).
      
      There were four categories of errors that this review fixes.
      Here are canonical examples of them, ordered from most to least common:
      
      // 1) Missing const
      namespace missing_const {
          struct A {
          #ifndef FIXED
              bool operator==(A const&);
          #else
              bool operator==(A const&) const;
          #endif
          };
      
          bool a = A{} == A{}; // error
      }
      
      // 2) Type mismatch on CRTP
      namespace crtp_mismatch {
          template <typename Derived>
          struct Base {
          #ifndef FIXED
              bool operator==(Derived const&) const;
          #else
              // in one case changed to taking Base const&
              friend bool operator==(Derived const&, Derived const&);
          #endif
          };
      
          struct D : Base<D> { };
      
          bool b = D{} == D{}; // error
      }
      
      // 3) iterator/const_iterator with only mixed comparison
      namespace iter_const_iter {
          template <bool Const>
          struct iterator {
              using const_iterator = iterator<true>;
      
              iterator();
      
              template <bool B, std::enable_if_t<(Const && !B), int> = 0>
              iterator(iterator<B> const&);
      
          #ifndef FIXED
              bool operator==(const_iterator const&) const;
          #else
              friend bool operator==(iterator const&, iterator const&);
          #endif
          };
      
          bool c = iterator<false>{} == iterator<false>{} // error
                || iterator<false>{} == iterator<true>{}
                || iterator<true>{} == iterator<false>{}
                || iterator<true>{} == iterator<true>{};
      }
      
      // 4) Same-type comparison but only have mixed-type operator
      namespace ambiguous_choice {
          enum Color { Red };
      
          struct C {
              C();
              C(Color);
              operator Color() const;
              bool operator==(Color) const;
              friend bool operator==(C, C);
          };
      
          bool c = C{} == C{}; // error
          bool d = C{} == Red;
      }
      
      Differential revision: https://reviews.llvm.org/D78938
      92310454
    • Simon Pilgrim's avatar
      [X86] Add X86ISD::SUBV_BROADCAST_LOAD and begin removing X86ISD::SUBV_BROADCAST (PR38969) · cdb692ee
      Simon Pilgrim authored
      Subvector broadcasts are only load instructions, yet X86ISD::SUBV_BROADCAST treats them more generally, requiring a lot of fallback tablegen patterns.
      
      This initial patch replaces constant vector lowering inside lowerBuildVectorAsBroadcast with direct X86ISD::SUBV_BROADCAST_LOAD loads which helps us merge a number of equivalent loads/broadcasts.
      
      As well as general plumbing/analysis additions for SUBV_BROADCAST_LOAD, I needed to wrap SelectionDAG::makeEquivalentMemoryOrdering so it can handle result chains from non generic LoadSDNode nodes.
      
      Later patches will continue to replace X86ISD::SUBV_BROADCAST usage.
      
      Differential Revision: https://reviews.llvm.org/D92645
      cdb692ee
    • Krasimir Georgiev's avatar
      [libc] add back math.h #include utils/FPUtil/ManipulationFunctions.h · 352cba24
      Krasimir Georgiev authored
      This partially reverts cee1e7d1:
        [libc][NFC][Obvious] Remove few unnecessary #include directives in tests.
      
      That commit causes a test failure in our configuration:
      [ RUN      ] ILogbTest.SpecialNumbers_ilogb
      third_party/llvm/llvm-project/libc/test/src/math/ILogbTest.h:28: FAILURE
            Expected: FP_ILOGBNAN
            Which is: 2147483647
      To be equal to: func(__llvm_libc::fputil::FPBits<T>::buildNaN(1))
            Which is: -2147483648
      352cba24
    • Raphael Isemann's avatar
      [lldb] Unify the two CreateTypedef implementations in TypeSystemClang · 722247c8
      Raphael Isemann authored
      To get LLDB one step closer to fulfil the software redundancy requirements of
      modern aircrafts, we apparently decided to have two separately maintained
      implementations of `CreateTypedef` in TypeSystemClang. Let's pass on the idea of
      an LLDB-powered jetliner and deleted one implementation.
      
      On a more serious note: This function got duplicated a long time ago when the
      idea of CompilerType with a backing TypeSystemClang subclass happened
      (56939cb3). One implementation was supposed to
      be called from CompilerType::CreateTypedef and the other has just always been
      around to create typedefs. By accident one of the implementations is only used
      by the PDB parser while the CompilerType::CreateTypedef backend is used by the
      rest of LLDB.
      
      We also had some patches over the year that only fixed one of the two functions
      (D18099 for example only fixed up the CompilerType::CreateTypedef
      implementation). D51162 and D86140 both fixed the same missing `addDecl` call
      for one of the two implementations.
      
      This patch:
      * deletes the `CreateTypedefType` function as its only used by the PDB parser
        and the `CreateTypedef` implementation is anyway needed as it's the backend
        implementation of CompilerType.
      * replaces the calls in the PDB parser by just calling the CompilerType wrapper.
      * moves the documentation to the remaining function.
      * moves the check for empty typedef names that was only in the deleted
        implementation to the other (I don't think this fixes anything as I believe
        all callers are already doing the same check).
      
      I'll fix up the usual stuff (not using StringRef, not doing early exit) in a NFC
      follow-up.
      
      This patch is not NFC as the PDB parser now calls the function that has the fix
      from D18099.
      
      Reviewed By: labath, JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D93382
      722247c8
    • sameeran joshi's avatar
      [Flang][openmp]Fix crash in OpenMP semantic check( bug 48308) · a4e47cd1
      sameeran joshi authored
      Fixes the bug reported in https://bugs.llvm.org/show_bug.cgi?id=48308
      
      Reviewed By: kiranchandramohan, clementval
      
      Differential Revision: https://reviews.llvm.org/D92638
      a4e47cd1
    • mydeveloperday's avatar
      [clang-format] PR35514 brace-init member initializers in function-try-blocks... · db41c0b3
      mydeveloperday authored
      [clang-format] PR35514 brace-init member initializers in function-try-blocks are not formatted correctly
      
      https://bugs.llvm.org/show_bug.cgi?id=35514
      
      Initializer lists with a try-block are incorrectly formatted.
      
      e.g.
      
      ```
      Foo(int abc, int def) try : _abc(abc), _def{def}, _ghi{1} {
        callA();
        callB();
      } catch (std::exception&) {
      }
      ```
      
      is formatted as:
      
      ```
      Foo(int abc, int def) try : _abc(abc), _def { def }
      , _ghi{1} {
        callA();
        callB();
      }
      catch (std::exception&) {
      }
      ```
      
      This revision adds support in the parseTryCatch for braced initializers in the initializer list
      
      Reviewed By: curdeius, HazardyKnusperkeks
      
      Differential Revision: https://reviews.llvm.org/D93296
      db41c0b3
    • David Spickett's avatar
      [llvm][AArch64] Actually check expected FPU for CPUs · 7f8779e4
      David Spickett authored
      We were passing this as an argument but never using
      it. ARM has always checked this.
      
      Note that the FPU list is shared between ARM and AArch64
      so there is no AArch64::getFPUName, just ARM::getFPUName.
      
      Reviewed By: dmgreen
      
      Differential Revision: https://reviews.llvm.org/D93387
      7f8779e4
    • Florian Hahn's avatar
      [InstCombine] Preserve !annotation for newly created instructions. · eba09a2d
      Florian Hahn authored
      When replacing an instruction with !annotation with a newly created
      replacement, add the !annotation metadata to the replacement.
      
      This mostly covers cases where the new instructions are created using
      the ::Create helpers. Instructions created by IRBuilder will be handled
      by D91444.
      
      Reviewed By: thegameg
      
      Differential Revision: https://reviews.llvm.org/D93399
      eba09a2d
    • Andrzej Warzynski's avatar
      7f19712a
    • Michał Górny's avatar
      [lldb] [POSIX-DYLD] Update the cached exe path after attach · dbfdb139
      Michał Górny authored
      Fix the POSIX-DYLD plugin to update the cached executable path after
      attaching.  Previously, the path was cached in DYLDRendezvous
      constructor and not updated afterwards.  This meant that if LLDB was
      attaching to a process (e.g. via connecting to lldb-server), the code
      stored the empty path before DidAttach() resolved it.  The fix updates
      the cached path in DidAttach().
      
      This fixes a new instance of https://llvm.org/pr17880
      
      Differential Revision: https://reviews.llvm.org/D92264
      dbfdb139
    • Michał Górny's avatar
      [lldb] [POSIX-DYLD] Add libraries from initial rendezvous brkpt hit · 8666b905
      Michał Górny authored
      Explicitly consider the libraries reported on the initial rendezvous
      breakpoint hit added.  This is necessary on FreeBSD since the dynamic
      loader issues only a single 'consistent' state rendezvous breakpoint hit
      for all the libraries present in DT_NEEDED.  It is also helpful on Linux
      where it ensures that ld-linux is considered loaded as well
      as the shared system libraries reported afterwards.
      
      Reenable memory maps on FreeBSD since this fixed the issue triggered
      by them.
      
      Differential Revision: https://reviews.llvm.org/D92187
      8666b905
    • Alex Zinenko's avatar
      [mlir] Support index and memref types in llvm.mlir.cast · 96076a2e
      Alex Zinenko authored
      This operation is designed to support partial conversion, more specifically the
      IR state in which some operations expect or produce built-in types and some
      operations produce and expect LLVM dialect types. It is reasonable for it to
      support cast between built-in types and any equivalent that could be produced
      by the type conversion. (At the same time, we don't want the dialect to depend
      on the type conversion as it could lead to a dependency cycle). Introduce
      support for casting from index to any integer type and back, and from memref to
      bare pointer or memref descriptor type and back.
      
      Contrary to what the TODO in the code stated, there are no particular
      precautions necessary to handle the bare pointer conversion for memerfs. This
      conversion applies exclusively to statically-shaped memrefs, so we can always
      recover the full descriptor contents from the type.
      
      This patch simultaneously tightens the verification for other types to only
      accept matching pairs of types, e.g., i64 and !llvm.i64, as opposed to the
      previous implementation that only checked if the types were generally allowed
      byt not for matching, e.g. i64 could be "casted" to !llvm.bfloat, which is not
      the intended semantics.
      
      Move the relevant test under test/Dialect/LLVMIR because it is not specific to
      the conversion pass, but rather exercises an op in the dialect. If we decide
      this op does not belong to the LLVM dialect, both the dialect and the op should
      move together.
      
      Reviewed By: silvas, ezhulenev
      
      Differential Revision: https://reviews.llvm.org/D93405
      96076a2e
    • QingShan Zhang's avatar
      Expand the fp_to_int/int_to_fp/fp_round/fp_extend as libcall for fp128 · ebdd20f4
      QingShan Zhang authored
      X86 and AArch64 expand it as libcall inside the target. And PowerPC also
      want to expand them as libcall for P8. So, propose an implement in the
      legalizer to common the logic and remove the code for X86/AArch64 to
      avoid the duplicate code.
      
      Reviewed By: Craig Topper
      
      Differential Revision: https://reviews.llvm.org/D91331
      ebdd20f4