[DirectX] Set TypedUAVLoadAdditionalFormats on UAV texture loads (#225484)
Fixes https://github.com/llvm/llvm-project/issues/225147
This PR makes the `TypedUAVLoadAdditionalFormats` shader flag get set on
UAV texture loads.
Assisted by: GPT 5.6 Sol
[Support] Remove cl::DefaultOption (#225609)
https://reviews.llvm.org/D59746 added cl::DefaultOption so that the
built-in -h could be overridden by llvm-objdump and llvm-readobj, which
have since moved to OptTable. The remaining overrides just call
PrintHelpMessage, so remove them along with the flag. -h and --help
keep working in every tool.
LLM-aided
[SPIRV] Add support for dynamic/heap resources (#224488)
Extends the `SPIRVLegalizeImplicitBinding` pass to support heap
resources and renames it to `SPIRVLegalizeImplicitAndHeapBinding`.
The pass scans the module for calls to
`llvm.spv.resource.handlefromheap` and groups them into CBV/SRV/UAV
resources and samplers. Calls to
`llvm.spv.resource.counterhandlefromheap` form a third group.
The SPIR-V backend represents descriptor heaps as unbounded resource
arrays. After resolving implicit bindings, the pass assigns the first
available binding to each heap group in the following order: CBV/SRV/UAV
resources, samplers, and counters.
For each group, the pass will replace the heap intrinsic calls with the
explicit `llvm.spv.resource.handlefrombinding` equivalents using the
assigned binding. The pass does not actually need to create the
unbounded resource-array globals itself. It only needs to assign a
[10 lines not shown]
[compiler-rt] Add 'csan' library for the concurrency sanitizer
Summary:
Adds the runtime for the concurrency sanitizer, both CPU and GPU.
Fundamentally, this works using the following pseudocode:
```c
static u64 watchpoints[N]; // Hash-indexed, zero is empty.
// Emitted before the access, so we never trip on our own write.
void check_access(volatile void *addr, u32 size, u32 type) {
// Every access probes. A read conflicts only with a watched write, a
// write conflicts with either.
if (u64 *wp = find_watchpoint(addr, size, type))
consume(wp, this_pc()); // Hand our location to the owner.
if (!should_sample()) // Wave-uniform, 1-in-N chance.
return;
[17 lines not shown]
[Clang] Add support for the `-fsanitize=concurrency` runtime
Summary:
Add the frontend sanitizer kind, function attributes, pass pipeline
integration, predefined macro, and driver handling for
ConcurrencySanitizer.
[lldb] Add Options to LINK_COMPONENTS (#225684)
This fixes shared library build of lldb:
```
/usr/bin/ld: lib/liblldbPluginPlatformMacOSX.a(PlatformDarwin.cpp.o): undefined reference to symbol '_ZNK4llvm3opt8OptTable9getOptionENS0_12OptSpecifierE'
/usr/bin/ld: /work/kparzysz/git/llvm.org/b/x86/lib/libLLVMOption.so.24.0git: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
And several other cases in unittests.
AMDGPU: Preserve dead carry-out when shrinking adds in SIFoldOperands
The VOP3 form of add/sub with carry out are sometimes shrunk to the VOPC
form when the carry out is dead. Preserve this information by setting the
dead flag on the new instruction. This alleviates some implicit dependence
on LiveVariables' later recomputation of dead flags.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[clang] Widen SubstTemplateTypeParmType::PackIndex to 16 bits (#225584)
#132748 narrowed PackIndex to 15 bits when adding Final, leaving a bit
unused, so a type pack with 32768 or more elements stores a wrapped pack
index. The node then keys differently from its lookup, failing the
UniquingSet insert assertion. Restore the 16-bit width, matching
SubstPackType's 16-bit NumArgs.
Fix assertion failure https://godbolt.org/z/9r1jEqqob
Aided by Opus 5.5
minimize_crash.test sometimes one-shots the minimization (fix flaky test) (#225544)
After #223470 it is now possible for `minimize_crash.test` to one-shot
the minimization by applying the EraseBytes mutation 3 times (to go from
size 8=>4=>2=>1).
```
| 35: SUMMARY: libFuzzer: deadly signal
| 36: MS: 3 EraseBytes-EraseBytes-EraseBytes-; base unit: 0000000000000000000000000000000000000000
| 37: 0x2a,
| 38: *
```
This causes the test to fail because it only prints the `Test unit
written to` line once. This sets `-mutate_depth` to 2 to guarantee that
it won't be one-shot and thus the line will print more than once.
rdar://188078094
[GlobalOpt] Use getGetElementPtr() overload accepting a DataLayout (#225789)
To produce the GEP in canonical ptradd form. Unlike other uses,
this one has to take potential failure to create the constant
expression into account.
It also seems like the GEP path was entirely untested, so I added
some basic test coverage for it.
[Clang] Add elementwise conversions from encoded FP8 values
Add nine builtins converting Float8E5M2, Float8E4M3FN, and Float8E5M3FNU
encodings to _Float16, __bf16, or float through
llvm.convert.from.arbitrary.fp.
Accept exactly 8-bit integer scalars and generic fixed-length vectors,
preserving vector kinds and element counts without integer promotions.
Also support scalar AArch64 __mfp8 containers. Apply destination type
availability checks, including deferred offload diagnostics, and reject
constant-expression use.
Document the interface and add semantic, template, language-mode,
target-specific, and IR-generation regression coverage.
RFC: https://discourse.llvm.org/t/rfc-clang-elementwise-builtins-for-converting-encoded-floating-point-values/91644
[Support] Allow \n, \t, \x in regexes (#223024)
\n and \t were already permitted in Regex::sub, but not in the regex
pattern itself. This commit allows them there too.
\x was not supported at all. This commit allows it both in regex
patterns and in Regex::sub.
The goal is to allow \x to be used in FileCheck patterns and to that
end, a test is also included that this works in FileCheck as expected.
[AMDGPU] Fold a constant add/sub into the sudot4/sudot8 accumulator
Fold a constant add into the accumulator operand of sudot4 and sudot8 when
clamping is disabled:
```
sudot(a, b, C1, false) + C2 -> sudot(a, b, C1 + C2, false)
```
Subtraction by a constant is canonicalized to addition of its negation.
[SLP]Do not reorder the tree to match internal gathers of splat subtrees
The internal gathers of the splat gather subtrees are not used as
shuffle sources, but still defined the order of the main tree gathers.
The reorder shuffle stayed after the subtree was dropped as
unprofitable and rejected the profitable tree.
Fixes the perf regression from #220250, reported in #221717.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/225839