[analyzer] Normalize sub-array indices in RegionStore initializer res… (#200044)
…olution
After #198346, alpha.unix.cstring.UninitializedRead reports a false
positive when a pointer into a fully-initialized const multidimensional
array is advanced past an inner dimension boundary and used as a source
argument to memcpy. The root cause is in
`convertOffsetsFromSvalToUnsigneds` in RegionStore, which returned
UndefinedVal for any element index exceeding its sub-array extent,
conflating pointer arithmetic legality with memory initializedness.
This patch separates the two concerns. The RegionStore now normalizes
indices that overflow an inner dimension by carrying into the outer
dimension via divmod, the same way `arr[0][5]` in `int arr[4][3]`
denotes the same memory as `arr[1][2]`. UndefinedVal is returned only
when the computed flat offset exceeds the total array allocation.
Whether cross-subobject pointer arithmetic constitutes undefined
behavior per C/C++ standards is a separate concern for individual
[3 lines not shown]
[clang-tidy] Fix cert-err33-c inheriting CheckedReturnTypes from bugp… (#200169)
…rone-unused-return-value
The cert-err33-c alias did not override CheckedReturnTypes, causing it
to inherit the default from bugprone-unused-return-value. This made it
flag any function returning std::error_code, std::expected, etc. That is
outside the scope of CERT ERR33-C (a fixed list of C standard library
functions).
Set CheckedReturnTypes to empty so the alias only checks its intended
function list.
---------
Co-authored-by: EugeneZelenko <eugene.zelenko at gmail.com>
UIDs/GIDs: remove duplicated entries
Fix duplicated autopulse and ldap entries introduced while
adding the bunkerweb user and group.
Reported by: osa
Sponsored by: Netzkommune GmbH
[OFFLOAD][L0] Refactor AsyncQueues (#200650)
This PR introduces a major refactor on how L0 queues are used in the
plugin as the current design is too tied to OpenMP behavior. There are
two major changes:
* We no longer have a per-thread queue cache as this resulted in a
single logical queue backed up by multiple L0 queues. We now have a per
device cache which should have a similar level of reuse performance.
* The AsyncQueueTy type has been largely extended to hide the logic of
the different queues types (which are now subclasses of AsyncQueueTy).
This has greatly simplified the L0Device implementation.
As part of this refactor a number of other changes happened:
* Copy command lists were removed in favor of the
ZE_COMMAND_QUEUE_FLAG_COPY_OFFLOAD_HINT driver hint.
* Support for inorder queues was added (can be selected using
LIBOMPTARGET_LEVEL_ZERO_COMMAND_MODE=inorder).
[7 lines not shown]
[X86] lowerShuffleAsBitBlend - use getConstVector to create selection mask (#200877)
Avoids wasteful SDValue creation if the shuffle matching fails, handles
any i64 legalisation and makes it easier to add UNDEF element handling
in the future.
Refine metadirective construct context handling and improve comments
Drop construct={simd} context matching because metadirectives
encountered in SIMD regions are rejected by semantics today:
```
subroutine test_construct_simd(n)
integer :: i, n
!$omp simd
do i = 1, n
!$omp metadirective &
!$omp & when(construct={simd}: nothing) &
!$omp & default(taskyield)
end do
!$omp end simd
end subroutine
```
Keep construct={for} matching because it only observes an already-lowered
[6 lines not shown]
sysutils/bttf: New port: Command-line utility for datetime processing
bttf is a command-line utility for working with dates and times. It
exposes much of the functionality of the Jiff datetime library on the
command line, providing a more intuitive way to format datetimes or do
arithmetic than traditional tools like date(1).
linuxulator: Return EINVAL for invalid inotify flags
We implement all of the currently-defined Linux inotify mask bits and
flags, with the same values as Linux. Return EINVAL for unknown bits,
as Linux does.
This also moves the translation inline into linux_inotify_add_watch.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57387
[CIR] Fix ordering of lifetime-extended cleanups (#200874)
We had a bug that was causing any lifetime-extended cleanups that
occurred within a full-expression cleanup scope to be emitted
prematurely when the expression also required deferred conditional
cleanups. This was, in some cases, causing a dangling reference to
temporaries that had already been destructed. Luckily, it was also
causing us to not emit a return at the end of the function in one case,
leading the verifier to draw attention to this problem.
This change introduces new functions in RunCleanupsScope to allow
"ordinary" EH stack cleanups to be force-emitted separately from
lifetime-extended cleanups. Classic codegen doesn't need this capability
because it handles deferred conditional cleanups very differently than
CIR due to its flat/branching approach.
The testing for this fix did uncover a significant issue wherein CIR is
calling destructors in the wrong order even after the fix in this PR.
However, that's a pre-existing issue that will require changes beyond
[2 lines not shown]
[VectorCombine] Don't fold non-idempotent shuffle reductions when shuffle duplicates element (#200778)
This is a small correctness fix for foldShuffleChainsToReduce. For odd /
non-power-of-2 vector sizes the parity-mask scheme duplicates a lane,
which is only sound when the reduction op is idempotent. For
non-idempotent ops (e.g. add, xor) the duplicated lane changes the
result, so I track a HasLaneDuplication flag and bail out of the fold in
that case. Tests cover non-foldable add/xor and a still-foldable
idempotent smax.
NAS-141191 / 26.0.0-RC.1 / fix release_notes_url (by yocalebo) (#19048)
This was broken silently outside our control. Return the new style URL
so release note hyperlinks in the TrueNAS UI actually resolve instead of
returning a 404 like they do currently.
Original PR: https://github.com/truenas/middleware/pull/19047
Co-authored-by: caleb <yocalebo at gmail.com>
[LV] Add users to header phis in tests (NFC). (#200890)
Make sure the header phis in various tests are actually used, to make
them more robust w.r.t. to future simplification changes. Those dead
phis would be cleaned up before LV in the regular pipeline.
NAS-141191 / 27.0.0-BETA.1 / fix release_notes_url (#19047)
This was broken silently outside our control. Return the new style URL
so release note hyperlinks in the TrueNAS UI actually resolve instead of
returning a 404 like they do currently.
[NVPTX] Fix fptosi/fptoui to i1. (#200718)
The langref says:
> The 'fptosi' instruction converts its floating-point operand into the
> nearest (rounding towards zero) signed integer value. If the value
> cannot fit in ty2, the result is a poison value.
Previously `fptosi to i1` and `fptoui to i1` were lowered as `x == 0.0`,
which is clearly incorrect.
Because the conversion truncates toward zero, the only results that are
not poison are:
- 0 and -1 for the signed case, and
- 0 and 1 for the unsigned case.
So the i1 result is fully determined by a single fp compare:
[3 lines not shown]
[Testing] Allow custom markers in llvm::Annotations (#195570)
The current annotation markers can conflict with several language
constructs. Notably, `[[ ]]` and `^` collide with C++ attributes (e.g.,
`[[nodiscard]]`), the C++26 reflection operator (`^^int`), and
Objective-C blocks (`void (^foo)(void)`). Similarly, `$` can conflict
with identifiers that also use `$` with `-fdollars-in-identifiers`, as
well as with C++26 code that uses `$` as raw-string delimiters or as a
preprocessing token
([P2558R2](https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2023/p2558r2.html)).
Because the markers are currently hardcoded in `llvm::Annotations`,
existing workarounds have to rely on digraphs or macro substitution via
implicit `#define`s. These approaches reduce readability and make tests
cumbersome to write. This PR alleviates these issues by adding support
for custom markers. It adds an overloaded `Annotations` constructor that
accepts a new `Annotations::Markers` struct. For example, to use `~` for
point, `@` for name, and `{{`/`}}` for range:
[39 lines not shown]
Do KN_DETACHED flag check before kn->kn_ptr.p_process dereference in
proc_filtops handlers. After filt_proc() sets KN_DETACHED flag, the
kn->kn_ptr.p_process is not valid anymore.
ok visa