[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.
[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.
[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.
[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.
[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.
[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.
[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]
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.
[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]
[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
[mlir][tosa] Support more float types in resource transpose folding (#213226)
Add support for f4, f8, f16, bf16, and f64 constants backed by
DenseResourceElementsAttr.
[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.
[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.
[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.
[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.
[libc] (Re)skip tests failing after #213860 (#214425)
(At least) two tests enabled by #213860 are failing on the amdgpu bot
(which only runs hermetic tests). This patch skips them, but it a
different way, so that they keep running in hermetic mode on supported
targets.
For the sched_test, I add a dependency on the sched_getscheduler target
(used in the test) to trigger the auto-skipping logic.
The memory utils test fails due to a missing cmp_is_expensive
specialization, so I enable the test only on targets which have them
(listing targets explicitly).