[libc] Minor fixes/additions to signal.h header. (#217469)
* Fix a typo for si_overrun field inside siginfo_t struct (it is
accessible via `si_overrun` macro, and names should match)
* Add `sig_t` type which is used in BSD for signal handler function.
It's identical to GNU's `sighandler_t`, and glibc provides both. Clarify
this in their YAML entries.
* Add more Linux-specific `SI_*` values.
[clang] Redeclarations should inherit all unique SwiftAttrs (#217187)
SwiftAttrs are inherited by redeclarations but only the first attribute
was inherited, the rest was dropped. This behavior is confusing and
inconsistent that lead to some subtle bugs consuming these annotations.
This PR makes sure every instance with a unique argument is inherited.
Co-authored-by: Gabor Horvath <gaborh at apple.com>
[LoopFusion] Do not peel guarded loops to enable fusion (#217379)
Loop fusion currently tries to peel guarded loops to expose fusion opportunity.
The logic has a bug: Once we confirm two loops have small difference in
their iteration count and are eligible for peeling, we blindly allow them to
have different guards. The problem is that in some cases, conditions of the
loop guards have nothing to do with the loop iteration count. This is more
likely to be the case when a loop has constant iteration count. At the moment
fusion allows peeling only when both loops have constant iteration counts.
[lldb][test] Unlock the mutex completely before exiting the test (#217466)
This test fails with hardened libcxx otherwise.
Fixes #212872
---------
Co-authored-by: Med Ismail Bennani <ismail at bennani.ma>
Analysis: Move LibcallLoweringInfo from CodeGen to Analysis (#210322)
Middle end passes need to be able to reason about library call
availability and potentially emit them without depending on codegen.
TargetLibraryInfo already lives in Analysis, and this is a step towards
the eventual merger. For now this is a mostly mechanical move, type
erasing the reference to TargetSubtargetInfo.
The per-subtarget customization (TargetSubtargetInfo::initLibcallLoweringInfo)
is inverted into a caller-supplied function_ref, so the Analysis types
carry no CodeGen/TargetSubtargetInfo reference. The module map is keyed on
an opaque erased pointer. CodeGen continues looking up based on the subtarget.
It is not yet in a state where it is usable from middle end passes; that
will come later. In principle we should be able to write arbitrary rules based
on a function's ABI attributes for which calls can be used.
Co-authored-by: Claude (Claude Opus 4.8) <noreply at anthropic.com>
18363 cxgbetool cudbg --collect rss panics host
Reviewed by: Robert Mustacchi <rm at fingolfin.org>
Reviewed by: Andy Fiddaman <illumos at fiddaman.net>
Reviewed by: Kyle Simpson <kyle at oxide.computer>
Approved by: Dan McDonald <danmcd at edgecast.io>
[VPlan][Predicator] Preserve some uniform control flow
Implements "Partial Control-Flow Linearization" by Simon Moll and
Sebastian Hack. Does **NOT** improve predication/masking yet, so
applicability is artificially narrowed, only some uniform branches are
preserved. In particular, the following is left for future PRs:
* Block masks still contains now-unnecessary term for the preserved
uniform branches.
* Mixed blends/phis aren't supported yet. Detecting where they would be
necessary is as complex as implementing proper support (which would
need either Luke's `reconstructSSA` or Iterated Dominance Frontier),
so we also limit it to a trivial/structured CFG where there's only
single block where those would need to be inserted.
I think even the current version might be enough to start implementing
an alternative to https://github.com/llvm/llvm-project/pull/141900 (see
BOSCC in the paper).
[clang][SYCL] Align device binary (un)registration with CUDA/HIP/OpenMP (#217173)
The SYCL offload wrapper still registers and unregisters the device
binary the way the offloading runtimes did before 421085fd740d (#86830):
a constructor and a destructor, both at priority 1. That commit moved
OpenMP/CUDA/HIP off a destructor and priority 1, and the reasons apply
to SYCL equally.
With no destructor left to emit, wrapSYCLBinaries() only ever hands back
one function, so shrink its out-parameter to a single Function *. This
also lets CodeGenModule::Release() emit the SYCL constructor next to the
CUDA one instead of ahead of registerGlobalDtorsWithAtExit(), where it
had to sit only because AddGlobalDtor() additions are dropped after that
call.
co-authored by claude
[MLIR][EmitC] Rewrite globals before moving function body (#217474)
WalkPatternRewriter only permits erasing matched operations or their
descendants. Replace get_global operations while they still belong to
the matched function before transferring its body into the new class
method.
Assisted-by: Codex
clang/AMDGPU: Stop passing redundant -target-cpu to cc1
Now that the exact target is encoded in the triple's subarch field,
-target-cpu is redundant. This avoids polluting the resultant IR with
unwanted "target-cpu" attributes. The net result is the desired codegen
when compiling libraries for a major subarch and linking it into a
program compiled for a specific arch. e.g., compiling for "gfx9-generic"
would pollute the IR with "target-cpu"="gfx9-generic", so codegen
would ultimately be performed for the generic target even after
linking into the concrete gfx9 cpu. The specialization will now be
achieved by merging the triples without the linker or optimization
passes needing to fixup function attributes.
AMDGPU: Start using subarch in attributor instead of subtarget
Avoid querying the subtarget for functions when the relevant
properties are known from the triple. The various subtarget
group size functions should also be decoupled from the subtarget,
but those are trickier to untangle.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
clang: Start using new amdgpu subarch triples
Fixup invocations using --target=amdgcn + -mcpu to introduce
the subarch in the triple.
For offload toolchains, a single toolchain is constructed for the
top level amdgpu architecture, and the effective triple is used for
target specific tool invocations.
The specifics of the resource directory layout are tbd. This does
try to find resources in the subarch named directory. The paths
are searched at toolchain creation time, so that does not work
when there are multiple subarches.
Fixes #154925
[CIR] Mark bit-field access units as their own member kinds (#216864)
A bit-field access unit is only as wide as the compiler needs it to be,
which can be narrower than the type the bit-fields were declared with.
Nothing in the record type says so. The unit just gets `data`, or
`empty` when none of its bit-fields are named, and an ordinary field
gets those same marks.
That makes `struct { long long x : 32; }` and `struct { unsigned x; }`
look identical here. Classic CodeGen tells them apart and coerces the
first to `i64`, the second to `i32`. It reads the declared type, where
the bit-field still leaves user data past bit 32.
The fix is to give a unit its own marks, `bitfield` and
`empty_bitfield`. Nothing reads them yet, and no record's emptiness
answer changes. The next PR records a zero-width bit-field, which the
marks miss too, and pad-aware classification can then use both.
Assisted-by: Cursor / claude-opus-5
Update to miniflux-2.3.3
While there, update with miniflux.rc with:
- By default miniflux logs to standard error, so setting the daemon
output will hook it up with syslogd out of the box.
- Service now supports reloading. It's only for reloading TLS
certificates, not log files. If you wish to do anything extra with
your log files, you'll have to do it with syslogd by setting the
logging back to default as mentioned in the previous paragraph.
From Igor Zornik (maintainer)
[CIR] Move LoweringPrepare before callconv lowering (#216498)
Complex division returns a wrong imaginary part. CIR declares `__divsc3`
as returning `{ float, float }` where classic CodeGen coerces the return
to `<2 x float>`, so the caller reads the two halves out of two
registers while the callee packs both into one. Dividing 3+4i by 1+2i
gives 2.2 and 4.0 instead of 2.2 and -0.4, with no diagnostic. The
helper call is synthesized by LoweringPrepare, which runs after the
calling-convention pass, so it is never classified.
Moving LoweringPrepare before CallConvLowering lets the classifier see
everything the pass emits rather than complex alone. Complex mul and div
are the only calls it synthesizes today that need coercion, but anything
emitted there later is lowered properly too.
Assisted-by: Cursor / claude-opus-5