snmp_hostres(3): strengthen work on the devd(8) socket
Use the SOCK_SEQPACKET version of the socket. This guarantees that
messages read won't be glued together. Use sufficient buffer size to
read any message.
Close socket on any kind of error or a short read.
This also fixes a bug when a SOCK_STREAM socket containing exactly
multiple of 512 bytes would block the daemon in read(2) until some
other devd(8) event. Thank to David for catching and analyzing it.
Reported by: David Pfitzner <dpfitzner at netflix.com>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D61146
devd: expose maximum record size via sysconf(3)
Use UMA allocation size that holds the buffer. The buffer is actually
slightly smaller. Document the latter so that clients don't need to use
+1 if they later want to NUL-terminate a message.
Reviewed by: mjg, imp
Differential Revision: https://reviews.freebsd.org/D61346
devd: define _PATH_DEVD_SOCKET in <paths.h>
Sweep through consumers and use the define.
Reviewed by: kfv, imp
Differential Revision: https://reviews.freebsd.org/D61344
[DwarfDebug] Add applyDwarfVersion() so the targets like NVPTX can recompute the version-derived state (#234510)
`DwarfDebug` derives several settings such as DWARF64, accelerator table
kind, GNU TLS opcode, DWARF2
bitfields, segmented string offsets, .debug_macro, MinimizeAddr, and the
MCContext version and format from the DWARF version in its constructor.
A target that overrides the version after construction could change only
the MCContext value, leaving the rest
derived from a different version.
This change refactors this version-derived state into
`DwarfDebug::applyDwarfVersion(unsigned)`, called by the constructor and
callable again by a target subclass. The version-independent part of the
constructor is unchanged.
`NVPTXDwarfDebug`, which always emits DWARF v2, calls this function to
set version 2.
This fixes a module with no "Dwarf Version" flag getting a v2 header
with v4 encodings (DW_AT_data_bit_offset instead of DW_AT_bit_offset).
[3 lines not shown]
[Index] Report references through UsingType (#228823)
namespace ns2 { using ns1::A; }
ns2::A a;
`ns2::A` is a UsingType. TypeIndexer has no VisitUsingTypeLoc and
RecursiveASTVisitor only traverses the qualifier, so the reference to A
has been dropped since UsingType was introduced (af27466c5039). This
affects clangd's find-references and index, as well as other
clangIndex users like ccls.
Report the target declaration, similar to DeclRefExpr. For a typedef
target used as a base specifier, also report the implicit reference to
the class, like VisitTypedefTypeLoc.
Aided by Opus 5.5
[clang][PAC] Fix crashes on _Atomic __ptrauth-qualified objects (#240294)
Implicit `_Atomic` operations on a `__ptrauth`-qualified object assert
in CodeGen, because the pointer-authentication helpers do not look
through `AtomicType`: https://godbolt.org/z/6KE7Ez5P4 (a trunk build, so
the link stops crashing once this lands).
Fix the crashes. In a build without assertions the same code miscompiled
an `_Atomic` function pointer under `-fptrauth-calls`, signing it twice
or leaving it unsigned. Nothing else changes: the tests simply document
current behavior, with a FIXME on what I propose fixing in follow-ups,
for example https://godbolt.org/z/hGosq14ea.
Assisted-by: AI
usbhid: Retry fetching the report descriptor
So far only seen with a wireless mouse on a Logitech Unifying
receiver. The receiver can time out on GET_DESCRIPTOR(REPORT) while
still starting up after power is applied, for example after resume
or when switched back through a USB switch. On failure, hms falls
back to the boot protocol descriptor and the mouse loses its wheel.
Wired mice have not shown the problem.
Retry the request up to five times with a 100 ms pause, stopping
early on a stall since that means the device has no descriptor.
Linux usbhid retries this request in the same way.
usbhid: Retry fetching the report descriptor
So far only seen with a wireless mouse on a Logitech Unifying
receiver. The receiver can time out on GET_DESCRIPTOR(REPORT) while
still starting up after power is applied, for example after resume
or when switched back through a USB switch. On failure, hms falls
back to the boot protocol descriptor and the mouse loses its wheel.
Wired mice have not shown the problem.
Retry the request up to five times with a 100 ms pause, stopping
early on a stall since that means the device has no descriptor.
Linux usbhid retries this request in the same way.
[DSE][AMDGPU] Remove dead LDS writes at wave exit
LDS is freed once every wave of a work-group has terminated, and a
wave terminates when its entry function returns. Other waves can only
observe its LDS writes through a synchronizing operation. DSE still
kept every such write, because it treats LDS like any other global.
Add a TTI hook that reports address spaces whose writes cannot be
observed once a function returns, and let DSE treat globals in them
like allocas at function exit. AMDGPU reports LDS in entry functions.
Loads, barriers, fences, atomics and calls still keep earlier writes.
Change-Id: I3147eae461cf85e9e1f15d5626266c496fb4c430
Co-Authored-By: Claude Fable 5.2 <noreply at anthropic.com>
[DSE][AMDGPU] Add LDS store-at-exit tests (NFC)
DSE keeps LDS writes that nothing reads or synchronizes before an
entry function returns. Record the current behavior before changing
it.
Change-Id: If7c568ce3aec9e7fe847fccd6698ac71733b2364
Co-Authored-By: Claude Fable 5.2 <noreply at anthropic.com>
CodeGen: Share atomic libcall selection between the legalizers (#239083)
SelectionDAG and GlobalISel each had their own copies of the choice
between an outline atomic and a __sync_* call. Move it into a common
helper.
The __sync_* call is now always looked up in the DAG's libcall info,
rather than sometimes in the TargetLowering defaults. Also disable
the untested __sync call case in GlobalISel.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Clang][CFI] Don't report sanitizer stats for unchecked VFE loads (#241641)
With virtual function elimination (3b598b9c867a),
`EmitVTableTypeCheckedLoad` is also used for calls that have no
`cfi-vcall` check, such as calls in `no_sanitize("cfi-vcall")` functions
or on ignorelisted classes. It reported `-fsanitize-stats` for these
calls anyway, so the stats counted checks that were never performed.
Report stats only when the check is emitted.
Assisted-by: Gemini
[mlir][vector] Handle rank zero case in resolveAllTrueCreateMaskOp (#240128)
- handle rank-0 case in `resolveAllTrueCreateMaskOp` that crashed
assuming operand count equals rank, which isn't true in the case of
rank-0.
- now `resolveAllTrueCreateMaskOp` handles rank-0 case the same way
`CreateMaskFolder` does, by using a shape of {1} with scalable flags
{false}, reused the existing pattern for consistency.
- fix `ConstantMaskOp::build` bug @FedericoBruzzone pointed out. now the
builder passes {1} for `AllTrue`, {0} for `AllFalse` when the rank is 0
and produces valid IR.
- add repro and constant rank 0 case as regression test .
fixes #240008 crash
Co-authored-by: Andrzej Warzyński <andrzej.warzynski at gmail.com>
[lldb] Suggest 'bugreport' after errors that may be LLDB bugs (#241615)
Errors that were likely caused by an LLDB bug ended in ad-hoc variations
of "please file a bug and attach the file at the start of this error
message". Report them with the new Debugger::ReportInternalError
instead, which follows the error with one shared note:
```
note: if you believe this is a bug, use the 'bugreport' command
```
Each debugger shows the note once per distinct failure, deduplicated
with the same ThreadSafeDenseSet that Module uses for its own
diagnostics. The new diagnostics.suggest-bugreport setting turns the
note off. Because the note is part of the event message, the setting
also suppresses it for SB clients such as lldb-dap.
Assisted-by: Claude
[RISCV][GlobalISel] Preserve KCFI type on indirect calls (#240364)
The commit propagates `CallLoweringInfo::CFIType` to the call
instruction in GlobalISel so the KCFI pass can emit indirect-call
checks, matching SelectionDAG lowering.
AI Usage: Assisted by Amp (Opus 5.5)
Reproducer: https://godbolt.org/z/M14bnYqKn
---------
Co-authored-by: Amp <amp at ampcode.com>
[AMDGPU] Precommit test before making gfx1250 packed FP32 shuffles free (#241409)
Precommit test before https://github.com/llvm/llvm-project/pull/240999
is reviewed.
---------
Co-authored-by: Tim Gymnich <tim at gymni.ch>
[IR] Make optnone imply noinline (#228169)
Previously the verifier required every `optnone` function to also carry
`noinline`. Instead, make `optnone` imply `noinline` so the pairing is
no
longer necessary.
To avoid each user having to remember to check both attributes, add
`Function::isNoInline()` (true for `noinline` or `optnone`) and make
`CallBase::isNoInline()` defer to it for the callee. Existing direct
queries of `Attribute::NoInline` on functions are migrated to the
helper.
The verifier now explicitly rejects `alwaysinline` + `optnone`, which
was
previously only enforced transitively via the `noinline` requirement.
ForceFunctionAttrs and llvm-reduce no longer need to keep the two
attributes paired.
Assisted-By: Claude
[IR] Skip removeDeadConstantUsers use-list walks to save ~0.25% wall time (#240626)
GlobalOpt's `deleteIfDead` calls `removeDeadConstantUsers()` on every
global before checking whether it is dead. For a function, that walks
the whole use list, which is mostly call sites, and loads each user only
to find that it is an instruction. Those loads usually miss in cache. In
AMD IBS profiles of `opt -O2` on four large LLVM TUs (X86ISelLowering,
AArch64ISelLowering, DAGCombiner, ScalarEvolution),
`removeDeadConstantUsers` accounts for 10-19% of the loads served from
L3 or DRAM, but only about 0.5% of cycles.
Only constants that are not globals can be dead users, and with opaque
pointers most functions have none. This patch adds a `GlobalValue` bit,
`MayHaveConstantUsers`. The bit is set when such a constant takes the
global as an operand: in `ConstantUniqueMap::create` and
`replaceOperandsInPlace`, and for `DSOLocalEquivalent` and `NoCFIValue`.
`removeDeadConstantUsers` returns immediately when the bit is clear. It
clears the bit after a walk that leaves no live non-global constant
users. Only those constant-creation paths set the bit, and they are
[18 lines not shown]