libc/time/localtime.c - fix bad tm_wday calc from TZ=<tzstring>
Simplified version of a patch supplied on the tz list, apparently
from FreeBSD, to correct overflow problems introduced by other
recent changes to the way the values are computed.
When using a TZ setting like TZ=UTC0UTC (where specifying the DST
abbreviation is important), and when time_t is 64 bits, the value
calculated for the tm_wday field of struct tm would underflow, and
be truncated when assigned to that int var, before it was reduced
modulo 7 (days/week) - the 64->32 bit truncation modified the
value incorrectly.
[SPIRV] Do not emit generic mIR after lowering (#245051)
As part of the target specific lowering finalisation steps we sometimes
might create a new type, for bitcasting. A consequence of this is that
for certain cases (e.g. for an array) we currently emit generic MIR
(e.g. a G_CONSTANT for the array size). This is invalid, as at this
point lowering is assumed to have completed, and thus no generic
constructs should be left. This change addresses that issue by setting
`EmitIR` to `false` where relevant - this required extending the
existing pointer creation interface. In the long run we want to move
these steps to pre-lowering (as an ominous pre-existing `TODO` states).
[Mips] Honor -mips-compact-branches=never for calls on R6 (#245145)
Since #241162 direct calls and tail calls on MIPS32/64 R6 always use
BALC/BC, even with -mips-compact-branches=never (clang
-mcompact-branches=never). Select JAL/TAILCALL on R6 when compact
branches are disabled.
Also:
- Restore the jal tests in MC/Mips/mips{32,64}r6/valid.s. jal is still
valid on R6.
- Restore the jal R6 coverage in lld mips-npic-call-pic.s and
mips-plt-r6.s, and add the balc case as an extra run instead.
- Add hasExtraSrcRegAllocReq to TAILCALL_R6 like the other tail call
pseudos.
- Drop the 64-bit JAL texternalsym pattern, which the generic iPTR
pattern now covers.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[CIR] Implement CIR va_arg lowering for AArch64 (#244729)
This change adds an AArch64-specific rewrite context subclass to handle
va_arg lowering.
AArch64 Windows and Darwin targets, which both require special handling,
are not yet implemented.
Assisted-by: Cursor / claude-opus-5.5
[CIR] Add an explicit mfp8 type (#245394)
Previously, CIR was mapping __mfp8 values as signed 8-bit integers. This
is a slight divergence from classic codegen, which maps them as <1 x
i8>. More importantly, we will need to identify __mfp8 values during
calling convention lowering to handle them correctly.
This change introduces a new type to explicitly represent __mfp8 as an
opaque floating-point type. I am introducing a CIR_OpaqueFloatType base
class because I think this will also be useful when we eventually add
support for RISC-V's vectors of opaque floats.
Assisted-by: Cursor / claude-opus-5.5
[X86] Fix `preserve_none` argument lowering for i1/i8/i16/i128, pointer, nest, varargs, etc (#241588)
All of these could lead to subtle miscompiles:
https://cpp.compiler-explorer.com/z/b7GWo9WaM
The issue is that after `preserve_none` in `X86CallingConv.td` matched
i32 and i64 register arguments, it then delegated to the C calling
convention without applying the preliminary argument rules from that
calling convention:
- Lack of promotion to i32 caused arguments to use SysV GPRs (EDI..R9D)
instead of the `preserve_none` GPRs.
- i128 arguments did not use `CC_X86_64_I128`, allowing an i128 to get
split between register and stack.
- varargs `preserve_none` did not fall back to correctly to the C
calling convention, despite the lowering assuming they did.
- The X86 register info didn't include RAX, R11 - R15 as argument
registers for `preserve_none`.
- nest parameters didn't use the expected R10
[5 lines not shown]
[aarch64][win] Reland "Support shrink-wrapped SEH unwind ranges, with limitations" (#244458)
Relands #231596 with fixes for the regressions that it caused.
I've kept the fixes in a separate commit, description from that commit:
The original Arm64 Windows Shrink Wrap PR #231596 caused two different
regressions, which this change fixes.
Firstly, tail duplication could result in the prolog being duplicated,
which resulted in the SEH directives getting duplicated and so the
unwind pass aborts. The fix for this is to mark `SEH_PrologEnd` as
non-duplicable.
The second issue is that branch folding could move the prolog into the
entry block after other ordinary instructions (that run before the frame
is established). This would cause those instructions to be considered
part of the prolog, resulting in MC aborting due to a size mismatch. The
fix is to start an explicit record at the first frame-setup instruction
[14 lines not shown]
[CIR] Handle Indirect call in callee setter (#244751)
Indirect call from function pointer has no SymbolRefAttr, which cause
assetion after dyn_cast.
According to FIROps.cpp, four cases ({Direct, Indirect} x {Direct,
Indirect}) are handled separately. As we don't have arg_attr in indirect
call, we just prepend and discard attr when call type is chaged.
Assisted-by: Claude # Test
[X86][SEH] Emit epilog SEH_Push2Regs in PUSH2 order for unwind v3 (#237829)
For Win64 unwind v3, the .seh_push2regs emitted before an epilog POP2
named the registers in POP2 order. Epilog ops are interpreted like the
prolog PUSH2 they undo, so unwinding from inside the epilog restored the
pair swapped. Emit them in PUSH2 order, matching the prolog (and the
assembler's .pop2reg handling); the epilog can now share the prolog
WODs.
Fixes #231762.
Assisted-by: Claude Opus 5.5
(cherry picked from commit 1bd40d3811d9d9585b31c7d7bef15a0f0ddb2624)
[RISCV] Specially handle multiply by negative power-of-two cases (#244731)
Prior to this change, for power-of-two negative values in
`expandMulToAddOrSubOfShl()`, the `Shift1` was calculated as a `SHL` by
`32`, which for `i32` overflows, so is considered `undef`. In addition,
for the `i64` negative power-of-two case, `MulAmt + MulAmtLowBit`
overflowed in `uint64_t` causing a missed optimization.
Fixes #244328
Based on discussions with @lenary.
AI Usage: Reviewed by Codex.
(cherry picked from commit d361f7b3f5946f69f9e9e54fb28feac5da45d7d0)
[NFC][AMDGPU] Make DsAtomicAsyncBarrierArriveB64PipeBug a target feature (#245820)
Fixes LCOMPILER-3199.
This PR was assisted by AI but I reviewed all the changes.
[MLIR][XeVM] Enable SPV_INTEL_subgroups for the SPIR-V backend (#245742)
Add `SPV_INTEL_subgroups` to the XeVM target's default extension list.
The XeVM target cannot compile a 1-D `xevm.blockload` to SPIR-V. For
example, a `vector<2xi32>` load fails with
"intel_sub_group_block_read_ui2: the builtin requires the following
SPIR-V extension: SPV_INTEL_subgroups". `xevm.blockload` and
`xevm.blockstore` lower to Intel subgroup block builtins, which need
this extension, but XeVM does not enable it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Clang][AMDGPU] Remove R600 usage from clang, flang and lld tests. NFC (#245524)
Test cleanup plan for removing the R600 (TeraScale) backend from
clang, flang, lld tests.
Tests that only cover R600 are deleted. In tests shared with other
targets, the r600 RUN lines and their now unused checks are removed.
annotations-global.c tests annotations on globals in a non zero address
space, so it is retargeted to amdgpu, which also uses `G1`:
```
// RUN: %clang_cc1 %s -triple r600 -emit-llvm -o - | FileCheck %s --check-prefix AS1-GLOBALS
// AS1-GLOBALS: target datalayout = "{{.+}}-A5-G1"
-->
// RUN: %clang_cc1 %s -triple amdgpu -emit-llvm -o - | FileCheck %s --check-prefix AS1-GLOBALS
// AS1-GLOBALS: target datalayout = "{{.+}}-A5-G1{{.*}}"
```
The `__builtin_r600_*` builtins and the r600 triple are still in clang,
[2 lines not shown]
Pi image: boot through U-Boot and loader.efi; kernel from /boot/kernel.RPI5 (#693)
The rpi500 image now boots the way the Pi boot chain was proven on
hardware (#687): config.txt starts u-boot.bin (from nextbsd-kernel-
extensions' continuous-u-boot release, sha256-checked), U-Boot starts
EFI/BOOT/BOOTAA64.EFI (the rootfs loader.efi), and the loader boots
/boot/kernel.RPI5/kernel, which the arm64 NextBSD-kernel package ships
(nextbsd-pkg#53), picked by loader.conf.d/rpi5.conf. So pkg upgrade
updates the kernel a Pi boots.
The UFS root moves into a BSD label in the freebsd slice, as on FreeBSD's
own Pi images and the installer's layout, so loader.efi finds /boot.
config.txt adds dtparam=pciex1 so U-Boot reaches an NVMe drive, and
kernel8.img stays on the FAT as a manual fallback. The image boots from
SD or NVMe; U-Boot can't drive the Pi 5's USB, so not from a USB stick.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
IR: Remove trailing space from printed AVR calling convention names
avr_intrcc and avr_signalcc were printed with a trailing space, which
produced a double space before the return type.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
allow ssh-keyscan to make progress when confronted with a server
that deliberately stalls during KEX by sending SSH_MSG_IGNORE
messages to keep the connection open and avoid timeouts;
Anthropic ANT-2026-1OFCJX6S