[MIPS][NFC] test mips variadic aggregate handling (#216509)
mips64 has some bugs here that I'll address in a followup. The problem
is that we get `inreg {float}` items in the variable argument list. That
breaks for aggregates like `_Complex long double` or just `struct { long
double a; b }`.
[libc][bazel] Update bazel overlay for ceilf128 emulated float128 changes (#216515)
This updates the Bazel overlay following commit
e5174fe683e882f6bbd2ef023c9c9e293b273a98:
- Remove `:llvm_libc_types_float128` from `__support_math_ceilf128` deps
as `include/llvm-libc-types/float128.h` is no longer included.
- Add `:__support_cpp_bit` to `ceilf128` additional_deps for `bit_cast`.
- Add `ceilf128` math MPFR test target in
`libc/test/src/math/BUILD.bazel`.
[analyzer] Correctly highlight the variables' range in UseAfterLifetimeEnd reports (#215905)
Currently in the emitted reports from the `UseAfterLifetimeEnd` checker
the highlight range of the variables is incorrect which can lead to
confusion for the user.
```
temp.cpp:5:31: note: Value's lifetime bound to the lifetime of 'y' here
4 | int x = 1, y = 2;
| ~~~~~~~~~~~~~~~~
```
In this emitted note the highlight of the variable `y` incorrectly spans
to the variable `x` as well and vice versa. This does not meet the
quality requirements of a core Clang Static Analyzer Checker.
In this PR I get the `VarDecl` of the `VarRegion` and then return the
`SourceRange` based on the `VarDecl`'s location through `getLocation`.
This leads to the following emitted notes:
[5 lines not shown]
AArch64: Use MIPatternMatch in PostLegalizerCombiner ext checks
Replace the getVRegDef + opcode-check idiom with mi_match. Add an
m_GSExtInReg matcher for G_SEXT_INREG, which has an extra immediate
operand and so does not fit the plain unary-op matcher shape.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
GlobalISel: Use MIPatternMatch to look up defs in CombinerHelper (#216507)
Replace direct getVRegDef uses that were followed by an opcode check
with the mi_match idiom, mirroring the artifact combiner cleanup in
2e172cd38272124da30cc913f1a372ba9ea59dcf. This handles a subset of
simple cases, others call for some nicer mi_match support.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
GlobalISel: Use MIPatternMatch to look up defs in CombinerHelper
Replace direct getVRegDef uses that were followed by an opcode check with
the mi_match idiom, mirroring the artifact combiner cleanup in
2e172cd38272124da30cc913f1a372ba9ea59dcf. This handles a subset of simple
cases, others call for some nicer mi_match support.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
RuntimeLibcalls: Fix AArch64 wrongly typed long-double libcalls (#215993)
Respect the triple's LongDoubleFormat.
AArch64SystemLibrary added the fp128-typed frexpl/ldexpl and exp10l
without a long-double-format guard, so triples where long double is IEEE double
(Darwin, Windows, Android) were emitting l suffixed calls with the wrong
type.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[ADT] Add const and reverse iterators to SortedVectorMap (#216439)
This patch adds cbegin, cend, rbegin, rend, crbegin, and crend to
SortedVectorMap along with reverse_iterator and const_reverse_iterator
type aliases.
The motivation here is to support const and reverse iteration in
SortedVectorMap, which is needed by tools like llvm-profdata for the
ongoing sample profile migration to SortedVectorMap.
Assisted-by: Antigravity
[bazel] Fix bazelisk failures after ORC RTBridge removal and libc float128 (#216505)
…at128
Commit f406aaec5f6dcb8dbe5d7267afdfdf80cea29d32 removed the ORC/RTBridge
directory and relocated its headers directly under
include/llvm/ExecutionEngine/Orc/. This updates OrcJIT and OrcShared in
llvm/BUILD.bazel to remove the obsolete RTBridge header glob patterns.
Additionally, this adds the missing :__support_fputil_float128 target in
libc/BUILD.bazel and includes it in the dependencies of
:__support_math_ceilf128 and :shared_math_headers_for_apfloat.
TAG=agy
CONV=cdc6d2a4-4a43-464a-ae1b-a56f935ee140
[CIR] Mark bit-field access units as their own member kinds
A bit-field access unit is as wide as the compiler decides, which can be
narrower than the declared type of the bit-fields in it, and the member marks
say nothing about that: a unit with a named occupant is `data` and one with only
unnamed occupants is `empty`, the same marks a declared field gets. So a member
holding a 32-bit bit-field of `long long` looks exactly like an `unsigned`
field, and the two are not the same to the ABI. `BitsContainNoUserData`
recurses on the declared type, finds user data past bit 32 in the first and none
in the second, and classic CodeGen coerces the enclosing records to `i64` and
`i32`.
Split the unit cases out as `bitfield` and `empty_bitfield`. A unit holds data
exactly when a named bit-field lands in it, so `isEmptyForABI` answers the same
for every record once it asks `holdsDataForABI` instead of testing for `data`
alone, and padding is untouched. Nothing classifies on the new marks yet, so no
ABI treatment changes. What needs them is pad-aware eightbyte classification,
which cannot tell a record's declared extents from its access units without
them.
[2 lines not shown]
[APFloat][SelectionDAG] Support Float8E5M3FNU in convert.{to,from}.arbitrary.fp
Float8E5M3FNU was already accepted by the IR verifier, because
isValidArbitraryFPFormat is defined in terms of
getArbitraryFPFormatSizeInBits and that table covers it. It was missing
from getArbitraryFPSemantics, so SelectionDAGBuilder rejected
it with "not implemented format" and the verifier-clean IR failed to
compile. Add the mapping and the corresponding entries in the
expandCONVERT_{TO,FROM}_ARBITRARY_FP format allowlists.
Unlike every other format the expansions handle so far, Float8E5M3FNU is
unsigned: it has no sign bit, so all 8 bits go to a 5-bit exponent and a
3-bit significand.
Since an unsigned format cannot represent a negative value, a negative
input now saturates to zero when the saturate flag is set, and is poison
otherwise. -0.0 is excluded from that and still converts to +0, and the
check is ordered before the NaN case so a negative NaN still produces the
NaN encoding. APFloat treats constructing a negative value in an unsigned
[3 lines not shown]
[APFloat][NFC] Add unit test coverage for getArbitraryFPSemantics
isValidArbitraryFPFormat and getArbitraryFPFormatSizeInBits have unit
tests, but getArbitraryFPSemantics, the mapping the conversion
intrinsics actually lower through, had none. Cover the formats it
supports, the valid formats it does not support yet, and invalid format
strings, and check that the two tables agree on the size of every
format with lowerable semantics.
Also add the missing Float8E5M3FNU case to the
getArbitraryFPFormatSizeInBits test.
Change-Id: I8fa9580ca6f03fd5e7b1de5354b71283cebb0f95
[lldb][test] Skip the frame 0 stack expedite test with an out-of-tree debugserver (#216496)
test_threads_info_expedites_stopped_frame_stack asserts that
jThreadsInfo
carries frame 0's stack memory for the stopped thread. debugserver only
does
that since b631e0cbd1c9, so a system debugserver sends the backchain
alone and
the test fails with "no frame 0 stack memory for stopped thread".
[IR][Intrinsics] Fix llvm.powi to require a scalar integer exponent (#216160)
Fix llvm.powi intrinsic to enforce a scalar integer exponent,
aligning the implementation with the LangRef specification.
Merge main into the derive-record-padding branch
Main has moved 931 commits and both parents of this branch landed with it, the
mark list in #215174 and the CIRGen marks in #215175, so this branch keeps only
the change that drops the stored `padded` bit and derives it from the `pad`
marks instead.
Assisted-by: Cursor / claude-opus-5