1. Jun 11, 2024
  2. Jun 08, 2024
  3. Jun 07, 2024
    • jeanPerier's avatar
      [flang][runtime] add SHAPE runtime interface (#94702) · b01ac513
      jeanPerier authored
      Add SHAPE runtime API (will be used for assumed-rank, lowering is
      generating other cases inline).
      
      I tried to make it in a way were there is no dynamic allocation in the
      runtime/deallocation expected to be inserted by inline code for arrays
      that we know are small (lowering will just always stack allocate a rank
      15 array to avoid dynamic stack allocation or heap allocation).
      b01ac513
    • Simon Pilgrim's avatar
      [Reassociate] shifttest.ll - generate test checks to replace custom grep expression · 97b12df2
      Simon Pilgrim authored
      (and remove an unused argument)
      97b12df2
    • Nico Weber's avatar
      [libc++] Undeprecate shared_ptr atomic access APIs (#92920) · 716ed5fc
      Nico Weber authored
      This patch reverts 9b832b72 (#87111):
      - [libc++] Deprecated `shared_ptr` Atomic Access APIs as per P0718R2
      - [libc++] Implemented P2869R3: Remove Deprecated `shared_ptr` Atomic Access APIs from C++26
      
      As explained in [1], the suggested replacement in P2869R3 is `__cpp_lib_atomic_shared_ptr`,
      which libc++ does not yet implement. Let's not deprecate the old way of doing things before
      the new way of doing things exists.
      
      [1]: https://github.com/llvm/llvm-project/pull/87111#issuecomment-2112740039
      716ed5fc
    • Vy Nguyen's avatar
      Reapply PR/87550 (#94625) · 35fa2ded
      Vy Nguyen authored
      Re-apply https://github.com/llvm/llvm-project/pull/87550 with fixes.
      
      Details:
      Some tests in fuchsia failed because of the newly added assertion.
      This was because `GetExceptionBreakpoint()` could be called before
      `g_dap.debugger` was initted.
      
      The fix here is to just lazily populate the list in
      GetExceptionBreakpoint() rather than assuming it's already been initted.
      (There is some nuisance here because we can't simply just populate it in
      DAP::DAP(), which is a global ctor and is called before
      `SBDebugger::Initialize()` is called. )
      35fa2ded
    • Konstantin Varlamov's avatar
      [libc++][regex] Correctly adjust match prefix for zero-length matches. (#94550) · e9adcc48
      Konstantin Varlamov authored
      For regex patterns that produce zero-length matches, there is one
      (imaginary) match in-between every character in the sequence being
      searched (as well as before the first character and after the last
      character). It's easiest to demonstrate using replacement:
      `std::regex_replace("abc"s, "!", "")` should produce `!a!b!c!`, where
      each exclamation mark makes a zero-length match visible.
      
      Currently our implementation doesn't correctly set the prefix of each
      zero-length match, "swallowing" the characters separating the imaginary
      matches -- e.g. when going through zero-length matches within `abc`, the
      corresponding prefixes should be `{'', 'a', 'b', 'c'}`, but before this
      patch they will all be empty (`{'', '', '', ''}`). This happens in the
      implementation of `regex_iterator::operator++`. Note that the Standard
      spells out quite explicitly that the prefix might need to be adjusted
      when dealing with zero-length matches in
      [`re.regiter.incr`](http://eel.is/c++draft/re.regiter.incr):
      > In all cases in which the call to `regex_search` returns `true`,
      `match.prefix().first` shall be equal to the previous value of
      `match[0].second`... It is unspecified how the implementation makes
      these adjustments.
      
      [Reproduction example](https://godbolt.org/z/8ve6G3dav)
      ```cpp
      #include <iostream>
      #include <regex>
      #include <string>
      
      int main() {
        std::string str = "abc";
        std::regex empty_matching_pattern("");
      
        { // The underlying problem is that `regex_iterator::operator++` doesn't update
          // the prefix correctly.
          std::sregex_iterator i(str.begin(), str.end(), empty_matching_pattern), e;
          std::cout << "\"";
          for (; i != e; ++i) {
            const std::ssub_match& prefix = i->prefix();
            std::cout << prefix.str();
          }
          std::cout << "\"\n";
          // Before the patch: ""
          // After the patch: "abc"
        }
      
        { // `regex_replace` makes the problem very visible.
          std::string replaced = std::regex_replace(str, empty_matching_pattern, "!");
          std::cout << "\"" << replaced << "\"\n";
          // Before the patch: "!!!!"
          // After the patch: "!a!b!c!"
        }
      }
      ```
      
      Fixes #64451
      
      rdar://119912002
      e9adcc48
    • Florian Hahn's avatar
      4f9c0fa2
    • David Green's avatar
      [AArch64] Add patterns for add(uzp1(x,y), uzp2(x, y)) -> addp. · f7018ba0
      David Green authored
      If we are extracting the even lanes and the odd lanes and adding them, we can
      use an addp instruction.
      f7018ba0
    • Jake Egan's avatar
      [libc++][test][AIX] Only XFAIL atomic tests for before clang 19 (#94646) · 790992dd
      Jake Egan authored
      These tests pass on 64-bit. They were fixed by 5fdd0948 on 32-bit.
      So XFAIL only for 32-bit before clang 19.
      790992dd
    • c8ef's avatar
      [KnownBits] Remove `hasConflict()` assertions (#94568) · b25b1db8
      c8ef authored
      Allow KnownBits to represent "always poison" values via conflict.
      
      close: #94436
      b25b1db8
    • Nico Weber's avatar
      [gn] port cb7690af (ntdll dep) · fc95645e
      Nico Weber authored
      fc95645e
    • Nico Weber's avatar
      [gn] port 33a6ce18 (check-clang obj2yaml dep) · d099d6c7
      Nico Weber authored
      d099d6c7
    • Mubashar Ahmad's avatar
      [mlir][vector] Remove Emulated Sub-directory (#94742) · 7d69095f
      Mubashar Ahmad authored
      The "Emulated" sub-directories under "ArmSVE" and
      "ArmSME" have been removed. Associated tests
      have been moved up a directory and now include
      the "REQUIRES" constraint for the arm-emulator.
      7d69095f
    • Kazu Hirata's avatar
      [memprof] Use CallStackRadixTreeBuilder in the V3 format (#94708) · c348e265
      Kazu Hirata authored
      This patch integrates CallStackRadixTreeBuilder into the V3 format,
      reducing the profile size to about 27% of the V2 profile size.
      
      - Serialization: writeMemProfCallStackArray just needs to write out
        the radix tree array prepared by CallStackRadixTreeBuilder.
        Mappings from CallStackIds to LinearCallStackIds are moved by new
        function CallStackRadixTreeBuilder::takeCallStackPos.
      
      - Deserialization: Deserializing a call stack is the same as
        deserializing an array encoded in the obvious manner -- the length
        followed by the payload, except that we need to follow a pointer to
        the parent to take advantage of common prefixes once in a while.
        This patch teaches LinearCallStackIdConverter to how to handle those
        pointers.
      c348e265
    • jeanPerier's avatar
      55bdb36e
    • Kazu Hirata's avatar
      [memprof] Clean up IndexedMemProfReader (NFC) (#94710) · eb33e462
      Kazu Hirata authored
      Parameter "Version" is confusing in deserializeV012 and deserializeV3
      because we also have member variable "Version".  Fortunately,
      parameter "Version" and member variable "Version" always have the same
      value because IndexedMemProfReader::deserialize initializes the member
      variable and passes it to deserializeV012 and deserializeV3.
      
      This patch removes the parameter.
      eb33e462
    • Xuan Zhang's avatar
      [MachineOutliner] Sort by Benefit to Cost Ratio (#90264) · 3b16630c
      Xuan Zhang authored
      This PR depends on https://github.com/llvm/llvm-project/pull/90260
      
      We changed the order in which functions are outlined in Machine
      Outliner.
      
      The formula for priority is found via a black-box Bayesian optimization
      toolbox. Using this formula for sorting consistently reduces the
      uncompressed size of large real-world mobile apps. We also ran a few
      benchmarks using LLVM test suites, and showed that sorting by priority
      consistently reduces the text segment size.
      
      |run (CTMark/)   |baseline (1)|priority (2)|diff (1 -> 2)|
      |----------------|------------|------------|-------------|
      |lencod          |349624      |349264      |-0.1030%     |
      |SPASS           |219672      |219480      |-0.0874%     |
      |kc              |271956      |251200      |-7.6321%     |
      |sqlite3         |223920      |223708      |-0.0947%     |
      |7zip-benchmark  |405364      |402624      |-0.6759%     |
      |bullet          |139820      |139500      |-0.2289%     |
      |consumer-typeset|295684      |290196      |-1.8560%     |
      |pairlocalalign  |72236       |72092       |-0.1993%     |
      |tramp3d-v4      |189572      |189292      |-0.1477%     |
      
      This is part of an enhanced version of machine outliner -- see
      [RFC](https://discourse.llvm.org/t/rfc-enhanced-machine-outliner-part-1-fulllto-part-2-thinlto-nolto-to-come/78732).
      3b16630c
    • Liao Chunyu's avatar
      [RISCV] Codegen support for XCVmem extension (#76916) · 2afea729
      Liao Chunyu authored
      All post-Increment load/store, register-register load/store
      
      spec:
      
      https://github.com/openhwgroup/cv32e40p/blob/master/docs/source/instruction_set_extensions.rst
      
      Contributors: @CharKeaney, @jeremybennett, @lewis-revill,
      @NandniJamnadas, @PaoloS02, @serkm, @simonpcook, @xingmingjie, @realqhc
      2afea729
    • Joseph Huber's avatar
      [Clang] Add timeout for GPU detection utilities (#94751) · 2981f3a2
      Joseph Huber authored
      Summary:
      The utilities `nvptx-arch` and `amdgpu-arch` are used to support
      `--offload-arch=native` among other utilities in clang. However, these
      rely on the GPU drivers to query the features. In certain cases these
      drivers can become locked up, which will lead to indefinate hangs on any
      compiler jobs running in the meantime.
      
      This patch adds a ten second timeout period for these utilities before
      it kills the job and errors out.
      2981f3a2
    • David Green's avatar
      [AArch64] Add addp from shuffles tests. NFC · c5fcc2ea
      David Green authored
      c5fcc2ea
    • Farzon Lotfi's avatar
      [arm64] Add tan intrinsic lowering (#94545) · 2f0308ed
      Farzon Lotfi authored
      This change is an implementation of
      https://github.com/llvm/llvm-project/issues/87367's investigation on
      supporting IEEE math operations as intrinsics.
      Which was discussed in this RFC:
      https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294
      
      This PR is just for Tan.
      
      Now that x86 tan backend landed:
      https://github.com/llvm/llvm-project/pull/90503 we can add other
      backends since the shared pieces are in tree now.
      
      Changes:
      - `llvm/include/llvm/Analysis/VecFuncs.def` - vectorization of tan for
      arm64 backends.
      - `llvm/lib/Target/AArch64/AArch64FastISel.cpp` - Add tan to the libcall
      table
      - `llvm/lib/Target/AArch64/AArch64ISelLowering.cpp` - Add tan expansion
      for f128, f16, and vector\neon operations
      - `llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp` define
      `G_FTAN` as a legal arm64 instruction
      
      resolves #94755
      2f0308ed
    • David Green's avatar
      [ARM] Clean up neon_vabd.ll, vaba.ll and vabd.ll tests a bit. NFC · ac021689
      David Green authored
      Change the target triple to remove some unnecessary instructions.
      ac021689
    • Max191's avatar
      [mlir] Fix bugs in expand_shape patterns after semantics changes (#94631) · 2117677e
      Max191 authored
      After the `output_shape` field was added to `expand_shape` ops,
      dynamically sized expand shapes are now possible, but this was not
      accounted for in the folder. This PR tightens the constraints of the
      folder to fix this.
      2117677e
    • Max191's avatar
      [mlir] Add reshape propagation patterns for tensor.pad (#94489) · c886d66d
      Max191 authored
      This PR adds fusion by collapsing and fusion by expansion patterns for
      `tensor.pad` ops in ElementwiseOpFusion. Pad ops can be expanded or
      collapsed as long as none of the padded dimensions will be expanded or
      collapsed.
      c886d66d
    • Ryan Holt's avatar
      [mlir][linalg] Support lowering unpack with outer_dims_perm (#94477) · 5b2f7a19
      Ryan Holt authored
      This commit adds support for lowering `tensor.unpack` with a
      non-identity `outer_dims_perm`. This was previously left as a
      not-yet-implemented case.
      5b2f7a19