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]
[clang-tidy] Fix clang-tidy-diff with not producing blank lines (#213873)
clang-tidy-diff.py unconditionally wrote `stdout + "\n"` for every file
it processed, even when clang-tidy produced no output so this bloated
output with needless blank line (happened with `-quiet` flag enabled
which made tidy produce 0 diagnostics).
[SPIRV][HLSL] Fix Vulkan-invalid SPIR-V for Interlocked* on groupshared/UAV memory (#212663)
Compiling HLSL `InterlockedOr`/`InterlockedAdd`/`InterlockedXor` against
`groupshared` (or UAV) destinations through the clang HLSL -> SPIR-V
path produced SPIR-V that `spirv-val` rejects for Vulkan.
Illegal OpCapability Linkage: groupshared variables are emitted
as `external hidden addrspace(3)` (Workgroup)
declarations. `getSpirvLinkageTypeFor` gave any non-interface
declaration `Import` linkage, which adds a
`LinkageAttributes` decoration and forces `OpCapability` Linkage, which
is illegal in a Vulkan shader.
Fix: in a shader environment (no linker), Workgroup/Private declarations
get no linkage.
Fixes: https://github.com/llvm/offload-test-suite/issues/1404
Assisted by: Github Copilot
[flang] Add an example plugin exercising the HLFIR pipeline extension points
The HLFIR extension points, the config augmentor registry and fir-opt's symbol
export exist to let an out-of-tree MLIR pass run while the HLFIR intrinsic
operations (hlfir.sum, hlfir.matmul, ...) are still present. None of that was
covered end to end, and there was no worked example of how to use it.
Add flang/examples/HLFIRPipelinePlugin, modelled on PrintFlangFunctionNames. It
contributes a pass that prints the HLFIR operations still present in the
module, tagged with the pipeline position it was inserted at, and exposes it
through both plugin entry points: a static initializer calling
fir::registerPassPipelineConfigCallback for the `flang -fc1 -load` path, and
mlirGetPassPluginInfo so fir-opt can load it with --load-pass-plugin.
Nothing is linked into the shared object: MLIR, FIR and flang symbols resolve
against the host tool, which is what export_executable_symbols_for_plugins on
flang and fir-opt provides. Removing the fir-opt export drops it from ~105k
exported dynamic symbols to one and makes --load-pass-plugin fail to load.
[7 lines not shown]
[flang] Add a pass-pipeline config-augmentor hook for -load'ed plugins
The HLFIR-to-FIR pass pipeline exposes extension points on
MLIRToLLVMPassPipelineConfig, but that config is built inside the frontend, so
a -load'ed plugin has no way to reach it and register passes.
registerDefaultInlinerPass is the only augmentor today, and it is wired in by
hand.
Add a global registry of config augmentors:
* fir::registerPassPipelineConfigCallback(cb) appends a callback, to be
called from a plugin's static initializer at -load time.
* fir::invokePassPipelineConfigCallbacks(config) runs them on the config.
This mirrors what flang already does for -load'ed plugin actions via
FrontendPluginRegistry: a process-global, append-only registry populated from
static initializers, which run before any compilation begins.
Both code generation entry points invoke the callbacks after building their
[11 lines not shown]
[flang] Add HLFIR-to-FIR pass pipeline extension points
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
methods are const so they can be called on the const config the HLFIR pipeline
receives. With no callbacks registered the pipeline is unchanged.
Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>
[os-cloudflared] Correct UI token entry text field validation mask (#5598)
* Correct UI text field validation mask to include equal signs which are standardly present in Cloudflare tunnel tokens
* Bump cloudflared Makefile version from 1.1 to 1.2.
* Apply suggestion from @Monviech
---------
Co-authored-by: Monviech <79600909+Monviech at users.noreply.github.com>
doc: Document the steps to import and upgrade GCC
This is partially based on a README created by Scott Parlane (sparlane).
Credit: Scott Parlane (sparlane)
[mlir][gpu][spirv] Convert memref<mma_matrix> to spv.array<coopmatrix> (#212806)
In a gpu.func, allow allocating local arrays of gpu.mma_matrix, e.g.
`memref.alloca() : memref<Nx!gpu.mma_matrix<HxW, ...>`. Extend the SPIRV
conversion to convert such memrefs to `%ARR = spirv.Variable:
spv.ptr<spv.array<N x coopmatrix>, Function>`, which can be conveniently
indexed with `spirv.AccessChain %ARR[i]`. This enables arrays of CoopMMA
matrices both at the `gpu` and `spirv` levels.
Signed-off-by: Fabrizio Indirli <fabrizio.indirli at arm.com>