[flang] Do not branch to a FORMAT statement from an assigned GO TO (#217220)
Label analysis already classifies which labeled statements may be named
by a statement that branches. Record the positions of those statements
in the semantics context and consult it when lowering records the
targets of an assigned GO TO, so that a FORMAT statement is not given a
target block.
A GO TO whose variable holds only a format label now reaches the
run-time error instead of branching into the FORMAT statement.
Co-Authored-By: Claude
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
www/immich: Fix the built-in database backup
immich looks for pg_dump in a path that does not exist, and the port did not
depend on a PostgreSQL client at all. The nightly backup job therefore failed
with ENOENT on every installation while the web interface reported the feature
as enabled. The version range follows the check in the service itself,
PostgreSQL 14 to 18.
Sponsored by: Netzkommune GmbH
[AMDGPU] Combine redundant ballot intrinsic calls
Suppose there is a loop where there is a call to @llvm.amdgcn.ballot,
which maps to an instruction involving the exec mask as an operand. This
instruction duplicates if the loop is unrolled. With a higher number of
unrolled iterations, the code bloats with such redundant instructions
with $exec as there is no middle-end/backend pass which could combine
such instructions in a uniform CFG.
This patch introduces a transform in AMDGPUUniformIntrinsicCombine to
combine redundant calls to @llvm.amdgcn.ballot, to mitigate this issue.
The approach is to walk over the dominator tree and collect all calls to
@llvm.amdgcn.ballot. Map the result type and condition to the calls, to
avoid combining calls of different kinds. Calls A and B can be combined
into A iff:
- A and B are identical
- A dominates B
- all paths from A to B are uniform and exec-invariant.
[2 lines not shown]
[Sema] [Modules] Remove unrelated module partitions from suggestion list (#187657)
This PR removes module partitions that don't belong to the current
file's module from the list of suggested module imports in the code
completion, so that it contains only primary modules or partitions
directly relevant to the declared primary module.
Partially addresses clangd/clangd#2622.
[C++20] [Modules] Merge lambda where the merge definition data is merged before the primary one (#218574)
Close https://github.com/llvm/llvm-project/issues/217858
The crash triggers on the assertion:
```C++
assert(!DD.IsLambda && !MergeDD.IsLambda && "faked up lambda definition?");
```
where DD.IsLambda is false and MergeDD.IsLambda is true. This is kinda
surprising. But this turns out to be real for the example.
```C++
export template <class Callback> auto make_closure(Callback &cb) {
return [&cb](auto &arg) noexcept(noexcept(cb(arg))) { cb(arg); };
}
export template <class Callback, class Arg>
void for_each(Callback &&cb, Arg &arg)
[14 lines not shown]
[BOLT][RISCV] Keep the link register when rewriting a call (#218408)
FixRISCVCallsPass rewrites an auipc/jalr call pair into a PseudoCALL,
which always links through ra. That is wrong for the machine outliner:
it calls an outlined function with "call t0, func" and the callee
returns with "jr t0", so after the rewrite the callee returns to
whatever t0 happens to hold.
Read the link register off the instruction being replaced and emit a
PseudoCALLReg with it whenever it is not ra.
Assisted-by: Opus.
dpaa: Split FMan port driver into distinct TX/RX
There are several port functions that are only for one type or the
other, so they don't make sense to be together. Splitting these up also
simplifies adding support for the Offline/Host Command ports.
[mlir][linalg] Split elementwise ops with concat inputs (#213630)
Close https://github.com/llvm/llvm-project/issues/213216
This patch tries to reorder patterns like elementwise(concat(x0, x1),
concat(y0, y1)) into concat(elementwise(x0, y0), elementwise(x1, y1)).
The transformation itself is not an optimization. But it will make the
elementwise op to be closer with the data so that the optimizer may find
more optimization oppotunities. See the above patch for an example.
For simplicity, this patch only handle cases for all concats have the
same number of inputs and the size of inputs in the concat dimension to
be the same. We also don't handle linalg.index. And if the inputs of the
elementwise op has other inputs than concat, which is not a scalar, may
be rejected too. We can relax these limitations in the future.
To make the implementation more uniform, we only handles elementwise
like linalg.generic. The elementwise op will be transoformed into
linalg.generic after -convert-elementwise-to-linalg. So the
[7 lines not shown]
[DWARFLinker] Walk each shared subtree's dependencies once (#218072)
cdc31cfa66f0 made every root that references an already-marked subtree
re-walk that subtree to record the completeness dependencies it
contributes, which is what makes the recorded dependency set complete
and independent of thread interleaving. That walk replaced the
isAlreadyMarked short-circuit which had kept marking linear, so a widely
shared subtree is re-parsed and re-resolved once per referencing root.
Linking a RelWithDebInfo clang went from 27s to 67s of wall time and
from 242s to 1447s of CPU, peak memory grew from 35GB to 63GB, and 7.0
billion dependencies were recorded for an unchanged dSYM.
Record only that a root carries the subtree's dependencies and walk each
distinct subtree once. All of a subtree's dependencies demote the same
root, so the expansion stops at the first one that does.
A subtree contributes two kinds of dependency. One kind is recorded
under the root referencing the subtree, varies with that root, and is
[22 lines not shown]
[Clang] Fix -Wunused-parameter for implicit coroutine uses (#217518)
Clang's coroutine semantic analysis builds references to coroutine
parameters
while looking up a class-specific allocation function. When overload
resolution
falls back to a size-only `operator new`, these speculative references
currently
suppress `-Wunused-parameter`.
Preserve each parameter's referenced state while collecting placement
arguments, then mark the parameters referenced only when those arguments
are
included in the selected allocation call. Keep this distinction when
placement
arguments are replaced by `std::nothrow`.
Apply the same rule to promise initialization: when initialization using
the
[14 lines not shown]
[mlir] [vector] try promoting scalar when reordering broadcast/elementwise (#212180)
Inspired by https://github.com/llvm/llvm-project/pull/211208
The thread discussed the case:
```
%0 = vector.broadcast %arg0 : vector<4xf32> to vector<3x4xf32>
%1 = vector.broadcast %arg1 : f32 to vector<3x4xf32>
%2 = vector.broadcast %arg2 : vector<4xf32> to vector<3x4xf32>
%3 = vector.fma %0, %1, %2 : vector<3x4xf32>
```
The reviewer suggests "broadcasts on %arg0 and %arg2 are removed but
%arg1 is broadcasted to <4xf32>. Then FMA would happen on <4xf32>,
%followed by the broadcast to <3x4xf32>". Now this is solved and we can
see the test case at @fma_mixed_scalar_and_vector_broadcast_source in
the attached test case.
AI assisted.