[LoongArch] Legalize BUILD_VECTOR into a broadcast when all non-undef elements are identical
When a BUILD_VECTOR consists of the same element (ignoring undefs),
it is better emitting a broadcast instead of multiple insertions.
Some floating-point cases suffer performance regressions, those
specific cases are excluded in this commit. Including when:
- only one element is non-undef,
- only two elements are non-undef, and one of them must at index 0,
- for v8f32 vector type, specially exclude the cases when the only
two non-undefs are at index (1,2)/(1,3)/(2,3).
[-Wunsafe-buffer-usage][NFC] Move the cast check for data() call into `DataInvocationGadget` (#234814)
`DataInvocationGadget` matches explicit casts of the pointer returned by
`data()`, but whether such a cast is actually unsafe (e.g. a cast to a
pointer to a larger type) was decided by `UnsafeBufferUsageReporter` in
`AnalysisBasedWarnings.cpp`, which silently dropped the safe casts.
Deciding what is unsafe is the job of the analysis, not the reporter: a
matched WarningGadget is supposed to warrant a warning. Move the check
into `DataInvocationGadget`, so the reporter only needs to look up the
invoked method to name it in the warning.
This is a code cleanup; no functional change is intended.
---
*Disclosure: AI assistance was used in the development and
implementation of this change.*
Revert "[SPIR-V] Legalize folded byte-offset GEPs for workgroup memory" (#243292)
Reverts #227104.
This reverts commit 4fbd32ce4c4c7527a814c313a092b8296ad53dc0. It
restores the previous SPIR-V pointer lowering and removes the tests
added by that PR.
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
Copilot-Session: fbc02c65-a079-4b71-95ce-5a259640d701
[Attributor] Don't derive interface attributes from non-exact definitions
The arguments and the return value of a function that might be replaced
by another definition, e.g. a linkonce_odr function, are not updated, but
AAs still took known information from the body in initialize, which was
then kept and propagated to the callers: the uses of the arguments in
followUsesInMBEC, assumptions in getAttrsFromAssumes, and the returned
values in AANonNull::isImpliedByIR. Add Attributor::canUseBodyFor and
skip the body for the interface of such functions.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[mlir][Bufferization] Propagate function result writability (#241196)
This fixes https://github.com/llvm/llvm-project/issues/240194. Func.call
results were assumed writable even when the callee returned read-only
storage, allowing writes to constant globals after bufferization. Track
tensor result writability across all return sites and aliases, and
consult this information in the func.call interface. Conservatively
treat unknown results as potentially read-only so existing conflict
resolution inserts copies before writes.
Assisted-by: OpenAI Codex
[RISCV][GISel] Enable extended LLT
Pass -gisel-extended-llt to the GlobalISel TableGen backend and call
LLT::setUseExtended(true) in RISCVTargetMachine.
Update the GlobalISel tests: convert hand-written instruction-select
and knownbits MIR inputs from sN to iN/fN, and regenerate CHECK lines.
Some soft-float assembly output changes slightly (constants are
rematerialized instead of kept live across libcalls).
Co-Authored-By: Claude Sonnet 5.5 <noreply at anthropic.com>
[RISCV][GISel] Prepare for extended LLT
Make the RISC-V GlobalISel code correct when LLTs carry integer/float
kinds, ahead of enabling extended LLT:
- Legalize scalar G_BITCAST: legal up to XLen bits, narrowed above that
(i128/f128, or f64/i64 on RV32). Map it in RegisterBankInfo by type
kind and subtarget (FPR only if the FP extension holds that size in an
FPR), and select it as a COPY.
- Use f16/f32/f64/f128 in the FP legalizer rule sets so that types
created by mutations (e.g. f16 -> f32 widening) match the imported
TableGen patterns. Lower bf16 G_FCONSTANT via an integer constant.
- Add iXLen for building new instructions, keeping the any-scalar sXLen
for legality rules. Build mask vectors with i1 elements and use
integer types for other newly created values.
- Call lowering: bitcast f16/f32 values to integer before any-extending
them into wider locations, and bitcast back after truncating.
- RegisterBankInfo: an f64 on a Zilsd target without D lives in a GPR
pair, not an FPR.
[2 lines not shown]
[libc++] Mark LWG4480 as complete and test (#242789)
Resolves #189845
`<stdatomic.h>` already provides `ATOMIC_CHAR8_T_LOCK_FREE` via
`<atomic>`. This PR adds it to the synopsis along with a corresponding
test.
---------
Co-authored-by: A. Jiang <de34 at live.cn>
Update math/minizinc to version 2.10.1, add math/gecode support.
Version 2.10.1
(released 31 August 2026)
Packaging changes:
* The naming scheme for GitHub release assets has changed to use the
build target triple.
* Windows ARM64 packages are now available.
* Separate ARM and Intel macOS packages are provided instead of a
single universal binary.
* Packages containing the MiniZinc command line tools and solvers are
now available without the IDE.
* Docker images are now released on the GitHub Container
Registry, including -dist variants which contain only the MiniZinc
installation and are designed to copied into other images.
[236 lines not shown]
[MemProf] Assign contexts trimmed within a call's inlined stack ids to its node (#240193)
When updating the stack nodes for callsites while building the graph, a
call with inlined frames is assigned the contexts that include all of
its stack ids that have context nodes. Profile matching trims a
context's stack once its allocation type is unambiguous, so a context
can be trimmed at an earlier stack id in that sequence. When a later
stack id has a node because of contexts for a different allocation,
such a context was only assigned to calls ending at the earlier id
that was last in the trimmed context (e.g. an out-of-line copy of
the inlined callee), and the call with the inlined frames kept calling
the original callee even though all of its profiled contexts were cold.
Give each such call duplicates of the trimmed contexts' ids, created up
front from the unmodified graph so the main stack node update loop can
also hand them to the other calls those contexts flow through, except
calls ending at a node of the creating call's own sequence, which would
compete with it for the duplicates. Measured a small (0.5%) peak RSS
increase on a large internal target due to the additional duplicates,
[12 lines not shown]
Revert "[RISCV][GlobalISel] Combine byte-spreading operations to orc.b" (#243271)
Reverts llvm/llvm-project#240276
Test is failing when built without assertions.
Fixes #243242.
[CodeGen][NFC] Factor MachineBlockPlacement::alignBlocks into reusable helper (#241995)
Post-layout passes such as BasicBlockSections reorder and clone blocks
after MachineBlockPlacement (changing fallthrough predecessors) and
operate on Propeller block/edge counts rather than MBFIWrapper. Extract
the block alignment logic from MachineBlockPlacement::alignBlocks() into
llvm::alignMachineBlocks() with a lightweight BlockAlignmentProfile
interface so BasicBlockSections can recompute block alignments from
Propeller profiles without re-implementing the core alignment logic.
Assisted by: Gemini-4 Carbon
bhyve: Reject unsupported checkpoints before saving RAM
pci_snapshot() rejects devices without a pe_snapshot callback, but
vm_checkpoint() reaches that check only after truncating checkpoint
files, pausing the VM, and saving RAM and kernel state.
Check for unsupported PCI devices at the start of vm_checkpoint(),
before creating files or pausing the VM. This preserves existing
checkpoint files when the request cannot succeed. Add
pci_can_snapshot() so that the new check and pci_snapshot() use the
same test.
Reviewed by: markj, kevans
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D61003
SimplifyLibCalls: preserve allocation attributes in optimizeNew
When `LibCallSimplifier::optimizeNew` rewrites an `operator new` call into a
`__hot_cold_t` allocation call, forward the allocation attributes
(`allockind`, `allocsize`, `"alloc-family"`, and parameter `allocalign`) from
the original call onto the synthesized call instruction alongside its metadata.
This is a new patch since 2023 (unlike most of the rest of the stack)
and allows the next patch to remove more specialized C++ knowledge
from the LLVM layer, instead leaving it in clang where it seems more
sensible.
This patch was authored with the assistance of an LLM and was reviewed
by me before posting.
CGExprCXX: emit family and allockind attributes
This allows us to remove the special knowledge about C++ allocation from
LLVM's MemoryBuiltins.cpp, instead trusting attributes to communicate
the important properties.
Annoyingly, clang has to grow a little bit of hard-coded knowledge about
mangled symbol names in order to actually get the most-basic-matching
::operator::new when working out the alloc-family attribute. I spent
some time trying to do this "right" by looking up the available
operators new and finding the best one, but that's super tricky and this
has the virtue of working and being pretty obviously correct when
compared to the old code.
Happily, clang now emits allocator family attributes for custom
allocators like the `__hot_cold_t` overloads in `new_hot_cold.cpp`
(which `isReplaceableGlobalAllocationFunction` in clang recognizes),
allowing us to remove that special knowledge from LLVM.
[7 lines not shown]