LLVM/project 328ef15lldb/include/lldb/Target Target.h RegisterTypeBuilder.h, lldb/source/Core DumpRegisterValue.cpp

[lldb] Refactor RegisterTypeBuilder

This prepares it for emitting union types. Major changes:
* Entry function is now a dispatcher to builder functions for each type.
* Name mangling is standardised.
* The register name parameter is no longer needed and so was removed.
DeltaFile
+107-86lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
+12-3lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.h
+2-4lldb/source/Target/Target.cpp
+2-3lldb/include/lldb/Target/Target.h
+2-3lldb/include/lldb/Target/RegisterTypeBuilder.h
+2-2lldb/source/Core/DumpRegisterValue.cpp
+127-1016 files

LLVM/project 855082clldb/source/Plugins/Process/FreeBSD NativeRegisterContextFreeBSD_arm64.cpp, lldb/source/Plugins/Process/Linux NativeRegisterContextLinux_arm64.cpp

[lldb] Make RegisterFlagsDetector into RegisterTypesDetector

In future it may be generating things other than flags. Functionality
is the same, but the interface changes to use RegisterType.
DeltaFile
+348-0lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.cpp
+0-334lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.cpp
+0-101lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.h
+99-0lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.h
+9-9lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+7-7lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp
+463-4513 files not shown
+472-4609 files

LLVM/project 7a96475lldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.cpp, lldb/test/API/functionalities/gdb_remote_client TestXMLRegisterFlags.py

Add test for ID overlap
DeltaFile
+44-0lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py
+2-2lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+46-22 files

LLVM/project 98704f5lldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.cpp, lldb/test/API/functionalities/gdb_remote_client TestXMLRegisterFlags.py

use first instance of duplicated ID
DeltaFile
+19-8lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+3-4lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py
+22-122 files

LLVM/project 14a5b52lldb/include/lldb/Utility RegisterType.h RegisterTypeFlags.h, lldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.h ProcessGDBRemote.cpp

[lldb] Store all XML register types in a single string map

We are assuming that their ID's are unique, so there's no need to keep
separate maps. We can do basic type checking by checking the kind of
the type pointed to.

A few more methods were added to the base RegisterType. GetSize()
returns 0 for enums because enums don't have a size until they are
used by a register. This is not ideal but it works for now.
DeltaFile
+64-70lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+7-8lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+11-3lldb/include/lldb/Utility/RegisterTypeFlags.h
+6-0lldb/include/lldb/Utility/RegisterType.h
+2-2lldb/source/Utility/RegisterTypeFlags.cpp
+90-835 files

LLVM/project 510241dlldb/include/lldb/Core DumpRegisterInfo.h, lldb/source/Core DumpRegisterInfo.cpp DumpRegisterValue.cpp

[lldb] Convert uses of RegisterTypeFlags into RegisterType (#213886)

So we are using the generic interface that will work with
all future RegisterType derived classes.

Right now we'll only be asked to print RegisterTypeFlags, so
there's a few dyn_cast to that. Later we will switch on the
kind, and support rendering more types.
DeltaFile
+16-12lldb/source/Core/DumpRegisterValue.cpp
+9-3lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
+4-5lldb/source/Core/DumpRegisterInfo.cpp
+6-2lldb/unittests/Core/DumpRegisterInfoTest.cpp
+3-2lldb/source/Target/Target.cpp
+2-2lldb/include/lldb/Core/DumpRegisterInfo.h
+40-268 files not shown
+48-3414 files

LLVM/project e122990clang/lib/Frontend CompilerInvocation.cpp, clang/lib/Sema SemaDecl.cpp

[Clang][AIX] Error on -mloadtime-comment-vars in cc1 for non-AIX targets

The driver continues to warn and drop the option for unsupported targets;
cc1, reachable directly or via -Xclang, now rejects it with
err_drv_unsupported_opt_for_target, mirroring the -mabi=quadword-atomics
and -mxcoff-roptr checks.
DeltaFile
+4-19clang/test/CodeGen/PowerPC/loadtime-comment-vars.c
+6-6clang/test/Sema/loadtime-comment-vars.c
+6-0clang/lib/Frontend/CompilerInvocation.cpp
+0-5clang/lib/Sema/SemaDecl.cpp
+16-304 files

LLVM/project bd74981libc/test/src/stdio sprintf_test.cpp

[libc] Fix two issues in sprintf_test after #213860 (#214435)

PR #213860 enabled the test on GPU targets (which only runs hermetic
tests), exposing two issues.

