TableGen: Fix advancing past the end of an empty macro fusion list
The MacroFusions list could be empty, so drop_begin went off the
end. This trapped on MSVC debug builds for targets without
fusions. Use adjacent_find to locate the duplicate instead.
Fixes regression from #239102.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
NAS-145089 / 27.1.0 / Ban `pytest.mark.skipif` (by themylogin) (#20149)
Currently, we skip tests based on a variety of conditions that's
difficult to predict. This results in incomplete test suite runs and
issues that can go unnoticed for months.
Let's define `@ha_test`, `@non_ha_test` and `@extended_test` decorators
that will skip tests based on the specific test suite selection that is
well-defined on our CI. Now, if we run extended tests for both HA and
non-HA, we can be sure that no test marked by `skipif` is silently
skipped.
`skipif` usage is banned from now on. If we need to introduce more
conditional tests runs, we must define a decorator and couple if with a
CI option or flag.
Original PR: https://github.com/truenas/middleware/pull/20145
Co-authored-by: themylogin <themylogin at gmail.com>
[ConstraintElim] Split signed min/max across their operands when checking a compare
The existing constraint systems only record the bounds that hold for both
operands of a min/max (smax(a, b) >= a and >= b, smin(a, b) <= a and <= b). The
other direction is a disjunction, which cannot be recorded as a fact. When a
compare of signed decompositions involves a min/max result, split it into its
operands: the decomposition is monotonic in that result, so it is the max or min
of its values on each side, and the relation holds for all or for either side
respectively.
https://alive2.llvm.org/ce/z/zsGkJ-
[ConstraintElim] A signed sum of operands with opposite signs cannot wrap
If one operand is known non-negative and the other non-positive, the signed
sum is between them, so it cannot overflow.
https://alive2.llvm.org/ce/z/ZF5Yqr
[ConstraintElim] Prove sadd/ssub.with.overflow cannot overflow from the exact sum
Decompose the operands and show that the sum lies in the range of the type. This
handles patterns like A + (B - A), as well as sums involving signed min/max
results, which are split across their respective operands using monotonicity
(for example start + smax(end - start - 1, 0) <= end).
https://alive2.llvm.org/ce/z/ze8LCk
reuse known bits result with WithCache
The overloads feel like a bit of a hack, but we need them because ValueTracking
is much more strict about const than ConstraintElimination, and where we'd want
automatic conversion from WithCache<Value*>& to WithCache<const Value*>& we
can't even do it manually. See: https://github.com/llvm/llvm-project/pull/235158#discussion_r4449759101
[ConstraintElim] Propagate the sign across an icmp samesign
If one operand of `icmp samesign` is known (non-)negative, so is the other. Add
that as a fact in the signed system.
https://alive2.llvm.org/ce/z/xUgGRM
virtio_random: defer first enqueue until after DRIVER_OK
According to the virtio spec:
> The driver MUST NOT send any buffer available notifications to the
> device before setting DRIVER_OK.
DRIVER_OK isn't set until after attach completes, so defer the first
enqueue. We haven't found any problems as a result of this to the best
of my knowledge: q35 and other devices that we *have* been used with
will apparently check when we go DRIVER_OK.
Tested with q35 virtio-random, which still works.
Reported by: llm-postcr
Reviewed by: kfv, markj
Fixes: f1c5a2e3a62505 ("virtio_random: Pipeline fetching the data")
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D61228
[lit] Specify endianness in `int.to_byte` (#239388)
Complement to #239364. Adds on other non-default argument to
`int.to_bytes`, which are needed for Python versions <= 3.10.
[llvm-diff] Compare function and call-site attributes (#238928)
Compare the function, return and parameter attributes and the calling
convention of the diffed functions, and of their call sites. Print the
attributes that are on only one side. This resolves the FIXMEs for
attributes and calling conventions.
AI-assisted.
RuntimeLibcalls: Add signatures for size returning new and GPU profiling (#238642)
__size_returning_new and its variants return __sized_ptr_t, a pointer
and size pair. The GPU profiling functions use the compiler-rt
prototypes.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc][sys/shm] Implement shmget syscall wrapper on Linux. (#239380)
`shmget` is a POSIX function (see
[docs](https://pubs.opengroup.org/onlinepubs/9799919799/functions/shmget.html#))
that returns a shared memory identifier created for a particular key.
On Linux, it can be implemented as a simple wrapper around `SYS_shmget`
syscall.
This is the first function from the newly added `<sys/shm.h>` header,
other functions / constants
will be added in the follow-up PRs.
[clang codegen] Fix MS ABI with deleted template constructor (#237634)
Under the Microsoft ABI, a class with a user-provided constructor cannot
be returned in a register. This check was fixed in 3ab4ae9e58c09 to also
handle template constructors. That fix missed a special case of the
special case: a deleted template constructor does not count as
user-provided.
Fixes #237188
[GlobalISel] Fold urem x, (shl pow2, y) to a mask (#238879)
Fixes #236466
This PR mirrors SelectionDAG's `OrZero` semantics to allow folding where
`d` is known to be a power of two or zero.
Prior to this, for a shift, `isKnownToBeAPowerOfTwo` only matched `1 <<
y` (which can only lose its bit where `y` is out of range, which is
poison), as shifting any other power of two may produce zero. Thus
`urem_pow2_to_mask` did not fire, and on AMDGPU GlobalISel fell back to
the full ~18 instruction division expansion whereas SelectionDAG
produces `x & (d - 1)`.
This patch adds an `OrZero` flag to `isKnownToBeAPowerOfTwo`, which now
recurses through `G_SHL`, `G_LSHR`, and `G_TRUNC` into the value being
shifted or truncated when said flag is set (or the result is known never
to be zero). The inclusion of `G_TRUNC` in this patch is necessary to
handle the `i64` case where `bypass-slow-division` truncates the
[7 lines not shown]
ggate: fix test intermittency
* ggatel: fix piped output. Flush stdout before daemonizing, so the
output can be read when it's in a command pipeline.
* ggated: bind the port _before_ daemonizing, so an invoking script can
be sure that the port is bound as soon as the command returns.
* tests: allow ggatec or ggatel to automatically allocate a device
number instead of choosing one in a racy way.
With all of these changes I can no run the tests 1000 times without
fail. And in parallel, too.
Sponsored by: ConnectWise
PR: 298942
Reported by: siva
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D60707
[2 lines not shown]
[ARM] Enable SlotIndexes compaction by default (#238515)
Greedy measures live ranges in slot indexes, and the entries left by
instructions erased before allocation make some ranges look longer than
they are. Opt ARM into dropping those entries, as was done for AMDGPU,
so allocation reflects the code actually being allocated.
The test updates are register assignment and spill placement changes.
Merge tag 'mm-core-7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/mm/core
Pull core memory management fixes from David Hildenbrand:
"Here's a bigger set of MM fixes that we didn't manage to have ready
for -rc1. All fixes are stable-worthy; the majority fixes nasty
long-standing bugs instead of being purely hotfixes.
We have some more of these kinds of stable-worthy fixes in the
pipeline, but we'll focus on the really urgent fixes as we get closer
to the release.
(Leaving urgent MM fixes lurking for various weeks is not good, but
having too many changes close to the release is also not good, it's
tricky ...)
Most issues were reported by Anthropic. Others were found while
reworking proposed fixes, and of course some of the fixes were just
reported and fixed on the mailing list.
[53 lines not shown]