[Driver] Remove -mcmodel=small restriction for -fsanitize=function (#238028)
Since https://reviews.llvm.org/D148785, -fsanitize=function no longer
uses RTTI pointers or relocations in the function prefix, so it can now
be used with medium and large code models.
[Bazel][libc] Add kill syscall wrapper target (#238035)
Fixes Bazel build after c7d0351b066cf2770ce2110c616c4e60b847ca79
(#237798), which refactored the Linux `kill` syscall into
`src/__support/OSUtil/linux/syscall_wrappers/kill.h`.
[InstCombine] Canonicalise Vector Shuffle that clears upper bits
Currently, shuffle vectors that are equivalent to preserving lane 0 and clearing the uppers lanes of a vector result in different shuffle vectors and masks
Recognise and canonicalise the shuffleVectors to the same form allowing for easier recognition in the backend
[SPIR-V][NewPM] Force AsmPrinter begin/end passes (#238020)
Without Force, -start-after drops them and SPIRVAsmPrinterPass crashes
on a missing AsmPrinter
This matches other targets
[SelectionDAG] Provide context for vector count / type mismatch (#175433)
This now gives better details about what the mismatch is in the error
message:
subprocess.CalledProcessError: Command '/usr/local/bin/llc
-mtriple=amdgcn -mcpu=tahiti' returned non-zero exit status 134.
LLVM ERROR: Part count doesn't match vector breakdown! 6 registers, 6
parts, i32 RegisterVT, f32 PartVT
PLEASE submit a bug report to
https://github.com/llvm/llvm-project/issues/ and include the crash
backtrace and instructions to reproduce the bug.
[AArch64][llvm] Ensure svnot_u32_x() intrinsic is optimised to subr (#237251)
All-active SVE NOT intrinsics, such as `svnot_u32_x(svptrue_b32(), x)`
currently generate `ptrue` followed by predicated `not`. Optimise this
to subr `z0.b, z0.b, #255`, which subtracts each byte from 255 and
therefore flips every bit. This implements bitwise `not` for vectors
of 8, 16, 32, or 64-bit elements. Test all these four widths.
[AArch64][llvm] Add pre-commit tests for all-active SVE not intrinsics (#237250)
Cover all four integer widths with undefined and merging passthroughs,
plus a partially active predicate that must preserve inactive lanes.
[BPF] Mark global functions noipa (#237690)
The BPF verifier checks every argument of a call to a global function
against the BTF type of the function, whether the function uses the
argument or not. For a non-local function, DeadArgumentElimination
replaces an argument that the body does not use with poison at the
call sites, and since #235216 ("[BPF] Select undef and poison as zero")
the backend selects that poison as zero.
The Linux kernel BPF selftest progs/test_global_func8.c has
```
__noinline int foo(struct __sk_buff *skb)
{
return bpf_get_prandom_u32();
}
SEC("cgroup_skb/ingress")
__success
int global_func8(struct __sk_buff *skb)
[54 lines not shown]
[DebugInfo][Mem2Reg] Convert existing #dbg_value records with a deref in the single block case (#237347)
Each live #dbg_value record is cloned with its deref stripped at each
store, taking the value being stored. This creates a debug record at
each update point: each existing record for the variable is kept or
rewritten to use the stored value as its location, and each store to an
alloca that had an associated debug record also receives a debug record
for the update.
Fixes https://github.com/llvm/llvm-project/issues/229454
Assisted-by: Claude
Revert "Disable pre-link LTO vectorisation and loop unroll for at O2 and O3 optimisation levels (#195886)" (#238029)
There's test failure for the added NewPM Test which sometimes outputs
"FunctionAnalysisManager" and sometimes
"AnalysisManager<Function>" (they are aliases).
This reverts commit e3c929c8f1bca3e96dcb3c3b1886f25f8244bb5d.
[bazel] Update dependencies to account for rules_cc_autoconf updates (#236893)
We're able to drop the explicit `rules_cc_autoconf` pin as new `gmp` and
`mpfr` `*.bcr.*` versions pull in a new version and account for updates
in that module.
[bazel][lldb] Add unit tests for lldb's process and platform plugins (#237739)
Follow up to #236847. Adds the unit tests for lldb's process and
platform plugins: AdbClientTests, LLDBMinidumpTests, LLDBPlatformTests,
PlatformGdbRemoteTests, ProcessElfCoreTests, ProcessGdbRemoteTests,
ProcessLinuxTests, ProcessPOSIXTests, ProcessUtilityTests,
RegisterSupportTests and ScriptInterpreterNoneTests.
As before, names and dependencies follow CMake, plus the direct
dependencies layering_check requires, and //lldb:Interpreter and
//lldb:Breakpoint wherever a test needs what CMake gets through
lldbCore. LLDBMinidumpTests stages its Inputs/ like the other tests. As
in CMake, the elf-core, Linux and POSIX tests are Linux-only,
PlatformAppleSimulatorTest.cpp is macOS-only, and RegisterSupportTests
leaves out the FreeBSD and NetBSD register context tests that CMake only
adds on those systems.
ProcessLinuxTests includes the plugin's headers without the
Plugins/Process/Linux/ prefix, which CMake allows through
[6 lines not shown]
[mlir][X86] Prepare contract interleave (#236750)
Follow-up to #232800, which folds transpose + shape_cast unpacking of a
VNNI-packed RHS. Some frontends instead unpack by splitting the source
into VNNI lanes, transposing each lane, and joining the lanes back.
triton-cpu does this with deinterleave/interleave, and cutile-cpu with
transpose + extract and insert_strided_slice. Neither form was matched,
so the contraction never reached AMX lowering.
This matches both forms. For i8, factor 4 can be expressed as two binary
levels or a single 4-way step. We only fold when every lane comes from
the same source in VNNI order.
Also simplifying checks and hardening integration tests.
Assisted by AI.
[ValueTracking] Infer a zero low bit for `shl X, X` (#237567)
Teach `computeKnownBits` that `shl X, X` has its low bit clear: for a
defined shift, `X` is either zero or shifts by at least one bit. This
lets `InstSimplify` and `InstCombine` fold comparisons and sign
extensions of the low bit.
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[flang][OpenMP] Check task reduction modifier on compound constructs (#237932)
Check the constituent constructs when validating a task reduction
modifier. The compound directive name previously rejected legal parallel
do, parallel sections, and target parallel reductions before lowering
could assign the modifier to their accepting leaf.
Assisted-by: Codex
[RISCV][P-ext] Combine RISCVISD::PMULH_H_B0/PMULH_W_H0/MULH_H0 into a single ISD opcode. NFC (#237807)
This matches how MHACC_HALF opcodes are implemented.
I adjusted the type profile for MHACC_HALF for consistency.
Revert "Disable pre-link LTO vectorisation and loop unroll for at O2 and O3 optimisation levels (#195886)"
There's test failure for the addeda NerPM Test which sometimes
outputs "FunctionAnalysisManager" and sometimes
"AnalysisManager<Function>" (they are aliases).
This reverts commit e3c929c8f1bca3e96dcb3c3b1886f25f8244bb5d.
[mlir] Fix detection of default sub-element handlers
`has_default_sub_element_handler_t` was defined as
`decltype(T::DefaultHandlerTag)`. `DefaultHandlerTag` is a type alias, not
a value, and it is a member of `AttrTypeSubElementHandler<T>`, not of the
parameter type `T`. The expression was therefore never well-formed, and
`has_sub_attr_or_type_v` evaluated to true for every non-empty pack.
Every parametric attribute and type thus instantiated the full sub-element
walk/replace machinery, even when none of its parameters can contain an
attribute or type.
Query the handler instead. Keys without attribute or type parameters now
skip walking and return the original instance on replacement. In a
synthetic benchmark of 100 types with `unsigned` and `ArrayRef<int64_t>`
parameters, this lowers the peak compiler memory per type by 14-21% and
object size per type by 11-16% (GCC 13 and Clang 20, -O0/-O2 with -g).
[libc++] Only refine benchmark changes of at least 10% (#238012)
This will greatly reduce the number of commits we end up refining and we
should still get most of the value. This can be tweaked per machine in
case we have machines with more or less noise on them.
Assisted by Claude
[Bazel] Define MLIR Arith, Linalg, and Tosa extension libraries (#238021)
Fixes Bazel build after ef1b20bebe2cb17a02c18a25b863db75d40a3d91
(#237987), which moved Arith, Linalg, and Tosa sharding interface
implementations into separate extension libraries (`ArithExtensions`,
`LinalgExtensions`, and `TosaExtensions`) registered by
`RegisterAllExtensions`.
[VPlan] Remove header masks whose tail lanes aren't used
Replace a use of header-mask && x with x if the user, transitively
through freeze, logical-and, not and mask.beforefirst(freeze ...), only
reaches masks that are and'ed with the header mask again. The header
mask is a prefix and lane i of mask.beforefirst only depends on lanes
0..i, so the lanes outside of the header mask are never used.
This avoids the i1 vp.merge that EVL tail folding needs for the inner
header mask, e.g. in the early exit mask.beforefirst(freeze(header-mask
&& c)) and in switch default edges.