[flang] Drop nuw on XArrayCoor for non-positive slice steps (#212639)
Example:
```fortran
z(:, 3:2:-1) = z(:, 1:2)
```
In this code, reverse-section indexing lowers `idx*step` / `diff+adj`
with `nuw`. A negative step can make the product negative, so `nuw` is
invalid and LLVM `-O2` can drop the stores.
Fix: keep `nsw|nuw` only for known positive steps; otherwise keep `nsw`
and drop `nuw` (negative, zero, or unknown).
[mlir][affine] Add useExpensiveMath option to AffineLoopNormalize pass (#211989)
This PR integrates constant bound inference into the existing
`AffineLoopNormalize` pass under a new `useExpensiveMath` option. When
`useExpensiveMath` is enabled (disabled by default due to potential
compilation time overhead), the pass leverages
`ValueBoundsConstraintSet` (uss presburger) analysis to refine dynamic
`affine.for` loop bounds into compile-time constant bounds. RFC:
https://discourse.llvm.org/t/rfc-mlir-enable-dynamic-and-tighter-affine-unrolling-via-valueboundsconstraintset/91055/2
---------
Co-authored-by: Oleksandr "Alex" Zinenko <azinenko at amd.com>
shells/iris: Add port: Shell auto-completion tool for your terminal
IRIS is built on top of TTY, so it runs everywhere. It just needs a
terminal!
Run iris wherever you already work; your local machine, a remote
server, or anywhere you can ssh. Each suggestion menu renders directly
inline inside your real terminal session, not an app's imitation of
one, so it never breaks full-screen TUIs or terminal
formatting. Automatically index your aliases and shell history to
suggest commands that match your actual workflow in real time. Change
configurations and propagate them instantly without restarting your
shell. One single local native Go binary, not an app: no gui, no
electron, no mac-only wrapper, no account, no telemetry. (if you've
used fig: it's that, rebuilt to run purely on TTY)
WWW: https://github.com/versenilvis/IRIS
[CopyProf] Add CopyProf instrumentation passes. (#207385)
This patch introduces the instrumentation passes and corresponding tests
for CopyProf, a profiling tool designed to identify unnecessary object
copies in C++ applications.
RFC at
https://discourse.llvm.org/t/rfc-copysanitizer-csan-detecting-unneccessary-object-copies-at-runtime/91038.
Three passes are added:
- CopyProfPass inserts enter/exit callback around special member
functions.
- CopyPRofStoresPass instruments store instructions to track memory
modifications.
- ModuleCopyProfPass inserts a module constructor to initialize the
CopyProf runtime at program startup (will be added later).
kqueue: Associate marker knotes with a queue
Otherwise the assertion in KQ_FLUX_SLEEP_WMESG may fail.
kqueue_fork_copy() already handles this.
Fixes: 1f4b0ea4f3eb ("kqueue: Add a helper macro for sleeping on in-flux knotes")
Reported by: syzkaller
Reported by: kbowling
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58516
[OpenMP] Split UPDATE clause into two: for ATOMIC and for DEPOBJ (#212270)
The UPDATE clause has the same spelling on both of these directives, but
functionally it's two different clauses. Split them into "update", and
"update_depend_objects" to be able to tie their properties to their enum
ids.
This should make it easier to implement auto-generating of clause
properties in the future by avoiding spelling conflicts.
---------
Co-authored-by: Alexey Bataev <a.bataev at outlook.com>
[CodeGen][ARM] Add regression tests for #202263 (#202599)
The underlying issue—RegisterCoalescer eliminating an undef COPY and
leaving a partial subregister redef that reads a value that no longer
exists—was fixed in #204039.
This PR adds the regression coverage originally developed alongside the
fix attempt, so the pattern remains covered:
- an end-to-end IR test that checks the generated assembly with
FileCheck;
- a focused single-pass `-run-pass=register-coalescer` MIR test using
`-verify-coalescing`, which reproduces the "Instruction is reading
nonexistent value" verifier error from #202263 when #204039 is reverted,
and passes with the fix applied.
Fixes #202263
[analyzer] Prune infeasible states related to concrete ints early to fix a crash (#210912)
RangedConstraintManager discards a simplified symbol if it reduces to a
concrete integer. This leads to delayed realization that some state
might be infeasible (because the concrete integer does not fit in the
assumed range), which might produce unexpected null pointers on the
following state splits.
PthreadLockChecker has fallen just into this trap. It assumes
`pthread_mutex_lock` is always called in a feasible state, which is was
not true.
In particular, in ZFS the analyzer crashes when runs in CTU mode because
it reaches `pthread_mutex_lock()` in over-constraint state (see the
reduced example in the first commit).
Checkers rely on the invariant that a state split can never result in
both `StateRef`s being null. To fix this violation of the invariant,
this patch helps RangedConstraintManager to realize a state is
infeasible and abort its exploration early so no follow-up state split
[5 lines not shown]
[Docs][AMDGPU] Explain completion of async operations
This improves the somewhat hand-wavey "memory model" currently described for
async operations. While this version is also not complete, it prepares for the
more complete memory model being written down.
[MIPS][clang] make `_Complex` ABI match GCC (#212119)
fixes https://github.com/llvm/llvm-project/issues/212109
From the edits to the release notes:
- On MIPS, a `_Complex` value with an integer element type is now
returned packed
into a single integer register when it fits in one, matching GCC. A
`_Complex char` or
`_Complex short`, and on N32/N64 also a `_Complex int`, is no longer
returned
with one part per register. `-fclang-abi-compat=23` restores the
previous
behavior. (#GH212109)
- On MIPS N32/N64, a `_Complex float` or `_Complex double` argument is
now packed
into integer registers, or onto the stack, once there is no longer room
[5 lines not shown]
[AArch64] NFC: simplify isCopyInstrImpl expression (#212487)
To something more intuitive by applying the following logic:
* `!isVirtual()` -> `isPhysical()`
* `!isPhysical()` -> `isVirtual()`
* `(a || b) && (!a || c)` -> `(!a && b) || (a && c)`
[libc++][NFC] Clean up atomic_support.h (#212464)
We don't support any compilers which don't have the atomic builtins, so
we don't need to check whether they exist. There is also no need for an
anonymous namespace, since all the functions are inline.
[mlir][toy] Fix Ch6/Ch7 llvm-lowering tests (#212118)
Add missing `| FileCheck %s` to `RUN` lines so `CHECK` lines can be
verified. Also correct the expected result from `30` to `36`. The result
should be `6*6=36`.
The example in the tutorial is correct (`3.600000e+01`).
https://mlir.llvm.org/docs/Tutorials/Toy/Ch-6/
Signed-off-by: Felix Ye <felixyjs at gmail.com>