[SPIRV] Fix compile abort on a switch case value shared with a module constant (#223548)
This fixes a failure I found when compiling shaders whose switch case
value is also emitted as a module constant. LLVM currently aborts with
```
Assertion `isCImm() && "Wrong MachineOperand accessor"' failed.
```
in `MachineOperand::getCImm`. Three shaders in
[BigWheels](https://github.com/google/bigwheels) and
[Vulkan-Samples](https://github.com/KhronosGroup/Vulkan-Samples) run
into this.
A case operand is a `G_CONSTANT` until the module emits a SPIR-V
constant for the same value, at which point the case register is
replaced with that constant. Both forms have to decode to the case
value, and only `G_CONSTANT` did. The other holds the type in operand 1,
which was read as a `ConstantInt`.
[11 lines not shown]
[MLIR] Drain remarks in RemarkEmittingPolicyFinal::finalize() (#224607)
`RemarkEmittingPolicyFinal::finalize()` iterates `postponedRemarks`
without clearing it. `MlirOptMain` calls `finalize()` after printing the
module, and `~RemarkEngine` calls it again when the context is
destroyed, so a YAML or bitstream streamer serializes every remark
twice. With `mlir/test/Pass/remark-final.mlir` the YAML output file
holds 10 records for 5 remarks. The console path hides this because the
diagnostic handler is already gone when the destructor runs.
This change swaps the pending set into a local before emitting. A second
`finalize()` then emits only the remarks reported since the first one. A
consequence worth stating: a `RelatedTo` link resolves only between
remarks drained by the same call. Both behaviours are documented in the
header comment and in `Remarks.md`.
A follow-up will make the emission order of the final policy
deterministic; today it is `DenseSet` iteration order, which is why the
lit test keeps `CHECK-DAG`.
[2 lines not shown]
[LLVM][DAGCombiner] Relax requirements for "min(a,b)-max(a,b) -> -abd(a,b)". (#223725)
The combine "max(a,b)-min(a,b) -> abd(a,b)" has no legality check prior
to legalisation, but the matching "min(a,b)-max(a,b) -> -abd(a,b)"
combine does. This seems inconsistent and removing it does not look to
have any downsides.
[MCJIT] Add dependencies on TargetParser and MC. (#224610)
https://github.com/llvm/llvm-project/pull/224547 added dependencies on
the TargetParser and MC libraries. Update CMakeLists to include the
dependencies, which should fix the link failures caused by PR224547.
[FlattenCFG] Merge parallel conditions with logical and/or (#218441)
`FlattenParallelAndOr` merges a short-circuit branch pair into one
branch using a bitwise `or`/`and`. Those propagate poison from either
operand, so a condition the source only evaluated behind a guard ends up
feeding an unconditional branch. Emit a logical or/and instead.
`MergeIfRegion` is left alone: `GetIfCondition` only matches when the
second condition already executes on every path, so a poison operand
there is UB before the transform too.
The merged weights compose, but the branch's !prof has the same
staleness problem and longer chains need the product carried through, so
the select is marked explicitly unknown here and the derivation is a
follow-up.
AMDGPU is the only in-tree user. `scalar-branch-missing-and-exec.ll` was
relying on flatten-cfg to build its and-chain, and the select chain
lowers to `s_and_b64 s[0:1], s[0:1], exec` rather than the `s_xor_b64`
[5 lines not shown]
NAS-143927 / 27.0.0-BETA.1 / Check etc files syntax and imports in CI and on build (#19804)
https://github.com/truenas/middleware/pull/19801 would've been caught by
this check (instead, it is just logged to middleware log on runtime)
Also, legacy APIs are not imported by middleware, so any import-time
error there will only be detected when it crashes middleware on attempt
to access that API.
[MLIR][Remark] Emit final-policy remarks in deterministic order
RemarkEmittingPolicyFinal stores remarks in a DenseSet keyed on the
location pointer, so the output order depends on heap layout and changes
between runs. Twenty runs of mlir/test/Pass/remark-final.mlir gave
fourteen different orders, which is why the test uses CHECK-DAG.
Store remarks in a MapVector keyed by a new RemarkIdentity: location,
remark name, combined category name and kind, the same fields the
DenseSet compared. A repeated identity overwrites the stored remark in
place, so a remark is printed where its identity was first reported with
the content it last had. Root remarks come out in first-report order and
linked children still follow their parent. DenseMapInfo<Remark> is
removed; RemarkIdentity is now the one place that says what the final
policy treats as the same remark.
Behaviour change: order only. The identity is unchanged.
remark-final.mlir switches to ordered CHECK lines. New unit tests cover
[5 lines not shown]
Mk/bsd.port.mk: Drop the strip parameter from PATCHFILES passed to do-fetch.sh
After recent changes to handling of do-fetch.sh in bsd.port.mk, the
strip parameters (e.g., ":-p1") are no longer dropped before do-fetch.sh
receives patch files.
As a result, a strip parameter of a patch file might be interpreted as a
group instead and get prepended to the patch file, resulting in warnings
like:
```
$ make makesum
===> License MIT accepted by the user
=> e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch doesn't seem to exist in /var/cache/distfiles.
=> Attempting to fetch p1e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch
fetch: p1e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch: No such file or directory
```
Reviewed by: mat
[4 lines not shown]
[clang][Sema][Tests] Add test coverage for function-like macro diagnostic edge cases and C++ (#223895)
Add C++ and edge-case test coverage for function-like macro diagnostic
Follow-up to #123495.
Adds regression tests covering cases not exercised by the original PR:
- Macro call with intervening comment/whitespace before '(', confirms
findNextToken correctly skips these rather than misfiring
- Macro call with '(' across a line break
- Re-#define after #undef, confirms no stale state
- Array-size context (non-assignment expression)
- Variadic function-like macro
- New SemaCXX test confirming the diagnostic fires correctly in C++,
since the implementation lives in shared SemaExpr.cpp
No behavior change, test coverage only.
[Support] Correct UTF-8 error handling in ConvertEBCDIC (#185176)
`ConverterEBCDIC::convertToEBCDIC()` previously decoded only ASCII and
UTF-8 sequences beginning with `C2` or `C3`. Consequently, an incomplete
three- or four-byte sequence was reported as
`std::errc::illegal_byte_sequence`, even though the `TextEncoding`
contract uses `std::errc::invalid_argument` for incomplete input.
Decode each UTF-8 sequence using LLVM's shared `convertUTF8Sequence()`
utility before checking whether the decoded code point is supported by
the EBCDIC-1047 conversion table.
The resulting error handling is:
- Incomplete prefixes that can still form valid UTF-8 return
`std::errc::invalid_argument`.
- Malformed UTF-8 returns `std::errc::illegal_byte_sequence`.
- Valid UTF-8 code points outside U+0000 through U+00FF return
`std::errc::illegal_byte_sequence`.
[11 lines not shown]
hn: Refresh VF RSS configuration after link recovery
A VF can finish initialization or reset recovery after hn's handoff-time
RSS query returned ENXIO. In that case hn suppresses synthetic receive
hash metadata, but previously left it disabled even after the VF could
answer the queries again.
Queue an RSS refresh on a VF link-up notification, using the existing VF
worker in both transparent and non-transparent modes. Revalidate the
association, active VF path, administrative state, and carrier under
hn_lock before querying and reconfiguring synthetic RSS. Coalesce the
requests with an atomic flag and retain a request while capability
forwarding temporarily excludes the worker. Keep the existing query
validity checks and unsupported-query fallback unchanged.
This is a one-shot refresh, not a readiness poll. Recovery without a
link-up notification, or a query that still fails during the refresh,
does not trigger another retry by itself. A later link-up or normal
handoff can query again. Consuming the request while the VF path is
[17 lines not shown]
hn: Refresh VF RSS configuration after link recovery
A VF can finish initialization or reset recovery after hn's handoff-time
RSS query returned ENXIO. In that case hn suppresses synthetic receive
hash metadata, but previously left it disabled even after the VF could
answer the queries again.
Queue an RSS refresh on a VF link-up notification, using the existing VF
worker in both transparent and non-transparent modes. Revalidate the
association, active VF path, administrative state, and carrier under
hn_lock before querying and reconfiguring synthetic RSS. Coalesce the
requests with an atomic flag and retain a request while capability
forwarding temporarily excludes the worker. Keep the existing query
validity checks and unsupported-query fallback unchanged.
This is a one-shot refresh, not a readiness poll. Recovery without a
link-up notification, or a query that still fails during the refresh,
does not trigger another retry by itself. A later link-up or normal
handoff can query again. Consuming the request while the VF path is
[17 lines not shown]