[llvm] Fix a narrowing conversion warning; NFC (#240502)
This was causing a diagnostic about narrowing from double to float in
MSVC. Added a suffix to appease the compiler.
18647 kmem_update() runs every 1.5s since hires_tick became the default
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Reviewed by: Gordon Ross <Gordon.W.Ross at gmail.com>
Approved by: Dan McDonald <danmcd at oxide.computer>
[LAA] Add tests for negative-step bounds with a symbolic start (NFC) (#236784)
Reverse early-exit loops where LAA misses the low bound, each adding an
obstacle to the previous one:
- the start, A + 4 * n, is not known to be u>= A
- the start offset is bounded only by a loop guard, not applied for a
negative step
- the deref size and the start offset are related only through loop
guards, and SCEV cannot compare them
Follow-up to https://github.com/llvm/llvm-project/pull/211964
[mlir] Remove forward and friend declarations of non-existent types (NFC) (#239117)
This patch removes forward and friend declarations of classes and a
struct that have no definitions in the codebase.
Assisted-by: Antigravity
[MemorySSA] Remove ensureOptimizedUses
After https://github.com/llvm/llvm-project/pull/240217, the last
OptmizedUses consumers is gone. Nowadays, we don't encourage pass writer
to use MemoryUse cache and it is part of the work of MemorySSA walker.
As a result, we remove MemorySSA::OptimizeUses and its related
paramter. The test needs to be chnage as we don't do walker's job now
in memoryssa.
Also, The memoryssa is not registered as a normal function pass
instead of a pass takes parameter.
Assisted-by: Claude # Test Doc
vmd(8): Reject vioblk requests beyond the disk capacity
vioblk_io() converted the guest-controlled sector to a byte offset and
passed it to the backend without comparing it against the disk capacity.
With a raw image on a regular file, pwritev() extends the file, so a
privileged guest could write past the configured size and exhaust the
host filesystem.
Pass the sector number to vioblk_io() as an unsigned value and defer the
conversion to a byte offset until after the bounds check. Once the full
transfer length is known, reject a start beyond capacity or a transfer
that crosses the end, then convert to off_t. The check is done in
unsigned arithmetic; the subtraction order avoids underflow and it never
multiplies the attacker-controlled sector.
From Acts1631, thanks!
ok dv@
NAS-145072 / 28.0.0-BETA.1 / Use truenas_smbhad for SMB stateful failover (#20072)
Samba now replicates SMB durable handles to the standby controller with
the truenas_smbhad daemon. This replaces the ctdb implementation.
- Remove ctdb and the clustered TDB code. passdb, group mapping, share
ACLs and secrets are local to each controller again.
- Stop setting "clustering" in smb.conf.
- Write /etc/truenas_smbhad.conf with the controller node on HA systems.
Reload the daemon when a license change modifies the file.
- Keep smbd stopped on the standby. Restart it on takeover, because it
restores handles only at startup.
- Log the daemon to /var/log/truenas_smbhad.log.
- Remove the update block for stateful failover.
- Add unit tests and HA tests.
[Darwin][TSan] Only track lock state for locks taken by instrumented code (#234732)
Some libraries take and release os_unfair_locks in a manner that is
opaque to TSan; this can result in the deadlock detector failing to free
slots (that it believes are currently held locks) and running out of
space in `all_locks_with_contexts_`, failing a CHECK condition, and
dying. Additionally it can lead to false positive reports of 'unlock of
an unlocked mutex'.
This patch conservatively prevents locking operations in noninstrumented
code from being tracked by the deadlock detector by default. It also
ignores any unlock of an os_unfair_lock without a corresponding lock
(this will assert anyway).
rdar://190667681
[SPIR-V] Lower llvm.debugtrap to NonSemantic.DebugBreak (#231354)
[SPIRV] Lower llvm.debugtrap to NonSemantic.DebugBreak
Lowers the generic `llvm.debugtrap` intrinsic to the extended
instruction `OpExtInst %void <set> DebugBreak` in the
SPIR-V backend per HLSL proposal 0039. Instead of adding
a target-specific intrinsic, this reuses the existing
`llvm.debugtrap` pipeline (`G_DEBUGTRAP` -> `selectDebugTrap`),
requiring no clang changes.
- Emits `OpExtension "SPV_KHR_non_semantic_info"` when targeting SPIR-V
< 1.6
- Falls back to `OpNop` when the extended set is unavailable, ensuring
lowering
never fails.
- Adds necessary TableGen definitions, opcode enums, and string
mappings.
[3 lines not shown]
[lldb] Remove ConstString from ObjCLanguage formatters (#239834)
These are easily replaced with llvm::StringMap and llvm::StringRef.
There are a handful of remaining uses but they are to fulfill API
requirements.
[HLSL] Add QuadAll builtin (#236932)
This PR adds the QuadAll builtin to clang, with both DXIL and SPIRV
lowering.
Fixes https://github.com/llvm/llvm-project/issues/99215
Assisted by: Github Copilot
---------
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
Copilot-Session: 365638e8-2291-4925-8f1e-1b5c23220818
[ConstraintElim] Split signed min/max across their operands when checking a compare
The existing constraint systems only record the bounds that hold for both
operands of a min/max (smax(a, b) >= a and >= b, smin(a, b) <= a and <= b). The
other direction is a disjunction, which cannot be recorded as a fact. When a
compare of signed decompositions involves a min/max result, split it into its
operands: the decomposition is monotonic in that result, so it is the max or min
of its values on each side, and the relation holds for all or for either side
respectively.
https://alive2.llvm.org/ce/z/zsGkJ-
[ConstraintElim] Prove sadd/ssub.with.overflow cannot overflow from the exact sum
Decompose the operands and show that the sum lies in the range of the type. This
handles patterns like A + (B - A), as well as sums involving signed min/max
results, which are split across their respective operands using monotonicity
(for example start + smax(end - start - 1, 0) <= end).
https://alive2.llvm.org/ce/z/ze8LCk
[ConstraintElim] A signed sum of operands with opposite signs cannot wrap
If one operand is known non-negative and the other non-positive, the signed
sum is between them, so it cannot overflow.
https://alive2.llvm.org/ce/z/ZF5Yqr