PPC: Replace EnableAIXExtendedAltivecABI with "target-abi" module flag (#221670)
Continue purging ABI-influencing TargetOptions fields. Eliminate this
case by migrating to a module flag, reusing the generic target-abi module
flag with a new value.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[HLSL] Add CustomTypeChecking and improve sema for texture builtins (#221060)
This PR makes the texture builtins (for load, sample, gather) use
CustomTypeChecking, and adds additional semantic checks for them to make
them more strict and conform with the way sema checks are done for other
builtins.
The main benefit of CustomTypeChecking is preventing
DefaultArgumentPromotion from occurring due to the builtins being
declared `void(...)`; primarily, the promotion of float/half to double
is undesirable.
Floating-point scalar operands in codegen (`CGHLSLBuiltins.cpp`) for
these builtins always had a check and cast of the form `if
(Op->getType() != FloatTy) Op = CreateFPCast(Op, FloatTy);` to
compensate for that, which looked like a code smell to me.
The DefaultArgumentPromotion also affected diagnostics, which would
report the promoted type (double) instead of the type the user provided
(float) (e.g., https://hlsl.godbolt.org/z/Yec3dKh14). These diagnostics
were not exercised before, and this PR adds tests to exercise them.
[14 lines not shown]
AMDGPU: Remove volatile from atomic tests
This is testing basic operation lowering, not volatileness.
Avoids a lot of test churn in a future change. Currently the codegen
is not actually seeing the volatile.
[CIR][AMDGPU] Add support for AMDGCN fmed3 builtins (#223101)
Adds codegen for the following AMDGCN fmed3 builtins:
- __builtin_amdgcn_fmed3f (float)
- __builtin_amdgcn_fmed3h (half)
These are lowered to the corresponding `llvm.amdgcn.fmed3` intrinsic.
rtld: more caution when parsing in digest_notes()
Incorrect ELF might have PT_NOTE slightly larger than the needed to
contain all notes, and the PT_NOTE size could be larger than one page.
Then rtld mmaps just the notes bytes to parse. After the last note,
we iterate past the mapped region trying to read the Elf_Note header.
This was found in wild.
Require full elf note to fit into the [start_note, end_note) region to
continue the parsing. Check it in stages, first verifying the Elf_Note
header structure fits, to be able to read the name and data length.
After that, check the whole note against limit.
Reported and tested by: makc
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59635
[DWARF] Add DW_MSPACE_LLVM_* memory space encodings (#220766)
DW_AT_LLVM_memory_space is already defined in Dwarf.def, and the memory
space encodings it takes are already specified in
docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst, but the values
had no names in the source, so llvm-dwarfdump printed the attribute as a
bare integer.
Add the encodings via a HANDLE_DW_MSPACE macro alongside the existing
HANDLE_DW_ASPACE, define the MemorySpace enum, and add MemorySpaceString
and getMemorySpace. AttributeValueString then resolves the attribute, so
no changes are needed in the DWARF consumers themselves.
Unlike address spaces, memory space encodings are target-independent, so
MemorySpaceString takes no triple.
Harden truenas_s3 validation and rendering
Mirror the daemon's refusals in the API and the render: region
grammar, dotted-quad bucket names with leading zeros, duplicate audit
actions, colliding grant-heading labels. Enforce the one-way fields
(object lock, versioning) plus explicit object_ownership when leaving
MULTIPROTOCOL, unwind failed bucket creates fully, take naive access
key expiries as UTC, and keep each port's TLS posture across a
listener reset.
Derive base_hosts and truenas_version at render time, re-rendering on
network changes, for virtual-hosted addressing and the SOSAPI
ModelName. Extend the audit mask vocabulary to the daemon's 21
actions and the audit event schema to every operation it emits.
Harden truenas_s3 validation and rendering
Mirror the daemon's refusals in the API and the render: region
grammar, dotted-quad bucket names with leading zeros, duplicate audit
actions, colliding grant-heading labels. Enforce the one-way fields
(object lock, versioning) plus explicit object_ownership when leaving
MULTIPROTOCOL, unwind failed bucket creates fully, take naive access
key expiries as UTC, and keep each port's TLS posture across a
listener reset.
Derive base_hosts and truenas_version at render time, re-rendering on
network changes, for virtual-hosted addressing and the SOSAPI
ModelName. Extend the audit mask vocabulary to the daemon's 21
actions and the audit event schema to every operation it emits.
CodeGen: Clear physreg ranges after SplitCriticalEdge (#223172)
After critical edge spliting replaces a terminator, clear referenced
physreg ranges. The block's terminators may be replaced, and may
reference physical registers (e.g. WebAssebly's ARGUMENTS. When
LiveIntervals is available, repairIntervalsInRange only repairs virtual
registers, so the tracked physreg units were stale.
It feels like a bug that repairIntervalsInRange doesn't touch physregs,
but I've left that for a future change.
Co-Authored-By: Claude claude-opus-4.8 <noreply at anthropic.com>
[CIR] Accept a union whose empty member is [[no_unique_address]]
The record-wide reject for a member CIRGen marks empty is there for the
struct arm of mapCIRType, which reads such a member as an unnamed
bit-field standing for the bytes it occupies. This does not apply to a
union, so the reject moves into the struct branch.
Which variants the classifier sees then falls to the union arm, and it
now reads that from each variant's own storage rather than from its
mark. A zero-sized variant and one that is empty for the ABI are
skipped. One whose mark says empty over storage that holds data is not.
Assisted-by: Cursor / claude-opus-5
R-s2: force C++17
something sets this to build with C++20, but the code is not ready for this
it uses features that were deprecated in C++17 and removed in C++20
Force C++17 to fix the build.
[AMDGPU][GlobalISel] Fold neg/abs modifiers when mad-mix selects the low half
selectVOP3PMadMixModsImpl re-runs the fneg/fabs match after rewriting Src
to the 32-bit register the 16-bit value is a half of, but only did so on
the isExtractHiElt path, not for isExtractLoElt.
The two halves are not symmetric. An fneg/fabs of a 32-bit float only
touches bit 31, which is the sign bit of the high half, so folding it
into a modifier on the selected high half is correct. The low half's sign
bit is bit 15, which such an fneg/fabs leaves alone, so only a modifier
that acts on each 16-bit element can be folded there. So the source must be
a 2 x 16-bit vector to fold it.
[VPlan] Bail out on chained reductions in handleMaxMinNumReductions. (#223521)
handleMaxMinNumReductions does not support reduction chains, as the NaN
check directly checks the operand of the single min/max reduction.
Bail out for now to fix a crash.
Fixes https://github.com/llvm/llvm-project/issues/223430.
[Analysis] Fix GCC warnings on ABI annotations (#222286)
The GCC build is cluttered by type attribute warnings on some header
files:
```
llvm/include/llvm/Analysis/RegionInfo.h:898:41: warning: type attributes ignored after type is already defined [-Wattributes]
898 | extern template class LLVM_TEMPLATE_ABI RegionBase<RegionTraits<Function>>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
The type attributes originate from PR #199019. The warnings occur
because the
specific template instantiation is triggered implicitly earlier, without
the
type attribute. This can be fixed by placing the extern template
declaration
before the implicit use.
[5 lines not shown]