1. Jun 13, 2022
  2. Jun 12, 2022
    • Florian Hahn's avatar
      [LV] Update test to use GEP so it is not dead. · 46749120
      Florian Hahn authored
      The test should use the GEP for the store, so it is not dead.
      46749120
    • Mehdi Amini's avatar
      Revert "[X86][RFC] Enable `_Float16` type support on X86 following the psABI" · 5d8298a7
      Mehdi Amini authored
      This reverts commit 2d2da259.
      
      This breaks MLIR integration test (JIT crashing), reverting in the
      meantime.
      5d8298a7
    • Jez Ng's avatar
      d941d597
    • Simon Pilgrim's avatar
      [X86] combineConcatVectorOps - add support for concatenation of VSELECT/BLENDV nodes (REAPPLIED) · b5d7beeb
      Simon Pilgrim authored
      If the LHS/RHS selection operands can be cheaply concatenated back together then replace 2 x 128-bit selection nodes with 1 x 256-bit node
      
      Addresses the regression introduced in the bug fix from rGd5af6a38
      
      REAPPLIED with for bug identified in rGea8fb3b6
      b5d7beeb
    • Simon Pilgrim's avatar
      [X86] Add regression test for rGea8fb3b6 · b350ab74
      Simon Pilgrim authored
      Reduced from test case reported by @srj for the concatenation of VSELECT/BLENDV nodes
      b350ab74
    • Nuno Lopes's avatar
      [NFC] Remove 'br i1 undef' from SROA tests · c1b61030
      Nuno Lopes authored
      c1b61030
    • Ulrich Weigand's avatar
      Fix endian conversion of sub-byte types · 7095a1ff
      Ulrich Weigand authored
      When convertEndianOfCharForBEmachine is called with elementBitWidth
      smaller than CHAR_BIT, the default case is invoked, but this does
      nothing at all and leaves the output array unchanged.
      
      Fix DenseIntOrFPElementsAttr::convertEndianOfArrayRefForBEmachine
      by not calling convertEndianOfCharForBEmachine in this case, and
      instead simply copying the input to the output (for sub-byte types,
      endian conversion is in fact a no-op).
      
      Reviewed By: rriddle
      
      Differential Revision: https://reviews.llvm.org/D125676
      7095a1ff
    • Jez Ng's avatar
      [MC] Omit DWARF unwind info if compact unwind is present where eligible · ef501bf8
      Jez Ng authored
      Previously, omitting unnecessary DWARF unwinds was only done in two
      cases:
      * For Darwin + aarch64, if no DWARF unwind info is needed for all the
        functions in a TU, then the `__eh_frame` section would be omitted
        entirely. If any one function needed DWARF unwind, then MC would emit
        DWARF unwind entries for all the functions in the TU.
      * For watchOS, MC would omit DWARF unwind on a per-function basis, as
        long as compact unwind was available for that function.
      
      This diff makes it so that we omit DWARF unwind on a per-function basis
      for Darwin + aarch64 as well. In addition, we introduce the flag
      `--emit-dwarf-unwind=` which can toggle between `always`,
      `no-compact-unwind` (only emit DWARF when CU cannot be emitted for a
      given function), and the target platform `default`.  `no-compact-unwind`
      is particularly useful for newer x86_64 platforms: we don't want to omit
      DWARF unwind for x86_64 in general due to possible backwards compat
      issues, but we should make it possible for people to opt into this
      behavior if they are only targeting newer platforms.
      
      **Motivation:** I'm working on adding support for `__eh_frame` to LLD,
      but I'm concerned that we would suffer a perf hit. Processing compact
      unwind is already expensive, and that's a simpler format than EH frames.
      Given that MC currently produces one EH frame entry for every compact
      unwind entry, I don't think processing them will be cheap. I tried to do
      something clever on LLD's end to drop the unnecessary EH frames at parse
      time, but this made the code significantly more complex. So I'm looking
      at fixing this at the MC level instead.
      
      **Addendum:** It turns out that there was a latent bug in the X86
      backend when `OmitDwarfIfHaveCompactUnwind` is naively enabled, which is
      not too surprising given that this combination has not been heretofore
      used.
      
      For functions that have unwind info that cannot be encoded with CU, MC
      would end up dropping both the compact unwind entry (OK; existing
      behavior) as well as the DWARF entries (not OK).  This diff fixes things
      so that we emit the DWARF entry, as well as a CU entry with encoding
      `UNWIND_X86_MODE_DWARF` -- this basically tells the unwinder to look for
      the DWARF entry. I'm not 100% sure the `UNWIND_X86_MODE_DWARF` CU entry
      is necessary, this was the simplest fix. ld64 seems to be able to handle
      both the absence and presence of this CU entry. Ultimately ld64 (and
      LLD) will synthesize `UNWIND_X86_MODE_DWARF` if it is absent, so there
      is no impact to the final binary size.
      
      Reviewed By: davide, lhames
      
      Differential Revision: https://reviews.llvm.org/D122258
      ef501bf8
    • Yuki Okushi's avatar
      [docs][clang] Fix a broken link on the APINotes doc · e43a85a3
      Yuki Okushi authored
      This patch replaces a link with a GitHub one.
      
      Fixes llvm#55748
      
      Differential Revision: https://reviews.llvm.org/D126599
      e43a85a3
    • Simon Pilgrim's avatar
      [DAG] visitSRL - pull out ShiftVT. NFC. · 54ae4ca7
      Simon Pilgrim authored
      54ae4ca7
    • David Green's avatar
      [AArch64] Look through bitcast when looking for extract_high subvector · 963c0a01
      David Green authored
      Since D61806, DAGCombiner has folded subvector_extract(bitcast(..)) to
      bitcast(subvector_extract(..)), which would place a bitcast between a
      subvector_extract and the operation that could be converted to a high
      neon instruction (like smull2). This adds better matching for the
      subvector_extract, through the tablegen extract_high PatFrags to
      optionally skip the bitcast under little ending, still matchings an
      extract of the high half of the input vector.
      
      I didn't update the extract_high of a duplicate patterns, as the
      ComplexPattern need names operands. I did add a extract_high_dup_v8i16
      PatFrag to abstract away the common code, which can be extended in a
      future patch.
      
      Differential Revision: https://reviews.llvm.org/D126782
      963c0a01
    • Phoebe Wang's avatar
      [X86][RFC] Enable `_Float16` type support on X86 following the psABI · 2d2da259
      Phoebe Wang authored
      GCC and Clang/LLVM will support `_Float16` on X86 in C/C++, following
      the latest X86 psABI. (https://gitlab.com/x86-psABIs)
      
      _Float16 arithmetic will be performed using native half-precision. If
      native arithmetic instructions are not available, it will be performed
      at a higher precision (currently always float) and then truncated down
      to _Float16 immediately after each single arithmetic operation.
      
      Reviewed By: LuoYuanke
      
      Differential Revision: https://reviews.llvm.org/D107082
      2d2da259
    • Alex Brachet's avatar
      Revert "[lit] Passthrough CLANG_MODULE_CACHE_PATH env var" · 98052b64
      Alex Brachet authored
      This reverts commit 6466c9ab.
      98052b64
    • Weining Lu's avatar
    • Weining Lu's avatar
    • Amaury Séchet's avatar
    • Amaury Séchet's avatar
      d35da7f7
    • Kazushi (Jam) Marukawa's avatar
      [Clang][VE][NFC] Fix a comment · 140ad7d3
      Kazushi (Jam) Marukawa authored
      140ad7d3
    • Keith Smiley's avatar
      [lld-macho] Add support for -w · 7d57c698
      Keith Smiley authored
      This flag suppresses warnings produced by the linker. In ld64 this has
      an interesting interaction with -fatal_warnings, it silences the
      warnings but the link still fails. Instead of doing that here we still
      print the warning and eagerly fail the link in case both are passed,
      this seems more reasonable so users can understand why the link fails.
      
      Differential Revision: https://reviews.llvm.org/D127564
      7d57c698
    • Joe Loser's avatar
      [libc++][test] Add tuple trivial destructor test · c115e760
      Joe Loser authored
      There is only compile-time tests in `dtor.pass.cpp`, so it could be made a
      `dtor.compile.pass.cpp`. Instead, add a runtime test for testing the trivial
      destructor behavior for `tuple`.
      
      Differential Revision: https://reviews.llvm.org/D109298
      c115e760
    • Nico Weber's avatar
      fix comment typo to cycle bots · 5f57ca20
      Nico Weber authored
      5f57ca20
    • Florian Hahn's avatar
      [VPlan] Remove dead OrigLoop argument from removeDeadRecipes (NFC). · 763f2bdb
      Florian Hahn authored
      The use of the argument has been remove a while ago. Remove the dead
      argument.
      763f2bdb
    • Florian Hahn's avatar
      684a82fb
    • Alex Brachet's avatar
      [lit] Passthrough CLANG_MODULE_CACHE_PATH env var · 6466c9ab
      Alex Brachet authored
      This environment variable can be set to control module
      caching. It disables caching by setting the variable
      empty. As such, it needs to be handled differently
      from other environment variables here which are
      assumed to not be empty.
      6466c9ab
    • Simon Pilgrim's avatar
      [DAG] visitVECTOR_SHUFFLE - fold splat(insert_vector_elt()) and... · cf5c63d1
      Simon Pilgrim authored
      [DAG] visitVECTOR_SHUFFLE - fold splat(insert_vector_elt()) and splat(scalar_to_vector()) to build_vector splats
      
      Addresses a number of regressions identified in D127115
      cf5c63d1
    • Joe Loser's avatar
      [libc++][test] Refactor SmallBasicString uses in range.lazy.split tests · ae2ae84f
      Joe Loser authored
      The tests for `std::ranges::lazy_split_view` heavily use a wrapper class around
      `std::string` because `std::string` was not `constexpr` until recently. Where
      possible, remove the wrapper class and extra functionality no longer needed.
      Remove `libcxx/test/std/ranges/range.adaptors/range.lazy.split/small_string.h`
      and inline its one use remaining in
      `libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp`.
      
      Differential Revision: https://reviews.llvm.org/D126663
      ae2ae84f
    • Dmitri Gribenko's avatar
    • Dmitri Gribenko's avatar
      [clang-tidy][docs] Use std::optional instead of absl::optional in examples · 65299c9c
      Dmitri Gribenko authored
      The standard type is vastly more popular than the Abseil polyfill, so it
      makes more sense to use it in documentation, even though the checker
      actually understands both (and that fact is documented already).
      65299c9c
    • Amir Ayupov's avatar
      [BOLT][NFC] Move printDebugInfo out of BC::printInstruction · 7dee646b
      Amir Ayupov authored
      Simplify `BinaryContext::printInstruction`.
      
      Reviewed By: ayermolo
      
      Differential Revision: https://reviews.llvm.org/D127561
      7dee646b
    • Kazu Hirata's avatar
      [llvm] Use contains (NFC) · a838043f
      Kazu Hirata authored
      a838043f
    • Simon Pilgrim's avatar
      [X86][AVX512] Retain pmuldq broadcast loads on 32-bit targets · 7841d094
      Simon Pilgrim authored
      Don't demand just the lower 32-bits on 32-bit AVX512 targets to preserve 64-bit broadcast loads patterns
      7841d094
    • Simon Pilgrim's avatar
      [X86][AVX512] Add tests showing failure to retain pmuldq broadcast loads on 32-bit targets · c8aaa5d9
      Simon Pilgrim authored
      Noticed while investigating the build vector issues on D127115
      c8aaa5d9
    • Simon Pilgrim's avatar
      [DAG] visitINSERT_VECTOR_ELT - add <1 x ???>... · 44a0cd25
      Simon Pilgrim authored
      [DAG] visitINSERT_VECTOR_ELT - add <1 x ???> insert_vector_elt(v0,extract_vector_elt(v1,0),0) special case handling
      
      Check if we're just replacing one v1x?? vector with another
      44a0cd25
    • Kazu Hirata's avatar
      Use getValueOr (NFC) · 439a675a
      Kazu Hirata authored
      439a675a
    • Kazu Hirata's avatar
      Use isa instead of dyn_cast (NFC) · 5ee38769
      Kazu Hirata authored
      5ee38769
    • Dave Lee's avatar
      [lldb][bindings] Implement __repr__ instead of __str__ · c7a56af3
      Dave Lee authored
      When using the `script` Python repl, SB objects are printed in a way that gives
      the user no information. The simplest example is:
      
      ```
      (lldb) script lldb.debugger
      <lldb.SBDebugger; proxy of <Swig Object of type 'lldb::SBDebugger *' at 0x1097a5de0> >
      ```
      
      This output comes from the Python repl printing the `repr()` of an object.
      
      None of the SB classes implement `__repr__`, and all print like the above.
      However, many (most?, all?) SB classes implement `__str__`. Because they
      implement `__str__`, a more detailed output can be had by `print`ing the
      object, for example:
      
      ```
      (lldb) script print(lldb.debugger)
      Debugger (instance: "debugger_1", id: 1)
      ```
      
      For convenience, this change switches all SB classes that implement to
      `__str__` to instead implement `__repr__`. **The result is that `str()` and
      `repr()` will produce the same output**. This is because `str` calls `__repr__`
      for classes that have  no `__str__` method.
      
      The benefit being that when writing a `script` invocation, you don't need to
      remember to wrap in `print()`. If that isn't enough motivation, consider the
      case where your Python expression results in a list of SB objects, in that case
      you'd have to `map` or use a list comprehension like `[str(x) for x in <expr>]`
      in order to see the details of the objects in the list.
      
      For reference, the docs for `repr` say:
      
      > repr(object)
      >   Return a string containing a printable representation of an object. For
      >   many types, this function makes an attempt to return a string that would
      >   yield an object with the same value when passed to eval(); otherwise, the
      >   representation is a string enclosed in angle brackets that contains the
      >   name of the type of the object together with additional information often
      >   including the name and address of the object. A class can control what this
      >   function returns for its instances by defining a __repr__() method.
      
      and the docs for `__repr__` say:
      
      > object.__repr__(self)
      >   Called by the repr() built-in function to compute the “official” string
      >   representation of an object. If at all possible, this should look like a
      >   valid Python expression that could be used to recreate an object with the
      >   same value (given an appropriate environment). If this is not possible, a
      >   string of the form <...some useful description...> should be returned. The
      >   return value must be a string object. If a class defines __repr__() but not
      >   __str__(), then __repr__() is also used when an “informal” string
      >   representation of instances of that class is required.
      >
      >   This is typically used for debugging, so it is important that the
      >   representation is information-rich and unambiguous.
      
      Even if it were convenient to construct Python expressions for SB classes so
      that they could be `eval`'d, however for typical lldb usage, I can't think of a
      motivating reason to do so. As it stands, the only action the docs say to do,
      that this change doesn't do, is wrap the `repr` string in `<>` angle brackets.
      
      An alternative implementation is to change lldb's python repl to apply `str()`
      to the top level result. While this would work well in the case of a single SB
      object, it doesn't work for a list of SB objects, since `str([x])` uses `repr`
      to convert each list element to a string.
      
      Differential Revision: https://reviews.llvm.org/D127458
      c7a56af3