Revert "[lldb] Show synthetic children in the return value of the thr… (#241947)
…ead desc…"
This reverts commit fd5f0a88dad6b034763b75bdc9e0021afc6634ab.
The test is failing on aarch64 ubuntu.
[SPARC] Read full LEON cycle counter (#240367)
Read the two cycle counter registers using a rollover-safe retry loop,
in a similar way to how it is done in RISC-V for cycleh/cycle on RV32.
The counter runs at a fixed CPU clock so llvm.readsteadycounter can use
the same counter.
Assisted-by: Claude
[libc][stdfix] Fix lrdivi saturation for huge quotients (#241213)
Issue #241209
`fixed_point::fxdivi` only did its early saturation check when
`OutRep::INTEGRAL_LEN > 0`. `long fract` has no integral bits, so it
went to
the `WF <= F` branch, where the 128-bit quotient is cast to the 64-bit
`WideStorage` before it is compared with MAX/MIN. For a huge quotient
the sign
of the saturated result then depended on the truncated bits, e.g.
`lrdivi(1L << 62, 3)` returned MIN instead of MAX.
Do the early saturation check for all output types `MAX_UNITS` is 1 for
types
without integral bits.
Add checks to `FxDiviTest.h` for 64-bit operands a huge numerator must
saturate according to the sign of the quotient.
AI usage for formatting the PR description.
[ConstraintElim] Split signed min/max across their operands when checking a compare
The existing constraint systems only record the bounds that hold for both
operands of a min/max (smax(a, b) >= a and >= b, smin(a, b) <= a and <= b). The
other direction is a disjunction, which cannot be recorded as a fact. When a
compare of signed decompositions involves a min/max result, split it into its
operands: the decomposition is monotonic in that result, so it is the max or min
of its values on each side, and the relation holds for all or for either side
respectively.
https://alive2.llvm.org/ce/z/zsGkJ-
[NVPTX][tests] Fix llvm/test/MC/ELF/dwarf5-duplicate-file-directive.s (#241775)
NVPTX does not support generating binary files, so require
object-emission in the test.
[HLSL][NFC] Fix fragile tests (#241625)
- Remove unstable attribute-group number
- Add anchor for function declaration to scope the checks to the
intended function.
[lldb][test] Run TestExprDiagnostics with PDB debug info (#240854)
`test_command_expr_sbdata` checks the note `"Ran expression as
'C++...'"`. With DWARF, it names the standard of the CU ("C++17").
CodeView's `S_COMPILE3` only records that the language is C++, so with
PDB the expression is displayed as `"ISO C++"`.
This patch expects that with PDB.
rdar://192360644
[CIR] Add CIR unit tests to check-clang-cir (#238102)
This change updates the CMake handling of the check-clang-cir and adds
lit config files to include CIR unit tests with the check-clang-cir
build target. This will ensure that these tests are run as part of the
mlir CI testing, which uses on check-clang-cir and not the full
check-clang target.
Assisted-by: Cursor / Grok 4.7
[lldb][ELF core] Store NT_FILE file offsets in bytes (#241003)
Linux `NT_FILE` notes encode each file offset as a page offset and
provide the page size separately. `ProcessElfCore` currently stores that
raw page offset in `NT_FILE_Entry::file_ofs`, even though the entry's
address ranges use bytes.
No existing consumer depends on `file_ofs` remaining in page units.
Convert it to bytes while parsing the note and document the field's unit
explicitly. This keeps the entry's offsets and addresses in consistent
units and makes it safe to use `file_ofs` directly in address
calculations.
Hexagon hmx (#240595)
Add driver options and assembler-level support for Hexagon Matrix
eXtensions (HMX), implemented in Hexagon v68 and v73. HMX is an
accelerator for matmul and convolution machine learning workloads.
There are several classes of instructions:
- matrix multiply: activation and weight; these two instructions must be
paired in one packet,
- bias load and store,
- convert transfer,
- write convert state,
- accumulator clear.
Only IEEE fp16 (hf) ISA variant is supported at this time.
The new target feature "hmx" is added to enable the HMX extensions.
In addition, new command line options are added: "-mhmx" in llvm-mc and
[8 lines not shown]
[ELF,test] Reduce the output size of some range extension tests (#241981)
For hexagon/loongarch/ppc64 tests, replace large .space fillers with
output section address (linker script), ensuring no test coverage loss
with mutation testing. Related to #202261
[HLSL] Handle `this` in dynamic resource indexing validation (#239876)
Fixes an `llvm_unreachable` assert in dynamic resource index validation
when a resource member is accessed in a member function using `this`.
Fixes #239858
[libc] Add mallinfo2() as external entrypoint. (#241662)
`mallinfo2` is the newer interface (available since glibc 2.33) that
replaces
legacy/deprecated `mallinfo`, and uses `struct mallinfo2` with properly
sized struct fields.
Scudo allocator implements this interface, and some of the code on Linux
tests for / uses this functionality from `<malloc.h>` header, so let us
define
it as an external entrypoint in LLVM-libc as well. One of such users
is LLVM itself, in `Process::GetMallocUsage()`.
Assisted-by: automated tooling, human-reviewed.
[libc] Enable -Werror in baremetal_common.cmake cache file
After recent fixes, all the warnings are gone in baremetal builds.
Enable -Werror again so that we can catch warnings as they come.
[InstCombine] Fix invalid returned attribute on memset (#235490)
This pr fixes the problem in InstCombine where the memset with returned
attribute changes into llvm intrinsc memset call which is invalid
because the original memset function returns a pointer and its first
marked argument is returned atrribute however the problem is llvm.memset
returns void .when atrributes are merged from old to new call ,returned
attribute still attached to pinter arguement .
This results in Invalid LLVM error and causes to report incompatible
arguement .
Changes made :
Updated mergeAttributesAndFlags in SimplifyLibCalls.cpp to remove the
returned parameter attribute when the new call returns void.
Added a regression test in memset-returned.ll to verify that InstCombine
simplifies the memset call without preserving the invalid attribute.
---------
Co-authored-by: jayadevthamatam <jayadevthamatam at gmail.com>
[libcxxabi] fix -Wunused-private-field (#241575)
-Wunused-private-field will soon be able to flag fields in instantiated
class templates. Land this in preparation.
The lone new instance is only defined when BUILDING_CXA_GUARD is
defined.
Link: #237374
[Matrix] Implement matrix support for the `mad` intrinsic (#239357)
Closes #184510.
This PR implements the matrix api for `mad` and adds matrix codegen
tests and matrix sema tests. Matrix backend tests were not added because
no DirectX or SPIRV backend changes were made.
Assisted-by: Claude Opus 5.5
[SandboxVec][Scheduler] Fix IR in unit test (#241656)
The unittest forms a scheduling bundle of stores S0 and S1. But there
used to be a dependency S0->S1, which is not allowed in a bundle. This
patch removes the dependency by changing the store address pointers.
[MLIR][NVVM] Add support for .s8.s4 types in nvvm.ldmatrix (#241153)
This patch adds support for the `.s8.s4` types for the `ldmatrix` instruction with the `.m8n16` shape, introduced in PTX ISA 9.4. The source data is a sequence of signed 4-bit elements that are expanded to signed 8-bit values during the load.
PTX ISA Reference: https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-instructions-ldmatrix
Assisted by: Claude (Opus 5.5)
[flang] Track character temporary lifetimes for safe stack placement
Dynamic character expression buffers could grow the stack on every
iteration of an unstructured loop because their lifetimes were hidden
from allocation placement. Emit hlfir.destroy for them, add an explicit
cleanup region to hlfir.yield_element, and preserve both through array
constructor lowering, elemental inlining, WHERE lowering and
bufferization, which now allocates these buffers with fir.allocmem.
When such an allocation cannot be hoisted out of the loop, reclaim its
stack space with one stacksave/stackrestore pair per block. Allocation
placement then keeps these temporaries on the stack in every mode,
including offload regions (except under -fdynamic-heap-array).
[flang] Address review comments on character temporary lifetimes
- stack-arrays: accept blocks with properly nested stacksave/stackrestore
pairs, such as the ones around calls with a runtime-length result, as
long as the allocations made inside a pair are freed before its end.
These allocations then reuse that pair.
Document that the block scope makes the peak stack the sum of the
promoted allocations.
- Only create a cleanup region from the current statement context scope,
so that array constructors do not get empty cleanup regions that block
elemental inlining.
- Always allocate kind conversion buffers on the heap and let allocation
placement move them to the stack, so that constant-length ones are
hoisted out of loops.
- Canonicalize away the hlfir.concat, hlfir.char_trim, hlfir.set_length
and hlfir.char_extremum results whose only uses are hlfir.destroy, such
as the SET_LENGTH bypassed by structure constructor lowering.
- Do not let hlfir.associate take over the storage of an hlfir.no_reassoc
operand that has other uses.
- Use %flang_fc1 in the new Fortran tests.