[AMDGPU] Set WMMA source-operand reuse bits in SIPreEmitPeephole
gfx1250 WMMA instructions can set matrix_a_reuse / matrix_b_reuse bits
that keep the A or B source operand in a high-temporality state in the
VALU source-operand cache, so a later WMMA reusing the same registers
hits in the cache instead of re-reading the register file.
Add a late, post-RA peephole in the existing pre-emit peephole pass that,
for every WMMA, sets the A or B reuse bit when the next WMMA in the basic
block reads the same physical registers as its A or B operand and those
registers are not redefined in between. Other instructions between the
two WMMAs are allowed.
The cache is only a few entries deep, so at most one reuse bit is set per
WMMA, and none is added if one is already set.
Stale sticky entries in the cache are cleared when a register is used in
an instruction without a reuse bit being set. Therefore, the final WMMA
use of the same source should not set the bit.
[Clang][counted_by] Capture the field l-value instead of re-emitting the load
To share the pointer field's address with the -fsanitize=array-bounds
check, EmitArraySubscriptExpr emitted the field load itself instead of
going through EmitPointerWithAlignment and ScalarExprEmitter. That
duplicated the scalar member-load path by hand, and the copy missed
several things that path does: the 'align_value' assumption (fixed in
the previous commit), the member's debug location, and the
-fdebug-info-for-profiling pseudo variable for the struct base. So
enabling the sanitizer changed debug info and sample-profile
attribution, even for fields where no bounds check was emitted at all.
Instead, emit the base exactly as before, and have
ScalarExprEmitter::EmitLoadOfLValue record the l-value it loads from
when it matches an expression registered in the new
CodeGenFunction::CurLoadedLValueCapture. The bounds check then uses the
recorded field address. Since the base is emitted the same way with and
without the sanitizer, the load keeps everything the scalar path does.
This also covers a cast between the field load and the subscript (e.g.
[7 lines not shown]
[AVR] Support STDSPQRr on reduced tiny cores (#230226)
Currently we always expand `STDSPQRr` to `STDPtrQRr`: which is wrong, because
`STDPtrQRr` doesn't exist on Tiny. This merge request fixes this expansion, same
way we already have `if (STI.hasTinyEncoding()) { ...}` for several other instructions.
Closes https://github.com/llvm/llvm-project/issues/226680.
databases/kividb: remove "include" directive
Such a functionality is a part of the USES=cargo framework.
No functional changes, so do not bump PORTREVISION.
Reported by: vanilla
Sponsored by: tipi.work
[IR] Declare command line options in TableGen (#233195)
Move the IR options that code with an LLVMContext reads into IROptions.
-disable-auto-upgrade-debug-info and -disable-i2p-p2i-opt become
-auto-upgrade-debug-info and -i2p-p2i-opt, keeping the old spellings as
aliases (with a TODO for removal).
llvm/unittests/IR/LibraryOptionsContextTest.cpp no longer depends on
InstCombine (a makeshift before LLVMCore is ported)
LLM-aided
[InstCombine] Fold exp2(uitofp x) to ldexp(1.0, x) with ninf
`exp2(uitofp iN x) -> ldexp(1.0, zext x)` currently requires N to be
narrower than `int`, because `ldexp` takes a signed `int` exponent.
When N equals the width of `int`, the fold is still correct under `ninf`.
Every LLVM FP type has $E_{\max} \le 16383 < 2^{15} \le 2^{N-1}$, so:
- $x < 2^{N-1}$: signed and unsigned $x$ agree, so $\operatorname{ldexp}(1.0, x) = 2^{x} = \operatorname{exp2}(x)$.
- $x \ge 2^{N-1}$: $\operatorname{exp2}(x) \ge 2^{2^{N-1}} > 2^{E_{\max}}$ overflows to $+\infty$, which is poison under `ninf`.
This only applies to the intrinsic, since the `exp2` libcall may set
`errno` on overflow.
This also enables `pow(2.0, uitofp x) -> ldexp` via the existing
`pow(2^n, x) -> exp2(n * x)` fold.
OCI: Remove dead code
We don't need to pick a repository URL when all we're doing is enabling
one which was specified in /etc/pkg/.
Reviewed by: dch, imp
Fixes: c73ae6734899 ("release/tools: use same pkg settings ...")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60868
[mlir][arith] Fix integer-to-float comparison canonicalization (#233631)
Reject conversions that can produce NaN or saturate, and formats that
cannot represent zero or signed inputs. Preserve safe rewrites when the
integer range fits the floating-point exponent range.
Handle unconditional `cmpf` predicates without reaching an unreachable
case. Add regression coverage for exotic formats and rounding limits.
Assisted-by: Codex
Wait up to 1 second for lite software reset to complete instead of 5 ms,
matching the Linux lan78xx driver. This fixes "timeout on lite software reset"
on a LAN7800.
ok kettenis@
Fix a kernel stack overflow in mue_init_ltm().
idx[] was uint8_t[6] but the LTM table read into it is 24 bytes.
Also handle mue_read_eeprom() errors like Linux does and byte swap
the values with letoh32().
Reported by Acts1631
ok kettenis@
[OpenMP][OMPTarget][test] Fortran tests for host pointers after FROM transfers
From #229966:
-------------------------------------------------+---------------------------
Test | Checks
-------------------------------------------------+---------------------------
derived_type_allocatable_skipped_from_no_restore | skipped FROM: host
| descriptor is not restored
derived_type_pointer_repointed_host_kept | re-pointed host pointer is
| kept after a target region
-------------------------------------------------+---------------------------
Co-authored-by: agozillon <Andrew.Gozillon at amd.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
[OpenMP][OMPTarget] Restore host pointers to their value before the FROM transfer
A FROM transfer of storage that holds an attached pointer/descriptor
overwrites the host copy with the device address, so the runtime writes a
host value back afterwards. That value was the one saved at attach time, and
it was written back for every FROM entry, transferred or not:
-------------------------------+---------------------+---------------------
Case | Before | After
-------------------------------+---------------------+---------------------
FROM skipped (ref count > 1) | host ptr reverted | untouched
FROM of the struct | host ptr reverted | value before FROM
FROM not covering the ptr | host ptr reverted | untouched
target update from(s.x) | host ptr reverted | untouched
-------------------------------+---------------------+---------------------
"Reverted" means set to its value at attach time. Since OpenMP 6.1 (TR15) the
host pointer may be re-pointed while its device pointer stays attached, so
that value can be stale.
[17 lines not shown]