[SLP][modularisation][NFC] Move loop trip-count helpers to SLPUtils (#222614)
Move the BoUpSLP-independent helpers findInnermostNonInvariantLoop and
getLoopTripCount out of SLPVectorizer.cpp into the self-contained
SLPVectorizer/SLPUtils.{h,cpp} module. getLoopTripCount reads the
file-local
LoopAwareTripCount cl::opt, which stays static in SLPVectorizer.cpp and
is
passed to the moved helper as an explicit parameter. NFC.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
[ELF] Move layout-changing transforms before address assignment (#232189)
finalizeAddressDependentContent assigns addresses, then
--randomize-section-padding and CFI jump table relaxation
(--branch-to-branch, implied by -O2) move input sections, so the first
fixed-point iteration computes address-dependent content from stale
addresses. Since #179089, EhFrameHeader::updateAllocSize caches the
.eh_frame_hdr search table; if no iteration changes anything, the loop
exits and the table keys no longer match the FDEs' initial_location.
Neither transform reads addresses, so run them before the first
assignAddresses. SHF_LINK_ORDER sections are now sorted by the relaxed
layout as well.
LLM-aided. Partially fix #226166
(cherry picked from commit 115554f90f920fc000234c2c247b8318d4e7d2d8)
[PowerPC] Don't let optimizeCompareInstr define CR0 while it is still live (#220999)
This replaces the compare-against-zero in
`PPCInstrInfo::optimizeCompareInstr` with the record form of the
instruction defining the compared register only when CR0 is dead at that
point, checked with `MachineBasicBlock::computeRegisterLiveness`
scanning to the end of the block.
Fixes #220996.
## Why
The conversion makes `MI` define CR0. CR0 can still be live there: the
`ANDI_rec_1_{EQ,GT}_BIT` pseudo expansion emits `ANDI_rec` followed by
COPYs of `$cr0eq`/`$cr0gt`, and nothing keeps those copies adjacent to
their `andi.` once other instructions are scheduled in between. A later
compare candidate sitting between an `andi.` and one of its copies gets
converted, clobbers CR0, and the copy then reads the wrong value — the
two flag tests swap conditions.
[43 lines not shown]
[Clang][counted_by] Load the count through unions by byte offset (#228309)
`getGEPIndicesToField()` indexed into a union with 0 and kept walking the
counter's struct field numbers, but the union's IR type is its largest
member, so the count was loaded from inside that member instead.
In Linux, `landlock_domain` hits this and FORTIFY panics on every nested
`landlock_restrict_self()` on kernel 7.3.0-rc5-next as of this writing.
I ran into this bug when trying to daily drive the aforementioned
kernel.
Below is a reduced version of `landlock_domain`. The `work` member
stands in for the kernel's `struct work_struct`, which is larger than the
anonymous struct holding the count, so it becomes the union's IR type.
```c
struct dom {
void *rules[3];
[21 lines not shown]
[clang] Treat pack-index-specifiers as non-deduced contexts (#232883)
Per C++26 [temp.deduct.type]p5.2, a pack-index-specifier is a
non-deduced context. Deduction against an unresolved PackIndexingType
used to fail with a bare IncompletePack result that carried no
parameter/argument info, so matching an explicit instantiation, explicit
specialization, or address-of against such a function template was
rejected, and emitting the resulting diagnostic crashed in
DiagnoseBadDeduction (assertion "no parameter found for incomplete
deduction result" in +asserts builds, null dereference otherwise).
A pack-index-specifier whose pack and index are fully substituted
canonicalizes to its selected type, so the PackIndexing case in
DeduceTemplateArgumentsByTypeMatch only ever sees unresolved ones;
returning Success there (deducing nothing) is all that is needed.
Fixes #232220
model:ContainerField - exclude volatile fields in isFieldChanged()
Volatile fields are usually initialized during model setup, but when untouched (no setter being called), they are marked changed.
Found this one by accident while looking at https://github.com/opnsense/core/issues/11048 which triggers validations for unchanged records.
[libc++] Don't claim strong emplace guarantee for vector/deque of throwing-move types (#229686)
`__container_traits<vector>` and `__container_traits<deque>` set
`__emplacement_has_strong_exception_safety_guarantee` whenever `T` is
Cpp17CopyInsertable. [vector.modifiers]/2 and [deque.modifiers]/3 only
guarantee "no effects" for an insertion at the end (or at either end for
deque). An insertion in the middle move-constructs and move-assigns
existing elements, and exceptions from those operations are excluded
from the guarantee.
The flat containers use this trait in `__emplace_exact_pos` to decide
whether to clear themselves when an emplacement throws. Because the
trait
is too optimistic, they skip the clear and are left in a state that
breaks their invariants
This patch reports the strong guarantee only when `T` is nothrow move
constructible and nothrow move assignable. In that case the only
operations that can throw (allocation and constructing the new element)
[11 lines not shown]
devel/gwm: Fix LICENSE after upstream dual-license switch
Upstream relicensed at 1.10.0: LICENSE.md is gone, replaced by
LICENSE-MIT and LICENSE-APACHE, and Cargo.toml now declares
"MIT OR Apache-2.0". The stale LICENSE_FILE went unnoticed in the
1.10.0 update because licenses were disabled in the build at the
time; with them enabled again the patch phase fails with "Missing
license file for MIT".
No PORTREVISION bump: the pending _1 -> _2 revision has never
produced a package, so the added license files ride along with it.
(cherry picked from commit 30bb7cd78f6abfb2d83c89f1ef01a4558bd4cd33)
lang/erlang: Fix the vsn.mk consistency checks in pre-configure
The checks grepped lib/*/vsn.mk for _EI_VSN, _TOOLS_VSN and _SNMP_VSN,
but upstream names those variables EI_VSN, TOOLS_VSN and SNMP_VSN.
The grep therefore matched nothing and each test reduced to
[ ! = <version> ], which sh evaluates as a false string comparison, so
every check passed silently no matter what the Makefile said.
The port-side variables grew their underscore prefix in 12b48a4d8ea,
which renamed them inside the grep patterns as well.
(cherry picked from commit af2f39d2d6d9520cc5e9710910a0454aee01ad5d)
lang/erlang: Do not add WRKSRC/lib to ERL_LIBS during build
ERL_LIBS=${WRKSRC}/lib puts the half-populated in-tree lib/*/ebin
directories on the bootstrap erlc's code path, where they shadow the
bootstrap compiler. That breaks whenever a patch release changes an
API inside the compiler itself. OTP 28.5.0.8 changes
beam_ssa_type:opt_start from arity 2 to arity 3, so the freshly
written beam_ssa_opt.beam gets loaded from lib/compiler/ebin while
beam_ssa_type still comes from the bootstrap, and the build dies with
beam_ssa_recv.erl: internal error in pass beam_ssa_opt:
exception error: undefined function beam_ssa_type:opt_start/3
The ordering inside lib/compiler/src is alphabetical, so this is not a
job race and MAKE_JOBS_UNSAFE, which the error message suggests, does
not help.
The build system derives its own code paths from ERL_TOP, and
lang/erlang-runtime2[789] build the same tarballs, doc chunks
[4 lines not shown]