[ControlFlowHub] Keep the incoming value of a redirected self-loop (#237903)
When reconnectPhis moves a PHI entry for a self-loop of Out (BB == Out)
into the new PHI in the guard block, it replaced the incoming value with
the new PHI itself. That is only right if the incoming value is the
original PHI, and that case is already handled: if the original PHI ends
up with no operands it is replaced by the new PHI everywhere, including
in the new PHI's own operand. Any other value, such as the next value
of an induction variable, was lost.
Keep the incoming value instead. This special case goes back to the
original UnifyLoopExits code, where BB == Out cannot happen.
FixIrreducible
reaches it when the header of an irreducible cycle has a self-loop.
In FixIrreducible/basic.ll the value along the self-loop is now the
input's own undef. In FixIrreducible/undef-phis.ll all the moved values
are now undef, so the PHI is replaced by undef (not poison, after
#237407).
[3 lines not shown]
[Flang][NFC] Remove trivial uses of SearchTypes (#238479)
Second cleanup after #216960
Some uses of `evaluate::SearchTypes` only use for a single TypeCategory.
With KIND not a template parameter anymore and uses only single static
TypeCategory, the visitor code does not need to be polymorphic anymore.
Most of these only look for a specific known-in-advance KIND, such that
we don't even need to loop over all kinds.
For the remaining uses I had the idea to turn `SearchTypes` into a
function that takes a polymorphic lambda. However, some visitor classes
such as `LocationHelper` and `AsConstantHelper` contain more methods
than just the callback method which diminishes the advantage over the
additional change churn.
Change applied using AI
[LoongArch] Load scalars into vector lane 0 with FLD/VLDREPL
Inserting a loaded integer into lane 0 of an undefined vector, which is
also how sub-128-bit vector loads are legalized, was lowered to a scalar
load plus [X]VINSGR2VR. VINSGR2VR merges into its destination, so it
carries a false dependency on the previous value of that register, and
it needs a GPR-to-vector move.
Use FLD.{S/D} for 32/64-bit elements and [X]VLDREPL.{B/H} for 8/16-bit
elements instead. They write the whole register in one instruction.
When the register allocator reuses one vector register for several such
loads, the false dependency serializes otherwise independent chains. In
the GSM autocorrelation loop (9 x i64 multiply-accumulate over i16 taps)
on LA664:
VF2: 0.953s -> 0.724s
VF4: 1.446s -> 0.856s
[Clang] Use fixed triple for more Profile tests (NFC) (#239186)
The index type size will differ between 32-bit and 64-bit platforms,
producing slightly different IR. Use a fixed 64-bit triple to
keep output consistent.
system: simplify rc.halt and rc.reboot and use it during firmware upgrades as well
Run stop through our /etc/rc.shutdown hook and use the RC scripts everywhere.
Related to: https://forum.opnsense.org/index.php?topic=53287.0
[libc] Use a syscall wrapper for pkey_free
This PR move pkey_free behind the centralized syscall wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for pkey_alloc
This PR move pkey_alloc behind the centralized syscall wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for mremap
This PR move mremap behind the centralized syscall wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
System: Access - add "authority" option to ACL's which can be set to one of 'limited', 'administrative', 'unrestricted', this will help the user to identify sensitive roles more easily.
[mlir][ODS] Set `cppIncludes` on core traits and interfaces
Set the `cppIncludes` field introduced in #236155 on the traits and
interfaces defined in MLIR's core. Generated declarations using them now include the
headers declaring them.
Dialect interfaces get the field as well, although their generated
declarations do not emit includes yet.
Record-level `let` statements were generally preferred (as is currently convention with e.g., `cppNamespace`) with just occasional use of top-level `let` for e.g., many small trait definitions.
Co-authored-by: Claude <noreply at anthropic.com>
metalog: serialise the writes to the metalog
The stream was a plain global: two threads adding entries could interleave
their buffered writes, and a close racing with an add left a dangling
stream. Protect it with a mutex and clear the pointer once closed.
pkgdb: stop caching the length of the database directory
The length was computed on the first call and kept in a static, so any
later change of the database directory trimmed the paths at the wrong
offset. Compute it on every call, this is not a hot path.
[MachineSink] Don't pass LiveIntervals and SlotIndexes to SplitCriticalEdge (#238888)
LiveIntervals and SlotIndexes are not used by this pass.
SplitCriticalEdge does not need them as well. This removes them and all
mentions of those analysis from MachineSink.
This was causing a crash under NewPM pipeline because SlotIndexes were
passed to SplitCriticalEdge, which was attempting to update it, but the
SI became corrupted in PerformTrivialForwardCoalescing which destroys MI
without updating SI
[CopyProf][NFC] Add argument comments in state test. (#237763)
Split out of #232851 as requested in review.
Stack: #237763 (this PR) → #232851 → #235453 → #235454 → #235455