1. Oct 27, 2023
    • Kiran Chandramohan's avatar
      [Flang][OpenMP] Move the host-ir-flag test to the Driver directory (#70441) · 7391ad38
      Kiran Chandramohan authored
      Moving since this is almost an end to end test and covers multiple
      stages.
      7391ad38
    • Florian Hahn's avatar
      [VPlan] Handle VPValues without underlying values in getTypeForVPValue. · cff66521
      Florian Hahn authored
      Fixes a crash after 0c8e5be6.
      
      Full type inference will be added in
      https://github.com/llvm/llvm-project/pull/69013
      cff66521
    • Andrzej Warzyński's avatar
      [mlir][vector] Update v.contract -> v.outerproduct tests (1/N) (#70379) · 8e0b3a88
      Andrzej Warzyński authored
      Tests for conversions from `vector.contract` to `vector.outerproduct`
      for _matvec_ operations are updated with cases for scalable vectors.
      
      This patch updates one specific test file (there might be similar
      tests elsewhere):
      
         * vector-contract-to-outerproduct-transforms.mlir.
      
      Only the parallel dimension is made scalable. Making the reduction
      dimension scalable would lead to different patterns without
      `vector.outerproduct` (that would need to be added to some other file).
      
      One duplicate test for _matvec_ is removed.
      8e0b3a88
    • Christudasan Devadasan's avatar
      [AMDGPU] Add pseudo instructions for SGPR spill to VGPR (#69923) · f9cd7896
      Christudasan Devadasan authored
      For a future patch, is it important to keep the lowered SGPR
      spills to be recognized as spill instructions during regalloc.
      Directly lowering them into V_WRITELANE/V_READLANE won't allow
      us to attach the SPILL flag to their instructions.
      
      This patch introduces the pseudo instructions with the SGPRSpill
      flag set in their Desc. They will get lowered to equivalent
      instructions later during post RA pseudo expansion.
      f9cd7896
    • Igor Kirillov's avatar
      [CodeGen] Improve ExpandMemCmp for more efficient non-register aligned sizes handling (#69942) · 9bcb30d3
      Igor Kirillov authored
      * Enhanced the logic of ExpandMemCmp pass to merge contiguous
      subsequences
        in LoadSequence, based on sizes allowed in `AllowedTailExpansions`.
      * This enhancement seeks to minimize the number of basic blocks and
      produce optimized code when using memcmp with non-register aligned sizes.
      * Enable this feature for AArch64 with memcmp sizes modulo 8 equal to
        3, 5, and 6.
      9bcb30d3
    • David Spickett's avatar
      [lldb] Return unimplemented error from ScriptedProcessInterface::CreatePluginObject · 02ef12dd
      David Spickett authored
      After https://github.com/llvm/llvm-project/pull/68052 this function changed from returning
      a nullptr with `return {};` to returning Expected and hitting `llvm_unreachable` before it could
      do so.
      
      I gather that we're never supposed to call this function, but on Windows we actually do call
      this function because `interpreter->CreateScriptedProcessInterface()` returns
      `ScriptedProcessInterface` not `ScriptedProcessPythonInterface`. Likely because
      `target_sp->GetDebugger().GetScriptInterpreter()` also does not return a Python related class.
      
      The previously XFAILed test crashed with:
      ```
       # .---command stderr------------
       # | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
       # | Stack dump:
       # | 0.  Program arguments: c:\\users\\tcwg\\david.spickett\\build-llvm\\bin\\lldb-test.exe ir-memory-map C:\\Users\\tcwg\\david.spickett\\build-llvm\\tools\\lldb\\test\\Shell\\Expr\\Output\\TestIRMemoryMapWindows.test.tmp C:\\Users\\tcwg\\david.spickett\\llvm-project\\lldb\\test\\Shell\\Expr/Inputs/ir-memory-map-basic
       # | 1.  HandleCommand(command = "run")
       # | Exception Code: 0xC000001D
       # | #0 0x00007ff696b5f588 lldb_private::ScriptedProcessInterface::CreatePluginObject(class llvm::StringRef, class lldb_private::ExecutionContext &, class std::shared_ptr<class lldb_private::StructuredData::Dictionary>, class lldb_private::StructuredData::Generic *) C:\Users\tcwg\david.spickett\llvm-project\lldb\include\lldb\Interpreter\Interfaces\ScriptedProcessInterface.h:28:0
       # | #1 0x00007ff696b1d808 llvm::Expected<std::shared_ptr<lldb_private::StructuredData::Generic> >::operator bool C:\Users\tcwg\david.spickett\llvm-project\llvm\include\llvm\Support\Error.h:567:0
       # | #2 0x00007ff696b1d808 lldb_private::ScriptedProcess::ScriptedProcess(class std::shared_ptr<class lldb_private::Target>, class std::shared_ptr<class lldb_private::Listener>, class lldb_private::ScriptedMetadata const &, class lldb_private::Status &) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Plugins\Process\scripted\ScriptedProcess.cpp:115:0
       # | #3 0x00007ff696b1d124 std::shared_ptr<lldb_private::ScriptedProcess>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1478:0
       # | #4 0x00007ff696b1d124 lldb_private::ScriptedProcess::CreateInstance(class std::shared_ptr<class lldb_private::Target>, class std::shared_ptr<class lldb_private::Listener>, class lldb_private::FileSpec const *, bool) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Plugins\Process\scripted\ScriptedProcess.cpp:61:0
       # | #5 0x00007ff69699c8f4 std::_Ptr_base<lldb_private::Process>::_Move_construct_from C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1237:0
       # | #6 0x00007ff69699c8f4 std::shared_ptr<lldb_private::Process>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1534:0
       # | #7 0x00007ff69699c8f4 std::shared_ptr<lldb_private::Process>::operator= C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1594:0
       # | #8 0x00007ff69699c8f4 lldb_private::Process::FindPlugin(class std::shared_ptr<class lldb_private::Target>, class llvm::StringRef, class std::shared_ptr<class lldb_private::Listener>, class lldb_private::FileSpec const *, bool) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Target\Process.cpp:396:0
       # | #9 0x00007ff6969bd708 std::_Ptr_base<lldb_private::Process>::_Move_construct_from C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1237:0
       # | #10 0x00007ff6969bd708 std::shared_ptr<lldb_private::Process>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1534:0
       # | #11 0x00007ff6969bd708 std::shared_ptr<lldb_private::Process>::operator= C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1594:0
       # | #12 0x00007ff6969bd708 lldb_private::Target::CreateProcess(class std::shared_ptr<class lldb_private::Listener>, class llvm::StringRef, class lldb_private::FileSpec const *, bool) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Target\Target.cpp:215:0
       # | #13 0x00007ff696b13af0 std::_Ptr_base<lldb_private::Process>::_Ptr_base C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1230:0
       # | #14 0x00007ff696b13af0 std::shared_ptr<lldb_private::Process>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1524:0
       # | #15 0x00007ff696b13af0 lldb_private::PlatformWindows::DebugProcess(class lldb_private::ProcessLaunchInfo &, class lldb_private::Debugger &, class lldb_private::Target &, class lldb_private::Status &) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Plugins\Platform\Windows\PlatformWindows.cpp:495:0
       # | #16 0x00007ff6969cf590 std::_Ptr_base<lldb_private::Process>::_Move_construct_from C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1237:0
       # | #17 0x00007ff6969cf590 std::shared_ptr<lldb_private::Process>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1534:0
       # | #18 0x00007ff6969cf590 std::shared_ptr<lldb_private::Process>::operator= C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1594:0
       # | #19 0x00007ff6969cf590 lldb_private::Target::Launch(class lldb_private::ProcessLaunchInfo &, class lldb_private::Stream *) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Target\Target.cpp:3274:0
       # | #20 0x00007ff696fff82c CommandObjectProcessLaunch::DoExecute(class lldb_private::Args &, class lldb_private::CommandReturnObject &) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Commands\CommandObjectProcess.cpp:258:0
       # | #21 0x00007ff696fab6c0 lldb_private::CommandObjectParsed::Execute(char const *, class lldb_private::CommandReturnObject &) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Interpreter\CommandObject.cpp:751:0
       # `-----------------------------
       # error: command failed with exit status: 0xc000001d
      ```
      
      That might be a bug on the Windows side, or an artifact of how our build is setup,
      but whatever it is, having `CreatePluginObject` return an error and
      the caller check it, fixes the failing test.
      
      The built lldb can run the script command to use Python, but I'm not sure if that means
      anything.
      02ef12dd
    • Luke Lau's avatar
      [RISCV] Keep same SEW/LMUL ratio if possible in forward transfer (#69788) · c8e1fbc3
      Luke Lau authored
      For instructions like vmv.s.x and friends where we don't care about LMUL
      or the
      SEW/LMUL ratio, we can change the LMUL in its state so that it has the
      same
      SEW/LMUL ratio as the previous state. This allows us to avoid more VL
      toggles
      later down the line (i.e. use vsetvli zero, zero, which requires that
      the
      SEW/LMUL ratio must be the same)
      
      This is an alternative approach to the idea in #69259, but note that
      they
      don't catch exactly the same test cases.
      c8e1fbc3
    • hassnaaHamdi's avatar
      [LLVM][AArch64][Assembly]: Add FAMINMAX assembly/disasse… (#70115) · b23426ee
      hassnaaHamdi authored
      …mbly.
      
      This patch adds the feature flag FAMINMAX and the assembly/disassembly
      for the following instructions of NEON, SVE2 and SME2:
      * NEON:
        - FAMIN
        - FAMAX
      * SVE2:
        - FAMIN_ZPmZ
        - FAMAX_ZPmZ
      * SME2:
        - FAMAX_2Z2Z
        - FAMIN_2Z2Z
        - FAMAX_4Z4Z
        - FAMIN_4Z4Z
      
      That is according to this documentation:
      https://developer.arm.com/documentation/ddi0602/2023-09
      
      
      
      Co-authored-by: default avatarCaroline Concatto <caroline.concatto@arm.com>
      b23426ee
    • Brad Smith's avatar
      7360c6ac
    • Owen Pan's avatar
    • Ivan Kosarev's avatar
      [AMDGPU] Give some of the VI V_PK_* instructions a subtarget predicate. (#70334) · f0899ede
      Ivan Kosarev authored
      This resolves AsmParser ambiguity between them and similar instructions
      for other subtargets, e.g., V_PK_SUB_U16_vi being identical to
      V_PK_SUB_U16_gfx11 on GFX11.
      
      Part of <https://github.com/llvm/llvm-project/issues/69256>.
      f0899ede
    • Andrzej Warzyński's avatar
      [mlir][SVE] Add an e2e test for vectorization of linalg.matmul (#70372) · 45e2e037
      Andrzej Warzyński authored
      Adds an end-to-end test for scalable vectorization of linalg.matmul.
      45e2e037
    • Nikita Popov's avatar
      [InstCombine] Remove redundant cast of GEP fold (NFC) · e4dc7d49
      Nikita Popov authored
      With opaque pointers, zero-index GEPs will be eliminated in
      general.
      e4dc7d49
    • tyb0807's avatar
      [mlir][Vector] Fix integration test for vector.maskedload narrow type… (#70431) · 4d4f6037
      tyb0807 authored
      … emulation
      
      Currently the expected CHECK values are not correct for
      `fcst_maskedload` from
      mlir/test/Integration/Dialect/Vector/CPU/test-rewrite-narrow-types.mlir
      4d4f6037
    • Owen Pan's avatar
      [clang-format][NFC] Remove more extraneous newlines in unit tests · 6c3bc910
      Owen Pan authored
      Also removed a duplicate test case.
      6c3bc910
    • Kunwar Grover's avatar
      Reland [mlir][tools] Introduce tblgen-to-irdl tool (#70121) · ec7c1a47
      Kunwar Grover authored
      This patch relands the reverted commit
      https://github.com/llvm/llvm-project/commit/e6e9beb977555c84fb16ffdd8dca8649c7d3091d
      after fixing the sanitizer issue.
      ec7c1a47
    • Rajveer Singh Bharadwaj's avatar
      [libc++] Fix _CopySegment helper in ranges::copy(join_view, out) when called... · dd489131
      Rajveer Singh Bharadwaj authored
      [libc++] Fix _CopySegment helper in ranges::copy(join_view, out) when called in a static assertion context (#69593)
      
      Resolves Issue #69083
      
      The `_CopySegment` helper for `ranges::copy(join_view, out)` is not
      `constexpr` causing rejection in `libc++` in a static assertion context
      as in the issue snippet.
      dd489131
    • Chuanqi Xu's avatar
      [C++20] [Modules] Chose BMI from for module m with the last · e9a7876c
      Chuanqi Xu authored
      -fmodule-file=<module-name>= option
      
      Currently if we have multiple `-fmodule-file=<module-name>=<BMI-path>`
      flags for the same `<module-name>`, we will pick the BMI-path from the
      first flag. And this is inconsistent with what users generally expect.
      e.g, we might expect the latter flags can override the former ones.
      
      This patch changes the behavior to match user's expectation.
      e9a7876c
    • Ami-zhang's avatar
    • tyb0807's avatar
    • Timm Bäder's avatar
      [clang][Interp][NFC] Rename a parameter · e64e4784
      Timm Bäder authored
      e64e4784
    • Timm Bäder's avatar
      051fade1
    • Brad Smith's avatar
    • Matt Arsenault's avatar
      AMDGPU: Add infinite looping testcase after subrange spilling change · b8b491c9
      Matt Arsenault authored
      This infinite looped after d8127b2b
      b8b491c9
    • Matthias Springer's avatar
      [mlir][vector] Fix off-by-one error in `getTransferChunkAccessed` (#70292) · e6e55e62
      Matthias Springer authored
      If a dimension does not appear in the permutation map of a vector
      transfer op, the size of the accessed slice in that dimension is `1`.
      Before this fix, `getTransferChunkAccessed` used to return `0` for such
      dimensions, which would means that `0` elements in the underlying
      tensor/memref are accessed.
      
      Note: There is no test case that fails due to this bug and because this
      interface method is currently only used in one place, it is hard to
      write a regression test. This fix is in preparation of subset hoisting
      functionality that will be added in subsequent commits.
      e6e55e62
    • Andrzej Warzyński's avatar
      [mlir][vector] Add scalable vectors to tests for vector.contract (#70039) · 5270df3d
      Andrzej Warzyński authored
      Update the remaining tests for matrix multiplication (_matmul_) in:
      
        * vector-contract-to-outerproduct-transforms.mlir
      
      with cases for scalable vectors.
      
      Note that in order for the "vector.contract -> vector.outerproduct"
      patterns to work, only the non-reduction dimension can be scalable (*).
      For Matmul operations that is set to be the N dimension (i.e. rows of
      the output matrix), which matches how matrix multiplication are normally
      implemented for e.g. Arm's SVE. However, making the M dimension scalable
      (i.e. columns of the output matrix) should work as well.
      
      Making both parellel dimensions scalable is left as a TODO for when
      support for 2-D scalable vectors is more established (this is
      work-in-progress as part of the effort to support Arm's SME in MLIR).
      
      The change in:
      
        * `UnrolledOuterProductGenerator`
      
      is a "bug fix" to make sure that the conversion pattern correctly
      propagates scalability when creating `arith.extf` operations.
      
      (*) The conversion tested in this file unrolls along the reduction
      dimension, which is not supported for scalable vectors.
      5270df3d
    • jeanPerier's avatar
      [flang] Implement legacy %VAL and %REF actual arguments (#70343) · 0a10e889
      jeanPerier authored
      Update evaluate::ActualArgument to propagate the %VAL and %REF markers
      until lowering.
      Semantic checks are added to %VAL to ensure the argument is a numerical
      or logical scalar.
      
      I did not push these markers into the characteristics because other
      compilers do not complain about inconsistent usages (e.g. using %VAL in
      a call on a procedure with an interface without VALUE dummies is not
      flagged by any compilers I tested, and it is not an issue for lowering,
      so I decided to stay simple here and minimize the footprint of these
      legacy features).
      
      Lowering retrieves these markers and does the right thing: pass %VAL in
      registers and pass %REF by address without adding any extra arguments
      for characters.
      0a10e889
    • Nikita Popov's avatar
      ea1909f8
    • Kristof Beyls's avatar
      [docs] Improve README: point to office hours and online sync-ups (#69323) · 1914bcfd
      Kristof Beyls authored
      The main README.md should probably be kept pretty short and be used to
      point new-comers to the most essential ways to get started on or get
      involved with LLVM.
      
      Therefore, this patch removes a pointer to IRC (not used very much these
      days), and does add pointers to office hours and online sync-ups.
      1914bcfd
    • Fangrui Song's avatar
      ccc57132
    • Petr Hosek's avatar
      [CMake] Address the issue introduced in #69869 · fb619b3c
      Petr Hosek authored
      While extracting the existing functionality into a function, one of the
      variable usages wasn't correctly updated.
      fb619b3c
    • Fangrui Song's avatar
    • Phoebe Wang's avatar
      [X86][EVEX512] Do not allow 512-bit memcpy without EVEX512 (#70420) · 58d4fe28
      Phoebe Wang authored
      Solves crash mentioned in #65920.
      58d4fe28
    • jeanPerier's avatar
      [flang] Move whole allocatable assignment implicit conversion to lowering (#70317) · 7046202c
      jeanPerier authored
      The front-end is making implicit conversions explicit in assignment and
      structure constructors.
      
      While this generally helps and is needed by semantics to fold structure
      constructors correctly, this is incorrect when the LHS or component is
      an allocatable. The RHS may have non default lower bounds that should be
      propagated to the LHS, and making the conversion explicit changes the
      semantics. In the structure constructor, the situation is even worse
      since Fortran 2018 7.5.10 point 7 allows the value to be a reference to
      an unallocated allocatable, and adding an explicit conversion in
      semantics will cause a segfault.
      
      This patch removes the explicit convert in semantics when the
      LHS/component is a whole allocatable, and update lowering to deal with
      the conversion insertion, dealing with preserving the lower bounds and
      the tricky structure constructor case.
      7046202c
    • Vitaly Buka's avatar
      Revert "[libc++][tests] Fix a few remaining instances of outdated static... · fde1ecde
      Vitaly Buka authored
      Revert "[libc++][tests] Fix a few remaining instances of outdated static assertion regexes in our test suite"
      
      Fails like https://lab.llvm.org/buildbot/#/builders/238/builds/6278/steps/11/logs/stdio on many bots.
      
      This reverts commit 166b3a86.
      fde1ecde
    • Mehdi Amini's avatar
    • Mehdi Amini's avatar
    • Mehdi Amini's avatar
    • Mehdi Amini's avatar
    • Mehdi Amini's avatar