[orc-rt] Make AllocAction APIs noexcept (#245814)
Allocation actions report failure via their result (as an out-of-band
error), and should not throw. Mark them noexcept.
[X86][APX] Enable CF and emit register-form CFCMOV by default (#242389)
Add CF to the DMR and NVL feature lists and to -mapxf/-mno-apxf, and
require it for __APX_F__.
Register-form CFCMOV (select with zero) is selected whenever CF is
available. Memory-form CFCMOV (conditional faulting load/store) is gated
on the new tuning feature prefer-cf-mem-operand, which no CPU sets. It
controls X86TTIImpl::hasConditionalLoadStoreForType, the
store(cmov(load)) -> CSTORE combine and the CLOAD/CSTORE isel patterns.
Assisted-by: Claude Opus 5.5 <noreply at anthropic.com>
[GISel] Use CastTy.getElementType() in LLT::vector calls in bitcastExtractSubvector/bitcastInsertSubvector. (#245729)
This avoids creating a vector of 's' types on targets that use extended
LLTs.
Assisted-by: Claude
[libc] Add smoke tests for carg and cabs (#245546)
We added MPC tests for carg and cabs previously, this PR adds smoke
tests for them which doesn't depend on MPC.
---------
Signed-off-by: jinge90 <ge.jin at intel.com>
Revert "[llc] Add a reusable LLVMLlcDriver library" (#244971)
This reverts #221896 and its follow-up #222840, along with the gn ports
#222741, #223370 and #236774. Later changes to the driver are kept.
LLVMLlcDriver has no in-tree user and no header; its interface is a
hand-declared `extern "C" llcMain`. Yet it is installed, and it is not
usable for embedding:
* A host linking both LLVMLlcDriver and LLVMOptDriver aborts at startup:
```
: CommandLine Error: Option 'o' registered more than once!
```
* `llcMain` calls `exit(1)` on errors such as an unknown `-mtriple`.
Unlike `optMain` (#79205), which takes PassBuilder callbacks, `llcMain`
has no extension point. llc is a testing tool, not a stable interface.
LLM-aided
Add new ports committer (mzar)
Complete steps 1-4 of the Committer's Guide (Section 7.1).
Reviewed by: philip
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D61982
linux(4): compare xattr namespace names with strcmp()
xattr_to_extattr() compared each namespace over the length of the
caller's prefix and would read past the end of any shorter name
the values are already null-terminated so we can just use strcmp()
here
Reviewed by: rmoeller
Differential Revision: https://reviews.freebsd.org/D60954
linux(4): compare xattr namespace names with strcmp()
xattr_to_extattr() compared each namespace over the length of the
caller's prefix and would read past the end of any shorter name
the values are already null-terminated so we can just use strcmp()
here
Reviewed by: rmoeller
Differential Revision: https://reviews.freebsd.org/D60954
[ELF] Parallelize `.gnu.hash` and `RELR` finalization (#245550)
Hash and sort `.gnu.hash` entries and collect and sort `RELR` offsets
with `parallelFor`/`parallelSort`. Output is byte-identical at any `--threads`.
```
hyperfine -N --warmup 5 --runs 40 \
'ld.lld-base --threads=8 @clang.rsp -o clang' \
'ld.lld-patched --threads=8 @clang.rsp -o clang'
base 313.6 ms ± 3.2 ms
patched 293.9 ms ± 2.7 ms (-6.3%)
```
On i7-7700K 4C/8T.
For small linking jobs, it was within the measurement noise.
Pi image: boot through U-Boot and loader.efi; kernel from /boot/kernel.RPI5 (#693) (#694)
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>
[ELF] Decompress SHF_ALLOC compressed input sections eagerly (#245867)
GNU Assembler and llvm-mc compress SHF_ALLOC `.debug_*` sections (e.g.
[[gnu::section(".debug_gdb_scripts")]]) with --compress-debug-sections.
lld crashes on such a section because `compressedSize` overlaps
`jumpInstrMod`, and i386 reads implicit addends from the compressed
content.
Build on #245864 and decompress SHF_ALLOC sections in
parseCompressedHeader.
Fix #212125
[Mips] Lower llvm.get.rounding and llvm.set.rounding (#245265)
llvm.get.rounding was folded to 1 (to nearest) whatever the current
rounding mode was, and llvm.set.rounding failed to select.
Read FCSR with cfc1 and map FCSR.RM to the FLT_ROUNDS values for
llvm.get.rounding. For llvm.set.rounding, map the mode back to RM and
write it to FCSR with ctc1, keeping the other bits.
Also use the microMIPS cfc1/ctc1 when copying to or from FCSR. On
microMIPS R6 the standard encodings were emitted.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[llvm-exegesis] Zero initialize CurrentCPU (#245858)
Otherwise we get MSan false positives given we manually make a syscall
to SYS_getcpu because older versions of glibc do not have a getcpu
wrapper.
clang: Decide optsize and minsize together with optnone
Instead of adding optsize and minsize everywhere and removing them
when the definition is optnone, only add them to definitions that are
not optnone. Also stop adding these to declarations.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[LoongArch] Select cheaper constants for AND using known bits
The target-independent combines clear the bits of an AND mask that are known
to be zero in the other operand. That can make the mask more expensive to
materialize, e.g. -27 becomes 0xffffffe5 if the upper 32 bits are known to be
zero:
```
addi.w $a1, $zero, -27
lu32i.d $a1, 0
and $a0, $a0, $a1
```
Set the leading bits again at instruction selection if the mask has no other
users and that makes it cheaper, or allows to use bstrins:
```
addi.w $a1, $zero, -27
and $a0, $a0, $a1
[6 lines not shown]
[LoongArch][NFC] Add tests for AND with constants and known bits
Add tests for AND with constants, where the leading bits are known to be zero
in the other operand.
Assisted-By: LLM
Reapply "[AMDGPU] Support the RF and m inline asm constraints (#195123)" (#245801)
This reapplies #241996 (510874d1f795), which is a reapply of #195123,
minus the change to SIInstrInfo::verifyInstruction.
This patch supports the RF inline asm constraint for memory operands in
the flat address space as well as the generic 'm' constraint.
PR #241996 was reverted be #245558 because EXPENSIVE_CHECKS builds
failed several AMDGPU CodeGen tests (e.g. callbr.ll, pack.v2f16.ll,
llvm.maximum.f32.ll) with "Bad machine code: inlineasm operand has
incorrect register class". Those failures were caused by the change to
SIInstrInfo::verifyInstruction that stopped skipping INLINEASM, making
the existing inline asm register class check reachable. They are not
related to the RF/m constraint support itself.
The original patch is therefore split in two:
- This patch: RF and m constraint support only.
- A follow-up patch: enabling the inline asm register class check in
[3 lines not shown]
[Clang][Sema] Avoid unsigned overflow in sentinel call checks (#245549)
This fixes https://github.com/llvm/llvm-project/issues/245437. Adding
the sentinel offset to the fixed parameter count can wrap for large
offsets, allowing an out-of-bounds access to the argument list.
Check that the number of remaining arguments exceeds the offset before
looking up the sentinel. This preserves the existing warning when there
are too few variadic arguments.
Assisted-by: OpenAI Codex