[AArch64] Prefer wider-immediate comparisons to avoid constant materalization (#224187)
Prefer the first CMP/CMN comparison when the immediate exceeds the CCMP/CCMN 5-bit range. This allows larger legal immediate to be encoded directly, which avoids unnecessary materialization of constants into registers.
[RISCV] Lower masked shifted OR to QC_INSB (#233390)
Recognize `or (and X, MaskImm), (shl Y, ShAmt)` patterns and lower them
to `QC_INSB` when the shifted value only writes bits cleared by the
mask.
Assisted by gpt-5.6-luna
[MemProf] Fix ThinLTO ICP for local indirect call targets (#233242)
When the VP metadata for an indirect call contains the original name
GUID
of a local target (i.e. without the source file prefix), as happens when
it
is synthesized from the MemProf profile's callee GUIDs or comes from a
SamplePGO profile, MemProf cloning and ICP failed:
- Thin link: updateValueInfoForIndirectCalls translated the original
name
GUID to the actual GUID of the local function via the OidGuidMap for the
call edges, but not for the synthesized MemProf CallsiteInfo callees.
The
callsite node in the context graph then had a callee without a summary,
which did not match the profiled callee function, and was removed (null
call), severing the graph above the target. Also update the callsite
callees.
- ThinLTO backend: ICP looked up the target in the Symtab using the VP
[8 lines not shown]
[AMDGPU] Select nop postRA scheduler with coexec
The coexec strategy places instructions in the open cycles of WMMA and MFMA
co-execution windows, and the generic post-RA scheduler then reorders that
schedule. Use the nop post-RA scheduler for functions that use the coexec
strategy, unless amdgpu-post-sched-strategy is set.
Check required kvm(3) symbols before reading
Check required symbols in dconschat, ipcs, netstat and legacy pstat TTY
paths. Keep optional IPC subsystems usable. Check IPC reads and
allocations before using their data.
Use buffered IPC errors and report short reads explicitly instead of
relying on an error buffer that may not describe the incomplete read.
Bug: https://bugs.dragonflybsd.org/issues/3444
[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]
libkvm(3): clear failed lookups and report lookup errors
Clear requested symbol results before lookup. Keep the live failure
count and continue looking up later entries. Report lookup errors
without relying on the last errno, and preserve table errors in internal
callers.
Bug: https://bugs.dragonflybsd.org/issues/3444
[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@