[LV] Make greater use of ScalarEvolution in addDiffRuntimeChecks (#213668)
When the loop vectoriser calls addDiffRuntimeChecks it goes to a lot of
effort to avoid generating multiple copies of the VF calculation by
caching the first instance. However, now that ScalarEvolution has a
getElementCount function we can simplify this code significantly,
especially since SCEVs are also implicitly cached. Make greater use of
SCEVs for computation also has the side-effect of improving code quality
in the memory check blocks, which is important when estimating costs of
these checks. You can see this in some tests like
LoopVectorize/AArch64/sve-runtime-check-size-based-threshold.ll
where the threshold for entering the loop has been relaxed.
Ideally, all computation in addDiffRuntimeChecks should be done using
SCEV because there are presumably other folds that can be applied to the
comparisons. However, I'd keep things simple in this PR and deal with
that in a follow-on PR.
syslogd: Fix buffering of partial klog lines
When a /dev/klog read ends without a newline, the remaining data
is buffered for the next read. The code mistakenly copied the data
into linebuf instead of klog_linebuf, breaking reconstruction of
split log messages.
Found and fixed by nonaka@ and Kenichi Suzuki at IIJ.
Interfaces: Virtual IPs: Settings - make sure validations are triggered when no subnet is specified and prevent adding todo entries in that case, closes https://github.com/opnsense/core/pull/10302
[SPIR-V] Preserve sign and payload when printing NaN as hex float (#212438)
NaN was always printed as the canonical `0x1.8p+<MaxExp>`, silently
dropping the sign bit and any signaling/payload bits
Discussed in https://github.com/llvm/llvm-project/pull/212295
www/{nginx,nginx-devel,freenginx}: 3rd-pary modules managemeht
Fix build and loading of the 3rd party gridfs module after the
devel/mongo-c-driver 2.x update.
The module config now obtains include and linker flags from
pkg-config instead of deriving them from the ports tree's
DISTVERSION. The previous approach ran a recursive make into
devel/mongo-c-driver on every make invocation, even with GRIDFS
unset, and derived the libbson include path from the mongo-c-driver
version although devel/libbson is a separate port with its own
DISTVERSION. Both directories happen to carry the same version
today, so the mismatch was not visible yet.
While here, add the missing assert.h include. The module calls
assert() without declaring it, which left an unresolvable symbol
"assert" in the shared object -- libc only exports __assert. Since
nginx dlopen()s modules with RTLD_NOW, load_module refused to load
the module at runtime.
[5 lines not shown]
Reporting: Traffic - make traffic_top.py robust to malformed iftop lines (#10575)
traffic_top.py parses every iftop line containing "=>"/"<=" as a full host
row. Under load (e.g. the Diagnostics/Reporting Traffic page polled by
several tabs at once, each invocation spawning one iftop per interface via
ThreadPoolExecutor) iftop can emit malformed output, and the parser aborts,
failing the "interface show top" configd action with exit status 1. Two
distinct crashes were observed:
- truncated rows with fewer columns -> IndexError on parts[2]/parts[5]
- non-host output that still contains "=>"/"<=" (e.g. a mangled footer
line) -> parts[0] is not an address, so ipaddress.ip_address() raises
ValueError, which the surrounding "except subprocess.TimeoutExpired"
does not catch
Require the expected column count and validate parts[0] as an IP before
using the row; skip anything else. Also guard the leading-index pop()
against an empty split, and drop the incorrect TimeoutExpired handler now
that the address is validated up front.
[MLIR][SCCP] Fix in-place folds leaking into IR during simulation (#213933)
SparseConstantPropagation restored the operation only when `fold` did
not return any fold results. But a folder can mutate the op in place and
still return out-of-place results or fail, e.g. `vector.extract` folds
constant dynamic positions into static ones before attempting further
folds.
The constants fed to `fold` are speculative lattice values, so the
mutation bakes a possibly-wrong constant into the IR. SCCP would
permanently replace a loop-carried dynamic index with its first lattice
value for example.
Fix: Restore the original operands and attributes after every fold call,
regardless of its outcome.
Co-authored-by: Claude Fable 5 <noreply at anthropic.com>
[flang] Add HLFIR-to-FIR pass pipeline extension points (#212194)
The FIR optimizer extension points (FIROptEarly, FIRInliner, FIROptLast)
all
run after HLFIR has been lowered to FIR, so the HLFIR intrinsic
operations
(hlfir.sum, hlfir.matmul, ...) are gone by the time they run.
Transformations
that need to see those operations have nowhere to attach.
Add two extension points to createHLFIRToFIRPassPipeline:
* HLFIROptEarly, at the start of the pipeline, before any HLFIR
simplification or inlining.
* HLFIROptLast, just before createLowerHLFIRIntrinsics.
Drivers register passes through registerHLFIROptEarlyEPCallbacks and
registerHLFIROptLastEPCallbacks on MLIRToLLVMPassPipelineConfig. The
invoke
[4 lines not shown]
[flang] Add a pass-pipeline config callback hook for plugins
The HLFIR-to-FIR pipeline extension points live on MLIRToLLVMPassPipelineConfig,
which the frontend builds as a local of CodeGenAction, out of reach of a plugin.
Add a process-global registry of callbacks that run on the config before the
pipeline is built. A plugin registers one from a static initializer, so it is in
place before any compilation begins, as FrontendPluginRegistry does for plugin
actions. Both code generation entry points invoke the callbacks, lowerHLFIRToFIR
for -emit-fir and generateLLVMIR for -emit-llvm/-emit-obj, and are mutually
exclusive for a given compilation, so a plugin sees the same behaviour whichever
output was asked for.
Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>
[lldb] Clear stale error in Target::ReadMemory on file-cache fallback (#213451)
Load the checked-in core `linux-aarch64-pac.core` from
`lldb/test/API/functionalities/postmortem/elf-core/` with its binary and ask for
a `char16_t *` summary at the start of `.text`:
```
(lldb) settings set target.max-string-summary-length 8
(lldb) expression -l c++ -- (char16_t *)0x400140
(char16_t *) $0 = 0x0000000000400140 unable to read data
(lldb) memory read -s1 -c16 0x400140
0x00400140: 3f 23 03 d5 ff 83 00 d1 fd 7b 01 a9 fd 43 00 91 ?#.......{...C..
```
`memory read` prints the very bytes the summary just claimed it could not read.
Both go through `Target::ReadMemory()`, which reuses a single `Status &error` for
the process read and for the file-cache fallback at the end of the function, and
`Target::ReadMemoryFromFileCache()` only ever sets that `Status`, it never clears
it. So when the process read fails outright and the fallback then satisfies the
[37 lines not shown]