Makefile.inc1: Fix bare $ characters
The '$' characters inside awk commands need to be $$ when appearing
inside a Makefile. Without this, we generate empty src and src-sys
packages.
Reported by: Stefan Grundmann
Fixes: a8be89928930 ("build: Support got")
MFC after: 1 day
[libc] Bound the decimal point check in simple_decimal_conversion (#238179)
HighPrecisionDecimal clamps the decimal point to 1 << 30, but
exp10_to_exp2
is only valid for inputs below 646456636. For larger decimal points the
result wrapped to a negative value, so the "too large" and "too small"
checks did not trigger and the shift loops ran tens of millions of
iterations until exp_2 overflowed (signed integer overflow).
Treat decimal points at or beyond the valid range of exp10_to_exp2 as
out of
range, and use add_overflow/sub_overflow for exp_2 in the shift loops so
that they stay well defined.
Assisted-by: Claude (Anthropic)
RuntimeLibcalls: Only apply vector math attributes to floating point vectors
i128 is now <2 x i64> on Win64, which made the vector type checks treat
integer helpers like __atomic_load_16 as vector math functions and mark
them nosync and nofree. Check for a floating point vector argument.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
SelectionDAG: Use the memory type for atomic libcall actions
The atomic libcall selection is driven by the memory type, not the
legalized value type. Convert targets to use the LibCall action
instead of Expand.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[BoundsSafety][Docs] Add an index page and upstream status for -fbounds-safety (#238142)
Move -fbounds-safety docs into BoundsSafety/ without changing their
content.
Add BoundsSafety/index.md as the landing page for the -fbounds-safety
docs. It covers how to contribute, standardization efforts in WG14,
open-source adoption efforts, RFCs, and talks.
Add upstream status and the link #238453, which lists what is available
upstream, what is in progress, and what is planned, with links to the
relevant PRs and issues.
Leave a stub at the old BoundsSafety.html location so existing links
keep working.
Assisted-by: Opus 5.5
[clang][APFloat] Print floating-point literals in the shortest round-trip form (#218471)
StmtPrinter printed a `FloatingLiteral` at the maximum round-trip
precision, so `3.14` printed as `3.1400000000000001`. This patch adds
`APFloat::toStringShortest` and calls it from `PrintFloatingLiteral`.
NaN, infinity, and zero keep the old path.
`toStringShortest` computes the shortest digit count from the value's
rounding interval (Ryu's formulation with a Dragonbox-style grid anchor)
in exact APInt arithmetic, so every IEEEFloat semantics works. The
existing `toString` then formats at that count and the round trip is
verified. PPCDoubleDouble keeps a plain probe from precision 1.
Two cases keep the natural-precision form:
- An integer in fixed notation has exact digits; a shorter form would
only switch it to scientific notation. `100.0` prints as `100.`, not
`1.0E+2`.
- The largest value of a format with neither infinity nor NaN parses
back from any larger string by saturation, which is not a round trip.
[24 lines not shown]
RuntimeLibcalls: Declare vector libcall attributes in TableGen
Replace the type-based heuristics for vector math libcall attributes
with attributes declared on the libcall definitions, emitted with the
same attribute table helpers as intrinsics.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
TableGen: Move attribute set and sequence table helpers to a header
Move AttributeSetTable and AttributeSequenceTable out of
IntrinsicEmitter into a reusable header so the runtime libcall emitter
can use the same encoding.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Mark vector libcall out pointers dereferenceable
The whole vector width will be written, so mark the vector width. To
maintain the element width alignment for some functions, we need to
start explicitly tracking if the element alignment is used or not.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
TableGen: Unique intrinsic attribute tables by attribute value
Unique the intrinsic attribute tables by the attributes themselves
rather than by CodeGenIntrinsic, and separate the uniquing from the
emission in AttributeSetTable and AttributeSequenceTable so other
emitters can reuse them.
This also fixes MaxNumAttrs, which was computed from one representative
intrinsic per argument attribute sequence and could undercount.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Use <2 x i64> for i128 libcall types on Win64
Win64 passes __int128 by reference and returns it in XMM0. i128 uses
GPR pairs, and <2 x i64> uses the correct vector register. This
matches the type AtomicExpand and clang uses for these functions.
Also fix AtomicExpand to use the correct type for UEFI (which should
eventually use the type information in RuntimeLibcallsInfo).
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[SimpleLoopUnswitch] Do not let droppable instructions block trivial unswitching (#238292)
In a loop such as
```c
for (...) {
__builtin_assume(i < n);
if (c) break; // c is loop-invariant
...
}
```
the invariant exit should be unswitched trivially as `c` is checked once
before the loop with no copy of the loop. Instead, the assume stops
trivial unswitching since the pass gives up at any instruction that may
have side effects before the branch, and `llvm.assume` claims to write
memory so that it is not deleted as dead code. The loop then goes
through non-trivial unswitching, which duplicates the loop body.
Skip droppable instructions (`llvm.assume`, `llvm.pseudoprobe`,
`llvm.experimental.noalias.scope.decl`) in that check. LoopDeletion uses
the same principle.
[Clang][Driver] Forward -f[no-]vectorize to clang-linker-wrapper and LTO (#231693)
Forward -fvectorize and -fno-vectorize through clang-linker-wrapper to
device compiler invocations.
The frontend flags are translated into -vectorize-loops=<0|1> for the
LTO backend, mirroring the existing SLP vectorization handling.
Assisted by gpt-5.6.
[AMDGPU] Reapply "Support the RF and m inline asm constraints (#195123)" (#232540)
Relanding 6b58e144bee8, reverted in 6b804fdec943 due to a CI failure in
hazard-inlineasm.mir.
Root cause: the original commit fixed an incidental problem by adding
`&& !MI.isInlineAsm()` to the `isGenericOpcode` early-return in
SIInstrInfo::verifyInstruction, which caused the verifier to actually
check INLINEASM instructions. This exposed stale RC ID encodings in the
raw flag integers in hazard-inlineasm.mir. The original commit fixed
those values, but they became stale again at the time when the commit
was merged.
Fix: recompute all five INLINEASM flag operands using current RegClassID
assignments.
Original description:
This patch supports the RF inline asm constraint for memory operands in
the flat address space as well as the generic 'm' constraint.
[CMake] Pass through -DCMAKE_MAKE_PROGRAM= when generating profdata for clang (#225970)
Since we're already passing the -DCMAKE_GENERATOR through, we need the
corresponding CMAKE_MAKE_PROGRAM, which CMake doesn't always know how to
find itself.
rdar://187916126
NAS-142270 / 28.0.0-BETA.1 / Add Webshare MCP option (by Qubad786) (by bugclerk) (#20126)
## Context
Webshare ships an MCP server configured through the `mcp` block of the
webshare-auth config, and there was no way to turn it on from
middleware.
## Solution
- **New settings**: `webshare.update` accepts `mcp_enabled`,
`mcp_allowed_groups` and `mcp_allow_write`, which are rendered into the
`mcp` block. `allowed_hosts` is left unset.
- **MCP groups must be login groups**: webshare only checks login groups
at OAuth consent, while token refresh and session spawn check only the
MCP groups, so every MCP group must be `truenas_webshare` or an entry of
`groups`. Otherwise MCP access could outlive Webshare access. Enabling
MCP without a group is rejected, since webshare denies everyone on an
empty list.
- **Canonical group names**: MCP groups are resolved through NSS,
compared by gid and stored under their canonical name, so a directory
[10 lines not shown]
[AMDGPU] Clear NoPHIs after SIFixSGPRCopies under the new pass manager (#238429)
SIFixSGPRCopies can build waterfall loops, which add PHIs. The legacy
pass declares that it clears NoPHIs, but the new pass manager's
SIFixSGPRCopiesPass declared no properties and never applied them. So a
function kept NoPHIs after the pass added a PHI, and the machine
verifier rejected it. Declare the cleared property and apply it with
MFPropsModifier. The test waterfalls a buffer load's resource under both
pass managers.
[AMDGPU] Use the mul24 result width for known bits
Extend the low 24 operand bits to the destination width before multiplying. Using the i32 operand width for i64 results can incorrectly fold upper product bits to zero.
Cover signed and unsigned i64 results and restore the bf16-to-i128 sign-extension checks affected by the incorrect inference.
[AMDGPU] Track GlobalISel known bits for mul24 intrinsics
Sign or zero extend the low 24 operand bits before querying KnownBits::mul. This allows GlobalISel to narrow shifts and simplify address calculations through mul24 intrinsics.
Cover ignored high bits, zero operands and overflow, and update the affected codegen checks.
[KnownBits] Cover negative multiplication boundaries
Exercise both operand orders and i8, i32, i65 and i128 results. Preserve cases where zero or signed and unsigned wraparound prevent leading-bit inference.
TableGen: Keep the instregex prefix for patterns with a top-level ?
instregex discarded a pattern's literal prefix, and ran the regex on
every instruction, if the pattern had a ? outside parentheses, as in
LDPS?Wi. A ? only makes the atom before it optional, and an atom
directly before it is already dropped from the prefix. Only a top-level
| makes the prefix unusable.
AArch64GenSubtargetInfo.inc tablegen run:
Gigainstructions Gigacycles CPU seconds
Before 44.6 18.8 5.7
After 43.1 (-3.4%) 17.8 (-4.9%) 5.4 (-4.6%)
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>