[Mips] Use the constrained compare mask directly on R6 (#246087)
On R6, a constrained FP compare is lowered to (and Mask, 1), where Mask
is the 0 or -1 result of cmp.cond.fmt. Selects, branches and sign
extensions can use Mask without the 'and' when ComputeNumSignBits shows
that it is 0 or -1, as they already do for non-strict compares. For
constrained compares this was not known, since STRICT_FPCmpR6 and
STRICT_FPCmpsR6 were not handled in ComputeNumSignBitsForTargetNode and
the low word of an f64 mask came from an EXTRACT_SUBREG. So they got an
extra 'andi', and the sign extensions a 'negu' as well.
Handle the strict compare nodes in ComputeNumSignBitsForTargetNode, and
take the low word of an f64 mask with ExtractElementF64, which it can
look through. The code is now the same as for non-strict compares.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
devel/truc: Deprecate and set expiration date
The project is abandoned upstream, no longer developed.
Set expiration date to 2027-02-28, 3 months from now.
PR: 300510
MFH: 2026Q4
Add new section to Building.md
Removed the now-ignored option from the bootstrap-build config example.
Created a new section dedicated to omptest and how to make it
installable.
[OpenMP][omptest] Do not install an ompTest that embeds LLVM's GoogleTest
The GTest-based ompTest embeds LLVM's vendored GoogleTest objects, but LLVM
installs no GoogleTest headers, and the installed OmptTesterGoogleTest.h
includes "gtest/gtest.h". Users of the installed package therefore compile
against whichever GoogleTest their system provides, which need not declare the
testing::internal API the library exports. That API carries no compatibility
promise -- MakeAndRegisterTestInfo() takes its test suite name as const char *
in the copy LLVM vendors and as std::string in later releases -- so the
mismatch surfaces as an undefined symbol when the user links, far from its
cause. The package config cannot express the requirement, because it is not a
version but the exact API generation vendored when the library was built.
Decline to install that configuration and say why. The standalone and
system-GoogleTest builds carry no vendored GoogleTest and remain installable.
Warn rather than error, for now. A build that asks for an installed ompTest
and gets a GoogleTest-based one is asking for something undeliverable, which
would justify a hard failure, but erroring immediately breaks every such build
[8 lines not shown]
[OpenMP][omptest] Add LIBOMPTEST_USE_SYSTEM_GTEST (#242312)
omptest can be built to use GoogleTest. For consumers that are only
inside the LLVM / runtimes build tree there is no problem right now
AFAIK
However, if an outside consumer wants to use omptest from an
installation, the problem is that LLVM vendors its own gTest headers and
those cannot be installed or are almost always unusable.
This change adds the possibility to not use he vendored ones but instead
search on the system for an installed gTest and rely on that instead.
This is a follow-up to the stack in
https://github.com/llvm/llvm-project/pull/237201
Assisted-by: Claude Opus 5 <noreply at anthropic.com>
IPv6: rc boot time improvements
If IPv6 is enabled we call rtsol on that interface so waiting in
rtsold is counterproductive; if one was to just use rtsold -F then
they are on their own for having the addresses usable during the
remaining startup time.
Rather than sleeping dad_count + 1 seconds we are now checking for
any tentative addresses on the interface and only then sleep
dad_count up-to 2 times. This should save us at least a dad_count
with the seconds with Optimistic DAD enabled (default) but there
are too many assumptions invovled anyway.
(RETRANS_TIMER in the kernel being 1000ms being one).
The reason why we need to sleep more than dad_count (1s default)
seems to be that first DAD for the link-local address clears and
only then solicited (or other global) addresses are handled.
Co-authored-by: Pouria Mousavizadeh Tehrani <pouria at FreeBSD.org>
[3 lines not shown]
[wasm] Swift async ABI p3: Lower llvm.swift.async.context.addr to local 0 (#236133)
(see https://github.com/swiftlang/swift/pull/93554)
This intrinsic describes the location of the async context.
[libFuzzer] Fix stale reduced seeds and a fork-mode crash
Seeds are loaded with MayDeleteFile=false. When libFuzzer reduces a
seed, Corpus::Replace keeps the original file and the reduced unit is
written to the output corpus. The flag stays false, so when the same
input is reduced again, the previous reduced unit is not deleted either,
and every intermediate reduction of a seed stays in the output corpus.
In a fork-mode job, the feature file of such a unit has been renamed to
the hash of the newer unit. The parent reads an empty feature set for
the unit and calls memcpy with null pointers. glibc declares them
nonnull, and with _FORTIFY_SOURCE the optimizer removes the zero-size
path of the vector. The parent then writes out of bounds and crashes.
Mark a replaced unit as deletable, since libFuzzer wrote the
replacement itself. Skip the copy when there are no features, and copy
only whole features, so that a missing or truncated feature file from
any other cause does not crash the parent either.
[4 lines not shown]
[Mips] Select constrained FP arithmetic on microMIPS (#246060)
STRICT_FADD, STRICT_FSUB, STRICT_FMUL, STRICT_FDIV and STRICT_FSQRT are
Legal for all hard-float subtargets, but only the standard encoding
patterns were changed to match them. On microMIPS any constrained
arithmetic operation failed instruction selection.
Use the any_* fragments in the microMIPS and microMIPS R6 patterns as
well.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Mips] Use libcalls for constrained f16 conversions (#246063)
STRICT_FP16_TO_FP and STRICT_FP_TO_FP16 are not covered by the default
Expand action for constrained operations, so they were Legal and any
constrained conversion to or from half failed instruction selection.
Mark them LibCall like their non-strict counterparts, extending to f64
through f32. Also drop the STRICT_ cases from the MSA custom lowering of
these nodes: they were unreachable, and would have used the chain as the
value operand.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[clang] Clean up the Clang export annotations (#239750)
This shuffles `clang/Support/Compiler.h` to more closely match
`llvm/Support/Compiler.h`. In particular, this adds a `clang-config.h`
header defining `CLANG_ENABLE_CLANG_EXPORT_ANNOTATIONS` to simplify the
`CLANG_ABI` and friends definitions.
This also narrows down the compile definitions to the MSVC/clang-cl
clang-cpp dylib build. Since this configuration is still a work in
progress tracked in #238871, this makes `CLANG_ABI` and friends expand
to nothing outside of an MSVC `CLANG_LINK_CLANG_DYLIB` build. As a side
effect, this removes many PCH-related warnings concerning these compile
definitions.
This also removes the `CLANG_BUILD_STATIC` override. Once the work is
done to annotate libclang-cpp, it should no longer be necessary. Right
now, the annotated build does not work so it is useless anyway.
LLM-aided with Claude Code.
[MemoryBuiltins] Infer allockind for strdup (#246479)
Infer `allockind("alloc")` for strdup/strndup, and treat __strdup the
same as strdup.
This allows us to remove the TLI dependency from more MemoryBuiltins
helpers. The remaining ones are related to allocation size (where strdup
is special).
[AArch64] Implement ACLE intrinsics for FPv2 SVE min/max instructions
ACLE PR: https://github.com/ARM-software/acle/pull/480
Implements the following intrinsics:
- svmaxmg / svminmg
- svmaxinm / svmininm
- svmaxmginm / svminmginm
Includes f16, f32, and f64 types, _m, _z, and _x predication and _n variants
AI assistance: Codex used for generating test cases
[mlir][reducer] Delete the temp files of failure-test.sh (#246243)
`mlir/test/mlir-reduce/script/failure-test.sh` says its temp files are
"automatically deleted after the script's execution", but nothing
deletes them. Every run leaves `/tmp/stdout.XXXXXX` and
`/tmp/stderr.XXXXXX` behind. The reducer calls this script once per
reduction so the leak adds up quickly.
This PR adds a `trap ... EXIT` right after `mktemp` calls so both files
are removed however the script exits (exit 0 or exit 1). The script's
logic is unchanged.
[mlir][vector] Prove all-false masks with value bounds (#243127)
This PR extends the all-true handling in `eliminate-vector-masks` to
masks that can be proven all-false.
This was found while compiling a
[FlagGems](https://github.com/flagos-ai/FlagGems) batched matmul for
SME. A 4x4 output tile was lowered to four column subtiles, with 12 of
16 FMOPA instructions in each peeled K block fully masked off. The mask
bounds included expressions such as `4 - 4*vscale`, which the pass did
not resolve, so more instructions were emitted than necessary.
For example, given `empty-mask.mlir`:
```mlir
func.func @empty_mask() -> vector<[4]xi1> {
%c4 = arith.constant 4 : index
%vscale = vector.vscale
%width = arith.muli %vscale, %c4 : index
%bound = arith.subi %c4, %width : index
[29 lines not shown]
[AArch64] Implement ACLE intrinsics for FPv2 SVE min/max instructions
ACLE PR: https://github.com/ARM-software/acle/pull/480
Implements the following intrinsics:
- svmaxmg / svminmg
- svmaxinm / svmininm
- svmaxmginm / svminmginm
Includes f16, f32, and f64 types, _m, _z, and _x predication and _n variants
AI assistance: Codex used for generating test cases
[clang] Add codegen regression test for friend function template (#231022)
The reproducer from #89400 crashed in IR generation because the friend
template definition was instantiated in the wrong template context,
leaving `foo<U>{}` dependent. #125266 fixed this but the case was not
covered by a test.
The test is in CodeGenCXX because clang 19 accepts the reproducer with
`-fsyntax-only` and only crashes when emitting IR.
Fixes #89400
interfaces: ifctl: remove eval and hash interface names for variable use
Simplify the export and print and use a md5 checksum. We could still
return garbage names to the caller, but that's only because they do
exist and FreeBSD virtually has no restrictions on the interface name
except when tools prohibit something due to implementation choices.
Reported by: squirt1e, outis, atum (MiniMax Cyber)
[CIR][AMDGPU] Add support for __builtin_amdgcn_log_clampf (#244000)
Adds CIRGen support for `__builtin_amdgcn_log_clampf`, also adds CIR and
LLVM IR test coverage in
`clang/test/CIR/CodeGenHIP/builtins-amdgcn.hip`.
Part of #241525
Signed-off-by: Harshit Jha <harshitiszz23 at gmail.com>
Co-authored-by: Ayokunle Amodu <ayokunle321 at gmail.com>
Add new section to Building.md
Removed the now-ignored option from the bootstrap-build config example.
Created a new section dedicated to omptest and how to make it
installable.
[OpenMP][omptest] Do not install an ompTest that embeds LLVM's GoogleTest
The GTest-based ompTest embeds LLVM's vendored GoogleTest objects, but LLVM
installs no GoogleTest headers, and the installed OmptTesterGoogleTest.h
includes "gtest/gtest.h". Users of the installed package therefore compile
against whichever GoogleTest their system provides, which need not declare the
testing::internal API the library exports. That API carries no compatibility
promise -- MakeAndRegisterTestInfo() takes its test suite name as const char *
in the copy LLVM vendors and as std::string in later releases -- so the
mismatch surfaces as an undefined symbol when the user links, far from its
cause. The package config cannot express the requirement, because it is not a
version but the exact API generation vendored when the library was built.
Decline to install that configuration and say why. The standalone and
system-GoogleTest builds carry no vendored GoogleTest and remain installable.
Warn rather than error, for now. A build that asks for an installed ompTest
and gets a GoogleTest-based one is asking for something undeliverable, which
would justify a hard failure, but erroring immediately breaks every such build
[8 lines not shown]