Add batch port validation endpoint `port.validate_ports`
This commit adds a new `port.validate_ports` endpoint that validates
multiple port/bindip combinations in a single call. Currently the apps
library calls `port.validate_port` once per port, each of which
internally queries all registered port delegates via `ports_mapping()`.
For apps with many ports (e.g. SeaweedFS with 15), this results in
redundant repeated work.
The new endpoint accepts a list of `{"port": int, "bindip": str}` dicts
and calls `ports_mapping()` only once for the entire batch. It supports
two modes:
- `raise_error=True`: raises a single `ValidationErrors` with all
conflicts (same pattern as the existing endpoint)
- `raise_error=False`: returns a JSON-serializable list of
`(attribute, errmsg, errno)` tuples
The existing `validate_port` endpoint is refactored to share a
`_validate_single_port` helper but its inputs, outputs, and behavior
are unchanged.
[SLP] Initial support for ordered reductions
Patch models ordered reductions as a series of extractelements for the
cases which cannot be modeled as unordered reductions.
Fixes #50590
Reviewers: RKSimon, hiraditya
Pull Request: https://github.com/llvm/llvm-project/pull/182644
[AArch64][llvm] Separate TLBI-only feature gating from TLBIP aliases
Refactor the TLBI system operand definitions so that TLBI and TLBIP
records are emitted through separate helper multiclasses, whilst keeping
the table layout readable.
The feature-scoped wrappers now apply FeatureTLB_RMI, FeatureRME, and
FeatureTLBIW only to TLBI records (it was previously incorrectly also
applied to TLBIP instructions), while TLBIP aliases remain gated only
by FeatureD128, including their nXS forms.
Update testcases accordingly.
[AArch64][llvm] Rewrite the TLBI multiclass to be much clearer (NFC)
The `tlbi` multiclass is really doing four jobs at once: base TLBI,
synthesized nXS, optional TLBIP, and synthesized TLBIP nXS. Also,
`needsreg` and `optreg` are really just a 3-state operand policy in
disguise. Likewise, the PLBI multiclass has this same issue.
Change `needsreg` and `optreg` into a combined fake enum, so it's
clearer whether the instruction takes no register operand, a required
register operand or an optional register operand.
This improves on my original change 66e8270e8.
[mlir][acc] Use index for acc.par_width results (#187734)
When acc.par_width was introduced in
https://github.com/llvm/llvm-project/pull/184864
there was a discussion on whether to use index or create a new type for
the output of the operation. It was decided to create a new type; but
this means that launch arguments cannot be used directly in the region
such as for loop bounds without a conversion from the new type to index.
In order to avoid the casting operations (and introduction of an actual
operation to do this cast), simply restore acc.par_width to generate
index type. This allows its result to be directly used in
acc.compute_region.
[lldb] Update the calling convention of BytecodeSyntheticChildren::Update (#182155)
This changes the inputs to `update`. It's now the data stack that was
the result of `@init`. This makes `update` more predictable, as its
inputs are the same between the first call and the Nth call.
[lldb][bytecode] Document invocation in compiler output (#187547)
Document compiler invocation in the compiler output, to aide subsequent
regeneration.
[flang][OpenACC] Fix reduction init value for minnumf/minimumf/maxnumf/maximumf (#187647)
The reduction recipe init region was producing 0.0 instead of the
correct identity value (largest representable float for min, smallest
for max) when the reduction operator was AccMinnumf, AccMinimumf,
AccMaxnumf, or AccMaximumf. Only AccMin and AccMax were handled,
causing the new operator variants to fall through to the else branch
which returns 0.
This caused min reductions to always produce 0.0 since
min(x, 0.0) = 0.0 for all positive x.
Replace the duplicated identity value logic with
arith::getIdentityValue, using a mapping from acc::ReductionOperator
to arith::AtomicRMWKind. Use minimumf/maximumf (which respect
useOnlyFiniteValue) instead of minnumf/maxnumf (whose MLIR identity
is NaN) to get correct finite identity values.
This also fixes a pre-existing bug where the max reduction identity
for floats used getSmallest (smallest subnormal, -1.4e-45) instead
of getLargest with negative (-3.4e+38).
[FIRToMemRef] copy ACC Variable Name attribute (#187724)
When converting from fir.alloca to memref.alloca, also copy the acc
variable name attribute if it exists
[IR][NFC] Fix MSVC deprecation warnings about BranchInst (#187702)
MSVC apparently also warns about deprecation at the implementation
of deprecated functions...
Pull Request: https://github.com/llvm/llvm-project/pull/187702
Add batch port validation endpoint `port.validate_ports`
This commit adds a new `port.validate_ports` endpoint that validates
multiple port/bindip combinations in a single call. Currently the apps
library calls `port.validate_port` once per port, each of which
internally queries all registered port delegates via `ports_mapping()`.
For apps with many ports (e.g. SeaweedFS with 15), this results in
redundant repeated work.
The new endpoint accepts a list of `{"port": int, "bindip": str}` dicts
and calls `ports_mapping()` only once for the entire batch. It supports
two modes:
- `raise_error=True`: raises a single `ValidationErrors` with all
conflicts (same pattern as the existing endpoint)
- `raise_error=False`: returns a JSON-serializable list of
`(attribute, errmsg, errno)` tuples
The existing `validate_port` endpoint is refactored to share a
`_validate_single_port` helper but its inputs, outputs, and behavior
are unchanged.
[flang] Implement SPLIT intrinsic subroutine with tests (#185584)
This is the implementation of part of F2023 new feature US 03.
Extracting tokens from a string, SPLIT intrinsic.
It's section 16.9.196 SPLIT (STRING, SET, POS [, BACK]) of Fortran 2023
Standard.
It's part of Flang issue
[#178044](https://github.com/llvm/llvm-project/issues/178044). Note that
I work with @kwyatt-ext on this issue. He implemented the other part,
TOKENIZE.
A test will be added into
[llvm-test-suite](https://github.com/llvm/llvm-test-suite) later after
this PR is merged.
[GlobalISel] Add G_ABDU and G_ABDS to computeKnownBits. (#186822)
This code is adapted from `SelectionDAG::computeKnownBits`
part of #150515
ticks off ABDS & ABDU
[clang][ssaf] Consolidate tools and shared utilities under `clang/tools/clang-ssaf/`
This patch extracts the shared code between `clang-ssaf-format` and
`clang-ssaf-linker` into a new
`clangScalableStaticAnalysisFrameworkTool` library at
`clang/lib/ScalableStaticAnalysisFramework/Tool/`, with the public
header at
`clang/include/clang/ScalableStaticAnalysisFramework/Tool/Utils.h`. This
shared library provides:
- `fail()` overloads for fatal error reporting
- `initTool()` — sets the tool name and version, configures the version
printer, hides unrelated command-line options, and parses arguments
- `getToolName()` — accessor for the tool name set by `initTool()`
- `loadPlugins()` — loads plugin shared libraries from a list of paths
- `getFormatForExtension()` — cached format-registry lookup
- `SummaryFile` — resolves a file path to its serialization format
- `ErrorMessages` — shared diagnostic string constants
Tool-specific error strings remain in a `LocalErrorMessages` namespace
[3 lines not shown]
[ASan] Fix missed poisoned suffix in first granule in __asan_region_is_poisoned (#187466)
Align beg address down instead of up in __asan_region_is_poisoned(), so
the shadow scan includes the first granule. This fixes a false negative
when first granule has an unpoisoned prefix and poisoned suffix.
Add test that covers this scenario.