[mlir] Reduce template work in operation registration (NFC) (#233051)
Save use 3.18% less user CPU when building LLVM/NVVM/ROCDL, and 0.96%
total user CPU when building mlir-opt. Linked mlir-opt code is 0.60%
smaller.
The main thing is to share no-op helper specializations among traits
that do not define fold, verification, region-verification, or interface
hooks. We also preserve pack order and short-circuiting while removing
the extra interface-pack forwarding instantiation.
Assisted-by: Codex
[libc++abi] Retain the old CMP0155 behavior for GCC compatibility (#232803)
Raising the minimum CMake version to 3.31 enables automatic module
dependency scanning for the C++23 libc++abi object libraries. GCC 16 and
17 then probe the libstdc++ bits/stdc++.h header when processing libc++
headers and fail if it is absent.
Set CMP0155 to OLD within libc++abi until GCC's optional header lookup
is fixed. Keep the policy change scoped to libc++abi and guard it for
CMake versions predating the policy.
GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127940
Assisted-by: Codex
[CIR][OpenCL] avoid sys/types.h macro issue in OpenCL Attr (#234237)
CIROpsAttributes.cpp.inc would use initializers for this that looked
like function type macros, which were defined for a while in
sys/sysmacros.h. This caused us problems.
This fixes it by renaming these to majorVersion and minorVersion.
I am going to instantly merge this as it'll unblock buildbots for
build-by-default clangir, but if someone would like to rename these
something different, please do. In the meantime this seemed like a
reasonable name.
[SLP]Fix operand to scalar lane mapping for reordered insert/store nodes
Insertelement/insertvalue and store nodes reorder only operands, so the
scalar for operand lane L is the I with ReorderIndices[I] == L. The
copyable data mapping used ReorderIndices[L] and skipped insertelement
nodes, which assigned the copyable elements to wrong users after the
dependencies are recalculated in the final scheduling.
Fixes https://github.com/llvm/llvm-project/pull/226268#issuecomment-6314083254
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/234235
[clang][analyzer] Fix for `security.ArrayBound` assertion failure on incomplete types (#231925)
When the check clang-analyzer-security.ArrayBound is enabled, for a
forward declaration, or any incomplete types, it tries to calculate the
offset, which is unknown, therefore can not be calculated, causing the
assertion ElemType cannot be incomplete.
---------
Co-authored-by: Jones, Matthew (DI SW SIM FRWK PLAT SIMFW HPC) <jones.matthew at siemens.com>
Reland: [lldb][Fortran] Added support for base types to DWARFASTParserFortran (#234214)
Relands #223406.
(Reason for the breakage was a UB in DWARFASTParserFortranTests
regarding the initialization of the TypeSystemFortran instance with
`std::call_once`).
This PR adds support for base types to DWARFASTParserFortran, introduces
a method to retrieve the parser from TypeSystemFortran, and adds unit
tests for type parsing.
Changes:
- Added DW_TAG_base_type handling to ParseType.
- Added scope resolution for parsed types.
- Added a method to return the parser from TypeSystemFortran.
[2 lines not shown]
[clang-format] Stop treating the new expression as a lambda (#223266)
before
```C++
x = new a *[] { nullptr };
x = new a *[] {
nullptr, //
nullptr,
};
```
after
```C++
x = new a *[]{nullptr};
x = new a *[]{
nullptr, //
nullptr,
[6 lines not shown]
[MachineOutliner] Attribute outlined calls to their merged call location (#233505)
Every call in a candidate is symbolized at the outlined call, so with
multiple calls, the last call's location can attribute the others to an
inlined callee that was not running. Use the merged location of the
calls instead, as tail merging does. With a single call, the behavior is
unchanged.
Follow-up to llvm/llvm-project#229260.
build.sh: hide NextBSD live-ISO vfs.pivot output unless verbose boot
The pivot's sysctl prints a "vfs.pivot: ... -> ..." line on every
boot, which is the last [init]-phase progress output left on a quiet
NextBSD live-ISO boot. Send its stdout to /dev/null unless VERBOSE is
set. Its stderr still goes to the console, so a failed pivot is still
visible.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[Attributor] Use sorted offsets for constant vector stores (#231079)
`RangeList` requires strictly increasing offsets. `handleAccess` already
computes `OffsetsSorted`, but the constant-vector store path still
builds its element offsets from the original unsorted set. Use
`OffsetsSorted` here as well so the element offsets satisfy the same
ordering requirement.
When a pointer has multiple possible offsets, iterating over the
original set can produce them out of order, triggering "Expected
strictly ascending offsets". The regression test reproduces this by
storing a constant vector through a pointer selected between two offsets
in the same allocation.
The test asserts before the fix and passes afterward with both
`attributor` and `attributor-cgscc`. All 207 Attributor tests also pass
on Windows with assertions enabled.
[IRBuilder] Deprecate ctors taking LLVMContext instead of Module (#234212)
https://github.com/llvm/llvm-project/pull/229430 introduced new
constructors that take a `Module &` instead of `LLVMContext &` and
replaced most usages. This PR deprecates the old constructors, in
preparation for making the Module required.
The only remaining use of the LLVMContext constructors is the C API.
[MLIR][LLVMIR] Add 'distinct' ID to the loop-annotate attribute (#233890)
The 'distinctness' of a loop annotation is important and meaningful, and
is used to identify br/br.cond operations that belong to the same
'loop'. The Clang FE tracks this with its classic codegen.
However, mlir is merging identical attributes (which is otherwise a
necessity, since we have no other way of identifying 'same' attributes),
which is causing the final LLVM-IR to be incorrect.
This patch adds a distinct attribute as an 'id' so that an
implementation can identify br/br.cond objects that use the same loop
metadata, and thus will get the 'proper' distinct attributes.
[NFC][analyzer] Remove unused ignored useless parameter (#234167)
The method `CheckerContext::addSink` had a parameter `Tag` which was
never specified by the callers (always defaulted to `nullptr`) and was
ignored by the body of the method.
By the way, I don't see a good use case for attaching a custom tag to a
sink node (they are fine with using the checker as the default tag), so
it is not surprising that this wasn't used.
Note that the other two sink-making methods of `CheckerContext` can
still accept custom tags (which is not utilized).
[SCEV] Prove signed/unsigned implications in either operand order
SCEV could prove these implications only with the operands in the same
order:
- If a <u b and a, b have the same sign, then a <s b.
- If a <s b and a, b have the same sign, then a <u b.
- If a <u b and b >=s 0, then a <s b.
- If a <s b and b <s 0, then a <u b.
For example, it proved a <s b from a <u b and b >=s 0, but not b >s a.
Now it proves them in either order.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
security/vuxml: Fix PHP entry d8e16d08-cd2f-11f1-8135-8447094a420f
- php85: the fixed version is 8.5.12, not 8.5.13
- Quote the security advisory instead of the pre-announcement
- Add references to the advisory and both GHSAs
Reported by: Dan Langille <dan at langille.org>
Sponsored by: Netzkommune GmbH
misc/py-claude-agent-sdk: Drop version from claude-code dependency
The tree already has a newer misc/claude-code, so the minimum version
is pointless.
Sponsored by: Netzkommune GmbH
[CIR] Reject language address spaces in DirectToLLVM pointer conversion
Reject unlowered language address spaces in pointer types when bypassing TargetLowering. Guard pointer-producing lowerings, including generated patterns, so failed conversions report legalization failures instead of silently selecting address space zero or constructing invalid LLVM operations.
Assisted-by: Codex / GPT-6
fix: [CIR] Check only the converted pointer's address space
Limit opaque pointer conversion to its own address space and diagnose unsupported pointee types where their layout is required. Emit type-specific errors for failed pointer conversions.
Validate pointee memory conversion before deriving copy sizes, alignments, or pointer-difference strides from CIR layout. Keep deeper pointee types opaque when their layouts are not needed.
Assisted-by: Codex / GPT-6
[CIR] Propagate initializer type adjustment failures
Reject initializers whose active members have no LLVM representation, including when an enclosing union's storage type is convertible. Propagate recursive adjustment failures before querying data layout or constructing LLVM operations.
Assisted-by: Codex / GPT-6
[NVPTX] Correct tcgen05 MMA memory effects (#232314)
Model accumulator reads and shared-memory reads through descriptors,
while restricting writes to argument memory and internal state. Mark
tensor A readonly unless `.ashift` is present, and mark sparse metadata,
scale inputs, and decompression tables readonly.
Assisted-by: GPT-6 Astra