[SSAF][UnsafeBufferAnalysis] Address follow up questions after the approval of #209354
- The analysis should not create entries for empty contributors, which otherwise is non-empty in the serialized format.
- use std IO instead of a tmp file for regex-ing FileCheck queries.
rdar://179151541 & rdar://179151882
[DebugInfo][NFC] Refactor debug record salvage (#215971)
Split address and variable-location salvage into helpers so the ordering
and the kill fallback stay visible in salvageDebugInfoForDbgValues, with the
variable-location helper returning whether it processed the record.
Rename the locals and parameters the move touches to say what they hold, and use
isAddressOfVariable() for the two #dbg_declare tests, which is the same
comparison.
Replace the address helper's single-use template with DbgVariableRecord
and pass it the instruction the caller already checked, rather than
recovering it with a dyn_cast the caller's check already covers.
Add a unit test for the dbg.assign address path.
No regressions on check-llvm or check-lldb; ran about 80 auto-generated C tests with 225ish locations and no differences in DW_AT_location on aarch64 at O2.
Assisted by AI.
[CIR][SYCL] Device kernel caller (#213771)
During device compilation, emit a SYCL kernel caller offload entry point
in
place of each function declared with the sycl_kernel_entry_point
attribute,
mirroring classic CodeGen's `CodeGenModule::EmitSYCLKernelCaller`.
Depends on #213728
[SSAF][UnsafeBufferAnalysis] Filter out type-constrained pointers from reachable unsafe pointers (#209354)
Integrate the TypeConstrainedPointers analysis results into
UnsafeBufferReachableAnalysis. The final result is filtered to exclude
type-constrained pointers.
The pointer flow graph is untouched. Removing type-constrained pointers
from the graph would introduce unsoundness.
Final step for rdar://179151541 and rdar://179151882
[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` (#216501)
`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.
[AArch64][GlobalISel] Do not create atomic truncstore (#216522)
After #213935 the i64->i32 truncstore was failing to create a COPY
correctly.
We do not have tablegen patterns, so mirror what SDAG does and do not
create
atomic truncstore.
[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