The first one is passing "pointer" values as `int`s. On AMDGPU, this
produced garbage in the high bits of the printed value, presumably the
result of reading a short `int` as a (longer) `void *`. On other this
probably worked because the value is passed in a register, which
(implicitly) zeroes out high bits. I fix this by casting the argument to
a `uintptr_t`.

The second error is a crash in the wide char test. I restore status quo
by disabling that part of the test, but I've filed #214433 to figure out
a long term solution.
DeltaFile
+15-8libc/test/src/stdio/sprintf_test.cpp
+15-81 files

LLVM/project abdef49lldb/include/lldb/Target Target.h RegisterTypeBuilder.h, lldb/source/Core DumpRegisterValue.cpp

[lldb] Refactor RegisterTypeBuilder

This prepares it for emitting union types. Major changes:
* Entry function is now a dispatcher to builder functions for each type.
* Name mangling is standardised.
* The register name parameter is no longer needed and so was removed.
DeltaFile
+107-86lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
+12-3lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.h
+2-4lldb/source/Target/Target.cpp
+2-3lldb/include/lldb/Target/Target.h
+2-3lldb/include/lldb/Target/RegisterTypeBuilder.h
+2-2lldb/source/Core/DumpRegisterValue.cpp
+127-1016 files

LLVM/project a9b8e51lldb/source/Plugins/Process/FreeBSD NativeRegisterContextFreeBSD_arm64.cpp, lldb/source/Plugins/Process/Linux NativeRegisterContextLinux_arm64.cpp

[lldb] Make RegisterFlagsDetector into RegisterTypesDetector

In future it may be generating things other than flags. Functionality
is the same, but the interface changes to use RegisterType.
DeltaFile
+348-0lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.cpp
+0-334lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.cpp
+0-101lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.h
+99-0lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.h
+9-9lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+7-7lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp
+463-4513 files not shown
+472-4609 files

LLVM/project 90a3d00lldb/include/lldb/Utility RegisterType.h RegisterTypeFlags.h, lldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.h ProcessGDBRemote.cpp

[lldb] Store all XML register types in a single string map

We are assuming that their ID's are unique, so there's no need to keep
separate maps. We can do basic type checking by checking the kind of
the type pointed to.

A few more methods were added to the base RegisterType. GetSize()
returns 0 for enums because enums don't have a size until they are
used by a register. This is not ideal but it works for now.
DeltaFile
+64-70lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+7-8lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+11-3lldb/include/lldb/Utility/RegisterTypeFlags.h
+6-0lldb/include/lldb/Utility/RegisterType.h
+2-2lldb/source/Utility/RegisterTypeFlags.cpp
+90-835 files

LLVM/project 2e7e848lldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.cpp, lldb/test/API/functionalities/gdb_remote_client TestXMLRegisterFlags.py

use first instance of duplicated ID
DeltaFile
+19-8lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+3-4lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py
+22-122 files

LLVM/project 3b11487lldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.cpp, lldb/test/API/functionalities/gdb_remote_client TestXMLRegisterFlags.py

Add test for ID overlap
DeltaFile
+44-0lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py
+2-2lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+46-22 files

LLVM/project 74dd669lldb/include/lldb/Core DumpRegisterInfo.h, lldb/source/Core DumpRegisterInfo.cpp DumpRegisterValue.cpp

[lldb] Convert uses of RegisterTypeFlags into RegisterType

So we are using the generic interface that will work with
all future RegisterType derived classes.

