Record what the hardware entitlement script did on upgrade
This commit adds changes to leave a record under /data of every outcome from truenas-hw-license.py, since the installer discards the script's output and a failure to write the entitlement record was previously invisible. Middleware relays it into middlewared.log on first boot and then deletes it, and only says anything when the record carries an error.
Every outcome is recorded rather than just the failures because a chassis reading as unknown is indistinguishable in the script from dmidecode having failed, so which outcomes deserve attention is better decided in middleware.
Both writes now go through atomic_write instead of a hand-rolled open with fchmod and fchown, matching truenas-nvdimm.py which already uses it from the same chroot. That also closes a window where a failed write left behind a permanent zero-byte /data/license that no later upgrade would have retried.
net/bsdec2-image-upload: Update to 1.4.13
This increases the ImportVolume part size in order to work around
issues in the ImportVolume service.
Sponsored by: Amazon
[CIR] Convert i1 intrinsic results for bool-returning builtins (#220576)
A target builtin with no special case is emitted through the generic
intrinsic path, which returns the intrinsic's own result type. For a
builtin declared to return bool that type is i1, which CIR models as
!cir.int<u, 1> rather than !cir.bool. cir.if accepts only !cir.bool, so
CIR builtin handling needs to convert i1 results to !cir.bool when used
in this context.
This is verified using __builtin_amdgcn_is_shared.
---------
Signed-off-by: Steffen Holst Larsen <sholstla at amd.com>
[CodeGen] Increase CCState::UsedRegs inline capacity (NFC) (#221259)
CCState::UsedRegs holds one bit per target register. Its inline capacity
of 16 x 32-bit words only covers 512 registers, causing heap allocations
for AArch64 (895), RISCV (645), and PowerPC (612). Increase it to 32,
covering up to 1024 registers and keeping the storage inline for these
targets.
Assisted-by: codex
[CIR][OpenCL][NFC] Add language address-space lowering coverage (#219900)
Expand coverage for lowering OpenCL language address spaces through
target-specific CIR and LLVM IR, including comparison with classic
CodeGen.
Assisted-by: Codex / GPT-5.6 Sol
[orc-rt] Compose Bedrock from object libraries (#221650)
Add orc-rt-bedrock-objects, and rename orc-rt-support to
orc-rt-support-objects, leaving orc-rt-bedrock as a shipped library with
no sources of its own that is composed from both. The -objects suffix
marks targets that produce no artifact.
The unit tests now link the object libraries directly rather than the
shipped library. This will allow them to continue working when Bedrock
becomes buildable as a dylib with no C++ API exported.
[SLP][modularisation][NFC] Move isFixedVectorShuffle to SLPUtils (#221639)
Move the BoUpSLP-independent shuffle helper out of SLPVectorizer.cpp
into SLPVectorizer/SLPUtils.{h,cpp}:
isFixedVectorShuffle
It sits with the existing shuffle/mask helpers. Behavior is unchanged.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
[Mips] Use ELF binding when expanding PIC la (#217566)
A symbol already assigned to a section is not necessarily local. Use ELF
symbol binding when expanding PIC `la`, retaining the existing
section-based fallback for non-ELF targets, so defined default-visible
globals use the correct global GOT form.
Adds `llvm/test/MC/Mips/macro-la-pic-defined-global.s` covering global,
local, and `$25` call-register expansions.
Fixes #217371
(cherry picked from commit eac7a734625083fc78164f1b7d67a74cb5ab334f)
[flang-rt] Fix runtime/environment.cpp compilation on FreeBSD (#219705)
`runtime/environment.cpp` doesn't compile on FreeBSD:
```
runtime/environment.cpp:115:47: error: use of undeclared identifier 'RTLD_DEFAULT'
115 | auto envpp{reinterpret_cast<char ***>(dlsym(RTLD_DEFAULT, "environ"))};
| ^~~~~~~~~~~~
```
`<dlfcn.h>` needs to be included.
Tested on `x86_64-pc-freebsd15.1` and `x86_64-pc-linux-gnu`.
(cherry picked from commit 20102748a3548a1006e32056868cb3df8ce83565)
[MIPS] Fix GP-relative selection after select/add combine (#215414)
## Summary
- Rewrite `$gp + select(...)` before MIPS instruction selection when a
select
arm contains a GP-relative relocation.
- Keep each `MipsISD::GPRel` attached to a selectable add operation.
- Add MIPS32 regression coverage and update the resulting MIPS64 checks.
## Background
The generic DAG combiner can transform:
select C, (add $gp, %gp_rel(A)), (add $gp, %gp_rel(B))
into:
add $gp, (select C, %gp_rel(A), %gp_rel(B))
[34 lines not shown]
[Mips] Select GPR register class based on requested type size (#220012)
In MipsTargetLowering::getRegisterByName(), the register class was
previously selected solely based on Subtarget.isGP64bit(), ignoring the
requested value type size (VT).
When compiling for a 64-bit MIPS CPU with the 32-bit o32 ABI (such as
-mcpu=mips3 -target-abi=o32), Subtarget.isGP64bit() is true even though
32-bit registers are expected. Reading a 32-bit named register like $gp
(e.g., via llvm.read_register.i32) returned a 64-bit register ($gp_64).
This resulted in a cross-register-class copy from GPR64 to GPR32 that
MipsSEInstrInfo::copyPhysReg() could not lower. In builds without
assertions, this constructed an invalid TargetOpcode::PHI (opcode 0)
instruction and caused a crash in MipsMCCodeEmitter during object file
emission.
Inspect VT.getSizeInBits() in getRegisterByName() to select
GPR32RegClassID for 32-bit types and GPR64RegClassID for 64-bit types
when supported by the subtarget, reporting an error for invalid types.
[5 lines not shown]
[clang-format] Keep empty Java interface/record body on one line (#219910)
`AllowShortRecordOnASingleLine` (introduced for C++ records) made
`LineJoiner::tryFitMultipleLinesInOne` route Java `TT_RecordLBrace`
lines to `tryMergeRecord`, which only handles C++ class/struct/union
records. Empty Java `interface` and `record` bodies were therefore no
longer merged onto a single line, regressing the behavior that
`BraceWrapping.SplitEmptyRecord: false` previously provided.
Handle Java records separately and restore the pre-existing
`SplitEmptyRecord`-based merge.
Fixes #219711
(cherry picked from commit 6d390ea43be046d62bc880524ffc4734a21307a7)
[libc] Disable float16 on 32-bit x86 without SSE2 (#219675)
Fixes #219668
Building llvm 23.1.0 (and current main) for 32-bit x86 without SSE2
fails since APFloat.cpp started including libc's shared/math.h. All the
errors come from the float16 headers:
```
libc/src/__support/FPUtil/BasicOperations.h:63:67: error: SSE register return with SSE2 disabled
libc/src/__support/math/acosf16.h:73:14: error: invalid conversion from type '_Float16' without option '-msse2'
```
The float16 detection in float16-macros.h checks __FLT16_MANT_DIG__.
Since GCC 14 that macro is defined on ia32 even without SSE2, where
_Float16 is storage-only and any arithmetic or returning by value is an
error.
The GCC 14 release notes say to check __SSE2__ for arithmetic support
instead: https://gcc.gnu.org/gcc-14/changes.html
[12 lines not shown]
[SelectionDAG] Avoid irregular INSERT_SUBVECTOR when widening CTTZ_ELTS (#218019)
Fixes #217985
Non-poison `CTTZ_ELTS` pads widened operands with active lanes using
`INSERT_SUBVECTOR`. For irregular fixed-length vectors whose
widened type subsequently requires splitting, this can reach the
`SplitVecRes_INSERT_SUBVECTOR` stack-spill fallback.
That fallback calls `getVectorSubVecPointer`, which requires
byte-addressable elements.
Use `VECTOR_SHUFFLE` for this specific widening case. Original lanes are
selected from the normally widened source, while padding lanes are
selected from an all-ones vector. This avoids the irregular
`INSERT_SUBVECTOR` and prevents poison/undef widened padding from being
observed.
Other widening cases retain their existing behavior.
[7 lines not shown]
[SPIRV] Fix inconsistent operand order for counter resource intrinsic
The `llvm.spv.resource.handlefrombinding` intrinsic stores its binding operands in the order (DescriptorSet, BindingNo, ...). The `llvm.spv.resource.counterhandlefrombinding` intrinsic should use the same order.
The `llvm.spv.resource.counterhandlefrombinding` intrinsic is currently emitted only by the `SPIRVLegalizeImplicitBinding` pass. The pass previously interpreted and rebuilt its operands in the wrong order, and the instruction selector repeated the same inversion when emitting decorations.
This change makes the operand order consistent with `llvm.spv.resource.handlefrombinding`.
[clang][Sema][CUDA,SPIRV] Instantiating function templates duplicates GPU attrs (#218582)
A number of GPU related attributes were incorrectly falling back to the
generic attribute instatiation logic which resulted in duplicating the
attributes. The duplicates were also not correctly instantiated.
This also exposed a failure to prevent duplicate addition in
handleGlobalAttr as well.