548388 Commits

Author SHA1 Message Date
Orlando Cazalet-Hyams
8c7e1ab98e
[Dexter] Add DAP stepNext and stepOut support (#152717) 2025-08-13 13:57:53 +01:00
David Spickett
dece902a52 [lldb][MCP] Fix compiler error in Windows on Arm build
Caused by https://github.com/llvm/llvm-project/pull/153297.

This is likely not Windows on Arm specific but the other Windows bots
don't have this problem.

json::parse tries to construct llvm::Expected<Message> by moving another
instance of Message into it. This would normally use this constructor:
```
  /// Create an Expected<T> success value from the given OtherT value, which
  /// must be convertible to T.
  template <typename OtherT>
  Expected(OtherT &&Val,
           std::enable_if_t<std::is_convertible_v<OtherT, T>> * = nullptr)
<...>
```
Note that llvm::Expected does not have a T&& constructor. Presumably
the authors thought the converting one would be used.

Except that in our build, using clang-cl 19.1.7, Visual Studio 2022,
MSVC STL 202208, somehow is_convertible_v is false for Message.

If you add a static_assert to check that this is the case, it suddenly
becomes convertible. As best I can understand, this is because evaluation
of the properties of Message are delayed. Delayed so much that by the time
the constructor is called, it's still false.

So we can "fix" this by asserting that it is convertible some time before
it is checked by the constructor.

I'm not sure if that's a compiler problem or the way MSVC STL's variant is
written. I couldn't reproduce this behaviour in smaller examples or on Linux
systems. This is the least invasive fix and only touches the new lldb code,
so I'm going with it.

Including the whole error here because it's a strange one and maybe later
someone who has a clue about this can fix it in a better way.

```
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build>ninja
[5/15] Building CXX object tools\lldb\source\Pro...CP\CMakeFiles\lldbProtocolMCP.dir\Server.cpp.obj
FAILED: tools/lldb/source/Protocol/MCP/CMakeFiles/lldbProtocolMCP.dir/Server.cpp.obj
C:\Users\tcwg\scoop\shims\ccache.exe C:\Users\tcwg\scoop\apps\llvm-arm64\current\bin\clang-cl.exe  /nologo -TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\tools\lldb\source\Protocol\MCP -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\source\Protocol\MCP -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\tools\lldb\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include -IC:\Users\tcwg\scoop\apps\python\current\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\..\clang\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\tools\lldb\..\clang\include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\source -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\tools\lldb\source /DWIN32 /D_WINDOWS   /Zc:inline /Zc:__cplusplus /Oi /Brepro /bigobj /permissive- -Werror=unguarded-availability-new /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported /Gw -Wno-vla-extension /O2 /Ob2 /DNDEBUG -std:c++17 -MD   -wd4018 -wd4068 -wd4150 -wd4201 -wd4251 -wd4521 -wd4530 -wd4589  /EHs-c- /GR- /showIncludes /Fotools\lldb\source\Protocol\MCP\CMakeFiles\lldbProtocolMCP.dir\Server.cpp.obj /Fdtools\lldb\source\Protocol\MCP\CMakeFiles\lldbProtocolMCP.dir\lldbProtocolMCP.pdb -c -- C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\source\Protocol\MCP\Server.cpp
In file included from C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\source\Protocol\MCP\Server.cpp:9:
In file included from C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\include\lldb/Protocol/MCP/Server.h:12:
In file included from C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\include\lldb/Protocol/MCP/Protocol.h:17:
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Support/JSON.h(938,12): error: no viable conversion from returned value of type 'remove_reference_t<variant<Request, Response, Notification> &>' (aka 'std::variant<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>') to function return type 'Expected<variant<Request, Response, Notification>>'
  938 |     return std::move(Result);
      |            ^~~~~~~~~~~~~~~~~
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\source\Protocol\MCP\Server.cpp(57,30): note: in instantiation of function template specialization 'llvm::json::parse<std::variant<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>>' requested here
   57 |   auto message = llvm::json::parse<Message>(/*JSON=*/data);
      |                              ^
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Support/Error.h(485,40): note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'remove_reference_t<variant<Request, Response, Notification> &>' (aka 'std::variant<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>') to 'const Expected<variant<Request, Response, Notification>> &' for 1st argument
  485 | template <class T> class [[nodiscard]] Expected {
      |                                        ^~~~~~~~
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Support/Error.h(507,3): note: candidate constructor not viable: no known conversion from 'remove_reference_t<variant<Request, Response, Notification> &>' (aka 'std::variant<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>') to 'Error &&' for 1st argument
  507 |   Expected(Error &&Err)
      |   ^        ~~~~~~~~~~~
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Support/Error.h(521,3): note: candidate constructor not viable: no known conversion from 'remove_reference_t<variant<Request, Response, Notification> &>' (aka 'std::variant<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>') to 'ErrorSuccess' for 1st argument
  521 |   Expected(ErrorSuccess) = delete;
      |   ^        ~~~~~~~~~~~~
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Support/Error.h(539,3): note: candidate constructor not viable: no known conversion from 'remove_reference_t<variant<Request, Response, Notification> &>' (aka 'std::variant<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>') to 'Expected<variant<Request, Response, Notification>> &&' for 1st argument
  539 |   Expected(Expected &&Other) { moveConstruct(std::move(Other)); }
      |   ^        ~~~~~~~~~~~~~~~~
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Support/Error.h(526,3): note: candidate template ignored: requirement 'std::is_convertible_v<std::variant<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>, std::variant<lldb_protocol::mcp::Request, lldb_protocol::mcp::Response, lldb_protocol::mcp::Notification>>' was not satisfied [with OtherT = remove_reference_t<variant<Request, Response, Notification> &>]
  526 |   Expected(OtherT &&Val,
      |   ^
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Support/Error.h(544,3): note: candidate template ignored: could not match 'Expected' against 'variant'
  544 |   Expected(Expected<OtherT> &&Other,
      |   ^
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Support/Error.h(552,12): note: explicit constructor is not a candidate
  552 |   explicit Expected(
      |            ^
1 error generated.
[8/15] Building CXX object tools\lldb\source\Plu...nProtocolServerMCP.dir\ProtocolServerMCP.cpp.obj
ninja: build stopped: subcommand failed.
```
2025-08-13 12:55:40 +00:00
Simon Pilgrim
9ce3aff0c3 [X86] avx512bw-builtins.c - add C/C++ test coverage
Catches a typo in the _mm512_adds_epu8 constexpr test
2025-08-13 13:54:18 +01:00
Simon Pilgrim
5c95b83644 [X86] builtin_test_helpers.h - ensure the match_v*qi matchers work with -fno-signed-char tests
Work with explicit signed char types to avoid signed/unsigned char truncation out of bounds warnings
2025-08-13 13:54:17 +01:00
Simon Pilgrim
11186afcc8 [X86] avx512bw-builtins.c - avoid _mm256_setr_epi8 inside constexpr tests
Avoid nested intrinsics in constexpr tests - use __32qs instead to work correctly with -fno-signed-char tests
2025-08-13 13:54:17 +01:00
Michael Kruse
b010b7ea89
Remember LLVM_ENABLE_LIBCXX setting in installed configuration (#139712)
Updated version of #134990 which was reverted because of the buildbot
[openmp-offload-amdgpu-runtime-2](https://lab.llvm.org/buildbot/#/builders/10)
failing. Its configuration has `LLVM_ENABLE_LIBCXX=ON` set although it
does not even have libc++ installed. In addition to #134990, this PR
adds a check whether C++ libraries are actually available. `#include
<chrono>` was chosen because this is the library that
[openmp-offload-amdgpu-runtime-2 failed
with](https://github.com/llvm/llvm-project/pull/134990#issuecomment-2792138162).

Original summary:

The buidbot
[flang-aarch64-libcxx](https://lab.llvm.org/buildbot/#/builders/89) is
currently failing with an ABI issue. The suspected reason is that
LLVMSupport.a is built using libc++, but the unittests are using the
default C++ standard library, libstdc++ in this case. This predefined
`llvm_gtest` target uses the LLVMSupport from `find_package(LLVM)`,
which finds the libc++-built LLVMSupport.

To fix, store the `LLVM_ENABLE_LIBCXX` setting in the LLVMConfig.cmake
such that everything that links to LLVM libraries use the same standard
library. In this case discussed in
https://github.com/llvm/llvm-zorg/pull/387 it was the flang-rt
unittests, but other runtimes with GTest unittests should have the same
issue (e.g. offload), and any external project that uses
`find_package(LLVM)`. This patch fixed the problem for me locally.
2025-08-13 14:52:59 +02:00
Jonathan Thackray
69452d50ce
[AArch64][llvm] Unify AArch64 tests into a single file (1/4) (NFC) (#146328)
This is a series of patches (1/4) to unify assembly/disassembly of
recent AArch64 tests into a single file. The aim is to improve
consistency, so that all instructions and system registers are
thoroughly tested, and future test cases will be in a unified format.

This patch:
 * unifies errorless .s and .txt tests into a single file
 * remove .txt tests which don't have feature requirements
* makes the .s tests have a roundabout run line to test both encoding
and assembly
 
See also #146329, #146330 and #146331.

---------

Co-authored-by: Virginia Cangelosi <virginia.cangelosi@arm.com>
2025-08-13 13:45:25 +01:00
Benjamin Maxwell
9c361cc068
[TableGen] Avoid duplicate variable names in RuntimeLibcallsEmitter (partial reland of #152505) (#153398) 2025-08-13 12:43:21 +00:00
Simon Pilgrim
11ef62f087
[X86] Check the exact fp bits and not just fp equality for constexpr tests (#153383)
We missed several +/-0.0 comparison mismatches due to only doing equality checks
2025-08-13 13:34:55 +01:00
Krzysztof Parzyszek
dc1c9d3f4f
[flang][Evaluate] Pattern matching framework for evaluate::Expr (#153042)
Implement a framework to make it easier to detect if evaluate::Expr<T>
has certain structure.
2025-08-13 07:24:36 -05:00
Thibault Monnier
b75896bc45
[Clang] Optimize tok::isLiteral with range-based condition (#153228)
This commit optimizes `tok::isLiteral` by replacing a succession of `13`
conditions with a range-based check.

I am not sure whether this is allowed. I believe it is done nowhere else
in the codebase ; however, I have seen range-based conditions being used
with other enums.

---------

Co-authored-by: Corentin Jabot <corentinjabot@gmail.com>
2025-08-13 08:18:11 -04:00
Nikita Popov
48beed5b71
Revert "[AArch64][SME] Port all SME routines to RuntimeLibcalls" (#153392)
This introduced a 5% compile-time regression on AArch64, see
https://llvm-compile-time-tracker.com/compare.php?from=b9138bde3562de5c28a239dbd303caf2406678c6&to=271688b87abe7cf45aceaff8266270a25eb7b436&stat=instructions:u.

Reverts llvm/llvm-project#152505.
2025-08-13 11:54:39 +00:00
Paul Walker
be3a7a67d7
[NFC][Clang][AArch64] Simplify ACLE guards within arm_sve.td & arm_sme.td. (#152547)
Only set a target guard if it deviates from its default value[1].

When a target guard is set, it is automatically AND'd with its default
value. This means there is no need to use SVETargetGuard="sve,bf16"
because SVETargetGuard="bf16" is sufficient.

[1] Defaults: SVETargetGuard="sve", SMETargetGuard="sme"
2025-08-13 12:53:17 +01:00
Matthias Springer
2fcdabaf39
[mlir][DialectUtils] Fix div by zero crash (#153380) 2025-08-13 13:38:57 +02:00
Florian Hahn
10a6fd70d6
[LV] Regenerate checks for test (NFC).
Auto-generate check lines for scalable-loop-unpredicated-body-scalar-tail.ll,
while also updating the input to be more compact and avoid unnecessary
checks to keep auto-generated checks compact without loss of
generality.
2025-08-13 12:20:50 +01:00
Benjamin Chetioui
e861e4957f
Fix bazel BUILD after 7d1b9cad873f585309c9892c091f990fbebff878 (#153388) 2025-08-13 11:01:44 +00:00
Lang Hames
88c993fbc5 [ORC] Fix typo in comment. NFC. 2025-08-13 20:47:54 +10:00
Simon Pilgrim
4e10b62442 [X86] avx512vldq-builtins.c - add C/C++ and 32/64-bit test coverage 2025-08-13 11:40:27 +01:00
Baz
e141da8a62
[mlir][ExecutionEngine] fix default free function in OwningMemRef. (#153133)
`basePtr` should be freed instead of `data` because it is the one which
is storing the output of `malloc`. In `allocAligned()`, the `data` is
malloced and then assigned to `basePtr`.
2025-08-13 10:23:04 +00:00
Ahmad Yasin
1f2fb8e979
[AArch64] Tune unrolling prefs for more patterns on Apple CPUs (#149358)
Enhance the heuristics in `getAppleRuntimeUnrollPreferences` to let a
bit more loops to be unrolled.

Specifically, this patch adjusts two checks:
I. Tune the loop size budget from 8 to 10
II. Include immediate in-loop users of loaded values in the load/stores
dependencies predicate

---------

Co-authored-by: Florian Hahn <flo@fhahn.com>

PR: https://github.com/llvm/llvm-project/pull/149358
2025-08-13 11:16:54 +01:00
Sergey Kachkov
bdddff2488
[RISCV][RVV] Prohibit conversion of scalar store to single-element vse if vmv.x.s has multiple uses (#152112)
Godbolt example: https://godbolt.org/z/ThdfP475a

In the example single-element vse is used to store reduction result
instead of scalar store ([this optimization was introduced by this
patch](https://reviews.llvm.org/D109482)). However, vmv.x.s can't be
eliminated here because it has other uses (e.g. CopyToReg), so it seems
more profitable to use scalar store (we already have store value in a
scalar register, and can save one vsetvli which is likely to be required
for single-element vse). The proposed solution is to this transform only
if vmv.x.s has one use (in store instruction)
2025-08-13 13:10:27 +03:00
Orlando Cazalet-Hyams
d13341db26
[RemoveDIs][NFC] Remove getAssignmentMarkers (#153214)
getAssignmentMarkers was for debug intrinsics. getDVRAssignmentMarkers
is used for DbgRecords.
2025-08-13 10:56:19 +01:00
Lakshay Kumar
d35686b25c
[llvm-exegesis] Print generated assembly snippet (#142540)
Debug generated disassembly by passing argument
`debug-only="print-gen-assembly"` or `debug-only=preview-gen-assembly`
of exegesis call.
`--debug-only="print-gen-assembly"` debugs the whole generated assembly
snippet .
`--debug-only=preview-gen-assembly` debugs the initial 10 instructions
and ending 3 lines.
Thus, We can in glance see the initial setup code like registers setup
and instruction followed by truncated middle and finally print out the
last 3 instructions.

This helps us look into assembly that exegesis is execution in hardware,
Thus, it is simply functionally alias to separate objdump command on the
dumped object file.
2025-08-13 10:37:24 +01:00
Simon Pilgrim
91fff70740
[clang][X86] Replace vprot/vprol/vpror/vshld/vshrd intrinsics with __builtin_elementwise_fshl/fshr (#153229)
Replaces the XOP/AVX512 per-element rotation/funnel shift builtins with the generic __builtin_elementwise_fshl/fshr

We still have uniform immediate variants to handle next.

Part of #153152
2025-08-13 10:28:30 +01:00
Yatao Wang
a9a0978c1d
[Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr (#153088)
This PR allows the following MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr
```
_mm_adds_pi8
_mm_adds_pi16
_mm_subs_pi8
_mm_subs_pi16

_mm_adds_pu8
_mm_adds_pu16
_mm_subs_pu8
_mm_subs_pu16

_mm_adds_epi8
_mm_adds_epi16
_mm_subs_epi8
_mm_subs_epi16

_mm_adds_epu8
_mm_adds_epu16
_mm_subs_epu8
_mm_subs_epu16

_mm256_adds_epi8
_mm256_adds_epi16
_mm256_subs_epi8
_mm256_subs_epi16

_mm256_adds_epu8
_mm256_adds_epu16
_mm256_subs_epu8
_mm256_subs_epu16

_mm512_adds_epi8
_mm512_adds_epi16
_mm512_subs_epi8
_mm512_subs_epi16

_mm512_adds_epu8
_mm512_adds_epu16
_mm512_subs_epu8
_mm512_subs_epu16
```

Fixes #152506

---------

Co-authored-by: Simon Pilgrim <llvm-dev@redking.me.uk>
2025-08-13 10:27:40 +01:00
Michael Buch
c68b4d64dd [lldb][ClangASTImporter][NFC] Create helper for CanImport
Upstreams a `CanImport` helper for `clang::Decl`s.
2025-08-13 10:22:23 +01:00
Michael Buch
89681839e3 [lldb][ClangASTImporter][NFC] Factor out completion logic out of ClangASTImporterDelegate
Upstreams two helpers that make this more readable.
2025-08-13 10:22:23 +01:00
Ahmed Bougacha
8c8f3286a7
[compiler-rt] Don't run arm64e builtins tests on darwin. (#153312)
The compiler-rt build gradually learned to target arm64e. With that, we
build builtins for arm64e, but running their tests usually isn't
possible, because most versions of macOS so far restrict arm64e (on
account of its unstable ABI).

Starting with macOS 26, arm64e executables can be run, because the
aligned linker automatically targets ptrauth ABI version 1. Without
that, (at ABI version 0) these can't be executed.

We can't rely or require new linkers (and we elsewhere explicitly
fallback to ld classic anyway), so in the meantime one way to execute
these would be to explicitly ask for ABI version 1, which we generally
try to avoid, and don't support in our llvm (which unconditionally
targets ABI version 0).

This is also an uncommon situation; sanitizer runtime tests aren't run
on arm64e today, because we haven't listed arm64e as a supported arch
yet.
Everything other than builtins also tests for execution in cmake first;
we should consider that, but it has its own problems.

So we can simply disable arm64e from tests, by filtering it out as a
valid darwin host arch, which accurately reflects reality.

When we try to add arm64e sanitizer runtime build and test support,
we'll want to change that, but that's a bigger problem than builtins.
2025-08-13 10:21:34 +01:00
Adam Siemieniuk
7d1b9cad87
[mlir][amx] Vector to AMX conversion pass (#151121)
Adds a pass for Vector to AMX operation conversion.

Initially, a direct rewrite for vector contraction in packed VNNI layout
is supported. Operations are expected to already be in shapes which are
AMX-compatible for the rewriting to occur.
2025-08-13 11:08:52 +02:00
Nikita Popov
240c454c4d
[CodeGen] Remove default ctors for InputArg and OutputArg (#153205)
These make it easy to forget to initialize some members, like the newly
added OrigTy. Force these to always go through the ctor instead.
2025-08-13 10:51:43 +02:00
David Spickett
b563b274b8
[lldb] Convert registers values into target endian for expressions (#148836)
Relates to https://github.com/llvm/llvm-project/issues/135707

Where it was reported that reading the PC using "register read" had
different results to an expression "$pc".

This was happening because registers are treated in lldb as pure
"values" that don't really have an endian. We have to store them
somewhere on the host of course, so the endian becomes host endian.

When you want to use a register as a value in an expression you're
pretending that it's a variable in memory. In target memory. Therefore
we must convert the register value to that endian before use.

The test I have added is based on the one used for XML register flags.
Where I fake an AArch64 little endian and an s390x big endian target. I
set up the data in such a way the pc value should print the same for
both, either with register read or an expression.

I considered just adding a live process test that checks the two are the
same but with on one doing cross endian testing, I doubt it would have
ever caught this bug.

Simulating this means most of the time, little endian hosts will test
little to little and little to big. In the minority of cases with a big
endian host, they'll check the reverse. Covering all the combinations.
2025-08-13 09:48:29 +01:00
David Spickett
dc41571cd8
[llvm][docs] Update CMake commands for cross compiling Arm builtins (#151544)
This does a few things:
* LLVM_CONFIG_PATH is deprecated, use LLVM_CMAKE_DIR instead.
* Don't use $ before command examples. I would normally, but the key
cmake commands didn't use it so I removed it from all commands.
* Makes the commands shown full commands, so you don't have to piece
them together.
* Uses shell variables to cut down on repetition and make this easier to
port to other targets.
* Adds a few options to disable more compiler-rt things.
* Use the built in cmake options for sysroot and toolchains.
* Include test options in the first cmake command, so you don't have to
re-do the whole thing after you read the testing section.
* Removes the section about using BaremetalARM.cmake.

The closest I got to getting that cache to work was:
```
SYSROOT=/home/david.spickett/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/arm-none-eabi/libc
LLVM_TOOLCHAIN=/home/david.spickett/LLVM-20.1.8-Linux-X64/

cmake \
  -G Ninja \
  -DCMAKE_C_COMPILER=${LLVM_TOOLCHAIN}/bin/clang \
  -DBAREMETAL_ARMV6M_SYSROOT=${SYSROOT} \
  -DBAREMETAL_ARMV7M_SYSROOT=${SYSROOT} \
  -DBAREMETAL_ARMV7EM_SYSROOT=${SYSROOT} \
  -DCMAKE_BUILD_TYPE=Release \
  -DLLVM_ENABLE_RUNTIMES="compiler-rt" \
  -C ../llvm-project/clang/cmake/caches/BaremetalARM.cmake \
  -DCOMPILER_RT_BUILD_BUILTINS=ON \
  -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
  -DCOMPILER_RT_BUILD_MEMPROF=OFF \
  -DCOMPILER_RT_BUILD_PROFILE=OFF \
  -DCOMPILER_RT_BUILD_CTX_PROFILE=OFF \
  -DCOMPILER_RT_BUILD_SANITIZERS=OFF \
  -DCOMPILER_RT_BUILD_XRAY=OFF \
  -DCOMPILER_RT_BUILD_ORC=OFF \
  -DCOMPILER_RT_BUILD_CRT=OFF \
  ../llvm-project/runtimes
```
All this does is build the x86 builtins. I tried forcing the issue with:
```
  -DBUILTIN_SUPPORTED_ARCH="armv7m;armv6m;armv7em" \
```
But again, just x86.

It's probably something deep in compiler-rt failing a compiler check for
the Arm targets. Even if that's the case, fixing that means adding more
options to the cmake command.

I can't find evidence of a full command using this cache file since the
commit that introduced it and that command no longer works.

I think if you ever got this to work again the command would be as long
and complex as the ones already shown in the document.

I would also argue that some of the other caches, for example Fuschia's,
are much better example of multi-target runtimes builds. If what's in
this document isn't enough, folks should be learning from those files
and about the runtimes build overall before attempting anything complex
(though it does not take much to be "complex").
2025-08-13 09:47:43 +01:00
Diana Picus
420a5de1a4
[AMDGPU] Ignore inactive VGPRs in .vgpr_count (#149052)
When using the `amdgcn.init.whole.wave` intrinsic, we add dummy VGPR
arguments with the purpose of preserving their inactive lanes. The
pattern may look something like this:

```
entry:
  call amdgcn.init.whole.wave
  branch to shader or tail

shader:
  $vInactive = IMPLICIT_DEF ; Tells regalloc it's safe to use the active lanes
  actual code...

tail:
  call amdgcn.cs.chain [...], implicit $vInactive
```

We should not report these VGPRs in the `.vgpr_count` metadata. This
patch achieves that goal by ignoring meta instructions and calls. This should
be safe since if those registers are actually used in any other context,
they will be counted there. The same reasoning applies in the general
case, so we don't explicitly check for the existence of `init.whole.wave`.

This is a reworked version of #133242, which was reverted in #144039
and split into smaller bits.
2025-08-13 10:47:00 +02:00
Ryotaro Kasuga
bf6796fa8f
[DA] Extract duplicated logic from exactSIVtest and exactRDIVtest (NFC) (#152712)
This patch refactors `exactSIVtest` and `exactRDIVtest` by consolidating
duplicated logic into a single function. Same as #152688, the main goal
is to improve code maintainability, since extra validation logic (as
written in TODO comments) may be necessary.
2025-08-13 17:45:28 +09:00
Timm Baeder
56131e3959
[clang][bytecode] Diagnose incomplete types more consistently (#153368)
To match the diagnostics of the current interpreter.
2025-08-13 10:40:21 +02:00
Nikolas Klauser
78636be4d6
[libc++] Move more tests into test/extensions (#152975)
This should be the last set of tests moved to `test/extensions` for now.
2025-08-13 10:14:24 +02:00
Nikolas Klauser
3ca414b63a
[libc++] Move some standard tests from test/libcxx (#152982)
This also removes some tests which were redundant, wrong, or never run.
Specifically,

- `libcxx/utilities/meta/stress_tests/*` were never run and are of
questionable usefulness
- `libcxx/utilities/template.bitset/includes.pass.cpp` is completely
redundant and partially incorrect

Also notably,
`libcxx/language.support/support.c.headers/support.c.headers.other/math.lerp.verify.cpp`
has been refactored to only test the standard mandate.
2025-08-13 10:13:46 +02:00
Simon Pilgrim
267f592ca0
[Headers][X86] Allow _mm_cmov_si128/_mm256_cmov_si256 intrinsics to be used in constexpr (#153236) 2025-08-13 08:53:26 +01:00
Benjamin Maxwell
271688b87a
[AArch64][SME] Port all SME routines to RuntimeLibcalls (#152505)
This updates everywhere we emit/check an SME routines to use
RuntimeLibcalls to get the function name and calling convention.

Note: RuntimeLibcallEmitter had some issues with emitting non-unique
variable names for sets of libcalls, so I tweaked the output to avoid
the need for variables.
2025-08-13 08:48:59 +01:00
Mel Chen
b9138bde35
[LV][EVL] More lit tests for interleaved access. nfc (#152959)
Add test cases for reverse interleaved access and interleaved access
with gap.
2025-08-13 15:43:39 +08:00
Jasmine Tang
d32793ca6e
Revert "[WebAssembly] Combine i128 to v16i8 for setcc & expand memcmp for 16 byte loads with simd128" (#153360)
Reverts llvm/llvm-project#149461

The first test w/ memcmp in `test/neon/test_neon_wasm_simd.cpp` in the
Emscripten test suite has failed. This PR applies a revert so I can take
a closer look at it

Test case link:
https://github.com/emscripten-core/emscripten/blob/main/test/neon/test_neon_wasm_simd.cpp

Compile option: `em++ test_neon_wasm_simd.cpp -O2 -mfpu=neon -msimd128
-o something.js`

Original comment report:
https://github.com/llvm/llvm-project/pull/149461#issuecomment-3181652746
2025-08-13 07:41:44 +00:00
Florian Hahn
48bfaa4c06
[VPlan] Replace VPBB for vector.ph during skeleton creation (NFC)
Shift replacement of regular VPBB for vector.ph with the VPIRBB wrapping
the created IR block directly to skeleton creation, to be consistent
with how the scalar preheader is handled.
2025-08-13 08:30:18 +01:00
Aiden Grossman
dfe18b1a0e
[libcxx] Bump clang version to v22 (#153264)
Clang tip of tree is now v22, so bump the versions based on that now
that we have an updated container image.

---------

Co-authored-by: Nikolas Klauser <nikolasklauser@berlin.de>
2025-08-13 09:26:42 +02:00
Abhishek Kaushik
2415e3b3bf
[NFC][MC][GOFF] Use llvm_unreachable for unreachable case (#152930) 2025-08-13 12:56:12 +05:30
Aiden Grossman
7f4d201db4
[libcxx] Bump container image to 77cb098 (#153095)
Switch to the next runner set to evaluate switching the container image
to 77cb098.
2025-08-13 09:24:02 +02:00
Matt Arsenault
db126d8004
CodeGen: Make MachineFunction's subtarget member a reference (#153352) 2025-08-13 16:22:32 +09:00
yanming
02ab6f358c [flang][fir][NFC] unify flang's code style with the rest. 2025-08-13 15:11:06 +08:00
Sergei Barannikov
8f3254aa4a
[TableGen][DecoderEmitter] Returns insn_t / std::vector<Islands> by value (NFC) (#153354)
The containers passed by reference are always empty on entry to the
functions that fill them. Return them by value instead and let the
compiler do the return value optimization.
2025-08-13 07:09:13 +00:00
Valentin Clement (バレンタイン クレメン)
2ae4e95dda
[flang][cuda] Add bind name for __ddiv_XX interfaces (#153271) 2025-08-12 23:30:43 -07:00
Valentin Clement (バレンタイン クレメン)
60170f92a3
[flang][cuda] Add missing interface for __powf (#153294)
`__powf` is defined in the CUDA Fortran programming guide but it's
missing from our cudadevice module. Add the interface and bind name to
`__nv_powf`


https://docs.nvidia.com/hpc-sdk/compilers/cuda-fortran-prog-guide/index.html#fortran-device-modules


https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_powf.html#__nv_powf
2025-08-12 23:08:41 -07:00