[mlir][VCIX] Check legalized type before use in math.tan test pattern (#236051)
`MathTanToVCIX` called `getElementType()` on the result of
`legalizeVectorType()` before checking whether legalization failed. For
types it can't legalize (scalars, multi-dimensional vectors, scalable
vectors with unsupported element types) that result is null, so the
pattern crashed instead of leaving the op alone like the cos, sin and
log patterns do.
This moves the null check above the first use and adds tests for a
scalar `math.tan` and a `vector<2x4xf32>` one.
Fixes #231844
Merge tag 'm68knommu-for-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Pull m68knommu updates from Greg Ungerer:
"Platform code added for the ColdFire 54418 RNG hardware block. Also
PWM address definitions for the 54418. A fix for seccomp filter
processing during system call entry and a fix for compiling the
Cleopatra board target. A config update for the stmark board, and
lastly a couple of typo fixes"
* tag 'm68knommu-for-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
m68k: coldfire: Add RNG support for MCF54418
m68k: mcf5441x: add PWM defines
m68knommu: fix compile breakage for 5407 cleopatra board
m68k: defconfig: update stmark2 defconfig
m68k: Fix seccomp filtering on ColdFire and 68000
m68k: remove unused <asm/quicc_simple.h> header
m68k: fix typo "eanble" in comment
m68k: coldfire: fix typos in reset.c comment
Merge tag 'trace-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracing updates from Steven Rostedt:
- Add "within" to filter logic
Add a way to trace events by what function they fall in.
echo 'within == "vfs_read" > events/sched/sched_switch/filter
Will only trigger sched_switch events that happen within the vfs_read
function. It uses a stacktrace at the event and checks if any entry
is within the specified function and if so, it prints the event.
- Remove a duplicate definition of ftrace_set_clr_event() from the
header
- Do not have ftrace_set_clr_event() modify its input buffer
[118 lines not shown]
libthr/thr_mutex.c: make mutex asserts more useful
Print the file and line number of the caller where the assert fired.
Use _thread_exitf() directly for this.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
[mlir][acc] Cache symbol lookups in ACCImplicitData (#236237)
ACCImplicitData resolves the global behind every candidate variable with
SymbolTable::lookupNearestSymbolFrom, through isDeviceAccessibleValue,
isInDeviceMemoryValue and the FIR type-interface models. Without a table
each lookup scans every top-level op of the module, so on a module with
thousands of symbols this dominates the pass.
Let callers pass an optional SymbolTableCollection to
isDeviceAccessibleValue, isInDeviceMemoryValue, isValidValueUse and
OpenACCSupport::isValidValueUse, and add it as a trailing parameter of
the
PointerLikeType and MappableType isDeviceAccessible / isInDeviceMemory
interface methods. ACCImplicitData keeps one collection for the duration
of a run. Passing no collection keeps the previous behavior.
This can speedup the pass by 4.5x on a large TU with a lots of symbols.
[Support][mlir] Allow custom prefixes in SourceMgrDiagnosticVerifier (#227568)
Allow callers to choose the directive prefixes (default: `expected`),
like Clang's `-verify=<prefixes>`, so that one test file can be shared
between RUN lines with different expectations.
A prefix now has to be at the start of the line or follow a character
other than `[[:alnum:]_-]`, so that `expected-error` is no longer found
inside e.g. `unexpected-error`. This also applies to MLIR.
Assisted-by: AI tooling
Pull-Request: https://github.com/llvm/llvm-project/pull/227568
[RISCV][P-ext] Add isel pattern for mulsu.h11/maccsu.h11 (#236118)
`mulsu.h11` multiplies the sign-extended upper half word of rs1 by the
zero-extended upper half word of rs2. `maccsu.h11` adds the product to
rd.
Previously, (sra X, 16) and (srl X, 16) were selected as separate
srai/srli instructions feeding `mul` or `maccsu.h00`. Match them
directly
so both shifts are folded. As with `maccsu.h00`, the maccsu pattern
requires the multiply to have a single use.
[flang] Evaluate InElemental() at most once per scope (#236235)
`CheckHelper::InElemental()` called `IsElementalProcedure()` on every
use. That characterizes the whole enclosing procedure, including every
dummy argument and the folding of its shape. `CheckObjectEntity()` calls
`InElemental()` for each object entity, so declaration checking was
quadratic in the number of dummy arguments: issue 236223 has the
reproducer and the profile.
This caches the result for the innermost procedure symbol and resets it
whenever `CheckHelper::Check(const Scope &)` changes that symbol.
Diagnostics are unchanged: `IsElementalProcedure()` is still the only
source of the answer, just evaluated once per scope instead of once per
entity.
With the issue's generator, `-fsyntax-only` is now linear in the number
of dummies: at 800 explicit-shape dummies it goes from 24.8 G to 0.44 G
instructions (about 56x). `check-flang` passes.
[2 lines not shown]
[AArch64][MTE] Tag dynamic allocas in AArch64StackTagging
Instrument dynamic allocas in the memtag-stack pass, more or less
following the the way AddressSanitizer does: by instrumenting
stackrestore to un(poison/tag) allocas when free'd.
- Dynamic allocas are given 16-byte alignment and padded to 16-bytes.
- At lifetime.start (or at the alloca if no lifetimes), the dynamic
alloca is tagged.
- The most recently executed dynamic alloca is tracked in an extra
per-func static alloca. The address of this static alloca is used
as the bottom (highest address) of the dynamic alloca section of
the frame, while the value stored there is treated as the current
top (lowest address) of the frame.
- At llvm.stackrestores, memory is untagged from the restored sp
to the last executed dynamic alloca.
- At function returns, memory is untagged from the last executed
dynamic alloca to the bottom of the (dynamic alloca section of) the
frame.
[2 lines not shown]
Take the FreeBSD kexts from nextbsd-kernel-extensions
IntelWiFi and IntelEthernet now build in the new nextbsd-kernel-extensions
and ship as freebsd-kexts-amd64.tar.gz (nextbsd/nextbsd#554); fetch that
instead of the two Intel tarballs from the graphics repo.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[AArch64][MTE] Tag dynamic allocas in AArch64StackTagging
Instrument dynamic allocas in the memtag-stack pass, more or less
following the the way AddressSanitizer does: by instrumenting
stackrestore to un(poison/tag) allocas when free'd.
- Dynamic allocas are given 16-byte alignment and padded to 16-bytes.
- At lifetime.start (or at the alloca if no lifetimes), the dynamic
alloca is tagged.
- The most recently executed dynamic alloca is tracked in an extra
per-func static alloca. The address of this static alloca is used
as the bottom (highest address) of the dynamic alloca section of
the frame, while the value stored there is treated as the current
top (lowest address) of the frame.
- At llvm.stackrestores, memory is untagged from the restored sp
to the last executed dynamic alloca.
- At function returns, memory is untagged from the last executed
dynamic alloca to the bottom of the (dynamic alloca section of) the
frame.
[2 lines not shown]
Use nextbsd-kernel-extensions-graphics, failing loudly (#590)
nextbsd-kernel-extensions is now nextbsd-kernel-extensions-graphics
(nextbsd/nextbsd#551). Fetch the kexts and the Raspberry Pi 5 overlays
from the new name before the old one is reused, and fail when any of
them is missing instead of shipping an image without it
(nextbsd/nextbsd#552). README and issue refs follow.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc++] Make detect-changepoints much faster (#236245)
The permutation test used to find changepoints was the bottleneck of the
LNT refinement job. This patch makes the test much cheaper in two ways
without changing the algorithm:
- Compute the best split of a segment only once, when the segment is
created.
- Scoring every split of a segment only needs the sums of distances
within the first t points and between the first t points and the whole
segment. The latter doesn't depend on the order of the points, so it is
computed once per segment.
This was measured to be roughly 10x faster as the previous algorithm,
and gives the same results.
Assisted by Claude
Fix a typo (share/locale/Makefile.locale)
While in an actual Makefile variable assigmnent, this value seems
not to be used (the LANGUAGE_XX variables appear to be never used),
so the typo was completely benign. Note that there is no "au" in
the LANGUAGE list.
Fix it for consistency, and so no-one else ever needs to wonder
what is going on here (for which the answer is "nothing").