Right now we'll only be asked to print RegisterTypeFlags, so
there's a few dyn_cast to that. Later we will switch on the
kind, and support rendering more types.
DeltaFile
+16-12lldb/source/Core/DumpRegisterValue.cpp
+9-3lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
+6-2lldb/unittests/Core/DumpRegisterInfoTest.cpp
+3-2lldb/source/Target/Target.cpp
+3-2lldb/source/Core/DumpRegisterInfo.cpp
+2-2lldb/include/lldb/Core/DumpRegisterInfo.h
+39-237 files not shown
+46-2913 files

LLVM/project 479d44flldb/source/Core DumpRegisterInfo.cpp, lldb/source/Plugins/Process/elf-core RegisterContextPOSIXCore_riscv32.cpp

casts not needed here
DeltaFile
+1-3lldb/source/Core/DumpRegisterInfo.cpp
+1-2lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp
+2-52 files

LLVM/project 1e7a98dlibcxx/include/__memory unique_ptr.h, libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn move_convert.pass.cpp move.pass.cpp

[libc++] Implement LWG2899: Constrain move special functions of `tuple` and `unique_ptr` (#167211)

libc++'s `tuple`'s move constructor is well-constrained when initially
implemented. So this patch only adds test cases.

For `unique_ptr`, its move constructor and move assignment operator were
previously unconstrained and thus this patch changes them. There doesn't
seem "obviously correct" approach for constraining in pre-C++20 modes,
and this patch attempts to use `__nat` trick to avoid turning the
functions into templates which are not move special functions.

Some tests case are adjusted because false positive of
move-assignability of `unique_ptr` is reduced. Comments are updated to
reflect that move-constructibility is not actually required for
`unique_ptr`'s deleter.

This patch also explicitly deletes copy functions of `unique_ptr` in all
modes. Previously, they are implicitly deleted since C++11 mode,
although the standard wording always explicitly deletes them. Clang

    [9 lines not shown]
DeltaFile
+20-8libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move.pass.cpp
+25-0libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
+9-8libcxx/include/__memory/unique_ptr.h
+9-2libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
+3-3libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.pass.cpp
+1-1libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.verify.cpp
+67-224 files not shown
+71-2610 files

LLVM/project ee7a4e9llvm/test/CodeGen/AMDGPU occupancy-levels.ll

[AMDGPU][NFC] Add gfx12 +cumode coverage to occupancy-levels.ll (#214210)
DeltaFile
+71-2llvm/test/CodeGen/AMDGPU/occupancy-levels.ll
+71-21 files

LLVM/project 3bdbc63llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/unittests/CodeGen SelectionDAGNodeConstructionTest.cpp

fix partial reduce sumla expression (#209294)

Fixes #209193.

`TargetLowering::expandPartialReduceMLA` handled UMLA, SMLA, and FMLA,
but fell through to `llvm_unreachable` when expanding
`PARTIAL_REDUCE_SUMLA`.

This handles SUMLA by sign-extending the signed LHS and zero-extending
the unsigned RHS before multiplication.

The first commit precommits a SelectionDAG unit test that reproduces the
assertion and verifies that expansion creates the expected extensions.
DeltaFile
+25-0llvm/unittests/CodeGen/SelectionDAGNodeConstructionTest.cpp
+4-0llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+29-02 files

LLVM/project 61fd29eclang/include/clang/Analysis/Analyses/LifetimeSafety Facts.h, clang/lib/Analysis/LifetimeSafety Facts.cpp LoanPropagation.cpp

[clang][LifetimeSafety] Split live origins into persistent and block-local (#213543)

LoanPropagation already keeps origins that cross block boundaries apart
from those confined to one block, so that only the former take part in
joins. Do the same for LiveOrigins, and share the single prepass that
classifies them.

Block-local origins are not merely a minor share of the liveness state:
many expression origins are made live by a `UseFact` but never killed,
because several `OriginFlow` sites propagate only the outermost origin
of an expression's list (see the FIXMEs in `handleFunctionCall`), and a
`StringLiteral` glvalue origin is only ever a flow's source. Those
origins survived to the top of their block and then propagated backward
across the whole function. In `EmitARMMVEBuiltinExpr`, of 68644 origins
only 490 are persistent, and the liveness map at a block boundary peaked
at 11725 entries; it now peaks at 326.

`computePersistentOrigins` moves to `FactManager`, which computes it on
first use and hands the same bit vector to both analyses. Sharing it is

    [27 lines not shown]
DeltaFile
+93-52clang/lib/Analysis/LifetimeSafety/LiveOrigins.cpp
+41-39clang/lib/Analysis/LifetimeSafety/Checker.cpp
+4-64clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+57-0clang/lib/Analysis/LifetimeSafety/Facts.cpp
+25-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
+12-7clang/unittests/Analysis/LifetimeSafetyTest.cpp
+232-1623 files not shown
+256-1709 files

LLVM/project fc7ec52mlir/lib/Dialect/Linalg/Transforms TilingInterfaceImpl.cpp, mlir/test/Dialect/Linalg transform-op-fuse.mlir tile-semi-affine-maps.mlir

[mlir][linalg] Constrain tiling semi-affine maps (#212240)

Expands checks in Linalg's tiling implementation in presence of
semi-affine indexing maps to reject unsafe tiling configurations.

Current tiling can produce incorrect results when tiling occurs on a
dimension accessed via semi-affine map. This is due to lack of tile
offset tracking as shift in tiled slices cannot be represented today
using symbol-free indexing maps.

Assisted-by: Claude
DeltaFile
+541-0mlir/test/Dialect/Linalg/tile-semi-affine-maps.mlir
+121-0mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
+58-1mlir/test/Dialect/Linalg/transform-op-fuse.mlir
+720-13 files

LLVM/project efa2303llvm/lib/Target/AMDGPU AMDGPULibCalls.cpp

[review] Sink second argument closer to where it is used
DeltaFile
+1-3llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
+1-31 files

LLVM/project 4e41485llvm/lib/Target/AMDGPU AMDGPULibCalls.cpp

[review] Move asserts and simplify return
DeltaFile
+10-6llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
+10-61 files

LLVM/project 7448e3emlir/lib/Dialect/Tosa/Transforms TosaFolders.cpp, mlir/test/Dialect/Tosa tosa-layerwise-constant-fold.mlir

[mlir][tosa] Support more float types in resource transpose folding (#213226)

Add support for f4, f8, f16, bf16, and f64 constants backed by
DenseResourceElementsAttr.
DeltaFile
+120-0mlir/test/Dialect/Tosa/tosa-layerwise-constant-fold.mlir
+40-4mlir/lib/Dialect/Tosa/Transforms/TosaFolders.cpp
+160-42 files

LLVM/project 91dfa26clang/include/clang/StaticAnalyzer/Checkers BoundsChecking.h, clang/lib/StaticAnalyzer/Checkers CMakeLists.txt BoundsChecking.cpp

[NFC][analyzer] Introduce the BoundsChecking library (#213957)

Building on my recent commit 25d51a8156da0845928e2fc09bb2736507fc5adf
this commit moves the general-purpose bounds checking logic from
ArrayBoundChecker.cpp to the new files BoundsChecking.{cpp,h}.

This new library currently only serves the needs of
`security.ArrayBound`, but it will be gradually expanded, generalized
and used to bring other bounds checking checkers out of alpha stage.

The code is moved without modifications, except for the removal of a
TODO note that asks for moving the code into a separate library.
DeltaFile
+1-294clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
+229-0clang/lib/StaticAnalyzer/Checkers/BoundsChecking.cpp
+105-0clang/include/clang/StaticAnalyzer/Checkers/BoundsChecking.h
+1-0llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Checkers/BUILD.gn
+1-0clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
+337-2945 files

LLVM/project 269979bclang/lib/Sema SemaDecl.cpp, clang/test/Sema loadtime-comment-vars.c

nit: Minor updates to the comments
DeltaFile
+2-3clang/lib/Sema/SemaDecl.cpp
+1-2clang/test/Sema/loadtime-comment-vars.c
+3-52 files

LLVM/project 3bee38fclang/docs LanguageExtensions.md, clang/lib/Sema SemaDecl.cpp

[Clang][AIX] Preserve -mloadtime-comment-vars variables across serialization

Named internal-linkage variables were silently dropped when their
definition crossed a PCH or C++20 named-module (BMI-to-object) boundary:
DeclMustBeEmitted did not know the implicit attribute, so the PCH writer
never marked the unreferenced variable as required, and for named modules
only non-discardable variables are recorded in the module-initializer
lists that EmitModuleInitializers walks. Teach DeclMustBeEmitted about
the attribute (the CodeGen-side check becomes redundant and is removed)
and record validated internal-linkage module-purview variables in the
module-initializer list.

Since DeclMustBeEmitted now sees the attribute, a preserved variable no
longer triggers -Wunused-const-variable: it is materially used.

Add tests for C++20 module preservation, importer behavior, and
instantiation diagnostics; PCH preservation; unused-warning suppression;
the non-AIX cc1 no-op; and char8_t element-type exclusion. Document the
modules/PCH rules.
DeltaFile
+101-0clang/test/CodeGen/PowerPC/loadtime-comment-vars-modules.cpp
+28-0clang/test/PCH/loadtime-comment-vars.c
+21-2clang/test/Sema/loadtime-comment-vars.c
+8-5clang/docs/LanguageExtensions.md
+10-0clang/lib/Sema/SemaDecl.cpp
+5-1clang/test/CodeGen/PowerPC/loadtime-comment-vars.cpp
+173-82 files not shown
+180-108 files

LLVM/project 4395e6allvm/lib/Target/AMDGPU DSInstructions.td, llvm/test/CodeGen/AMDGPU ds-atomic-barrier-convergent.ll

[AMDGPU] Add `isConvergent=1` to `DS_ATOMIC_*_BARRIER` instructions (#214166)

The intrinsic already has it. The instructions may issue a wake-up
signal on barrier completion so the set of waves that execute the
instruction
may not change.

The test case shows taildup duplicating the MachineInstrs when
`isConvergent=0`.

Assisted-By: Claude Opus 4.8
Claude found the reproducer for me after I found the lack of
`isConvergent=1` on those
instructions.
DeltaFile
+12-26llvm/test/CodeGen/AMDGPU/ds-atomic-barrier-convergent.ll
+16-12llvm/lib/Target/AMDGPU/DSInstructions.td
+28-382 files

LLVM/project 17fe2ecutils/bazel/llvm-project-overlay/libc BUILD.bazel, utils/bazel/llvm-project-overlay/libc/test/src/stdlib BUILD.bazel

[bazel][libc] Add targets for realpath
DeltaFile
+142-12utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+28-0utils/bazel/llvm-project-overlay/libc/test/src/stdlib/BUILD.bazel
+170-122 files

LLVM/project 0b8087clibc/config/linux/aarch64 entrypoints.txt, libc/config/linux/riscv entrypoints.txt

[libc] Add realpath to linux entrypoints
DeltaFile
+1-4libc/config/linux/x86_64/entrypoints.txt
+1-4libc/config/linux/riscv/entrypoints.txt
+1-0libc/config/linux/aarch64/entrypoints.txt
+3-83 files

LLVM/project 4db3dc2lldb/docs/resources build.md, lldb/packages/Python/lldbsuite/test/builders builder.py

[lldb][test] Improve error for C++ compiler detection and improve docs (#214199)

I did not realise that LLDB_TEST_COMPILER should be the C compiler, so I
got:
    cxx = cc_dir / (cc_prefix + cxx_type + cc_ext)
TypeError: can only concatenate str (not "NoneType") to str
Config=aarch64-/usr/bin/g++

I have simplified the logic and added a more informative error: 
RuntimeError: Could not infer C++ compiler name from compiler type "g++"

Added a note to the documentation.

The CMake description does say "C compiler", but it's easy to gloss over
that so I extended that to say how we get the C++ compiler.
DeltaFile
+11-3lldb/packages/Python/lldbsuite/test/builders/builder.py
+6-0lldb/docs/resources/build.md
+1-1lldb/test/API/CMakeLists.txt
+18-43 files