[clang] fix transformation of SubstNonTypeTemplateParmExpr nodes from typealiases and concepts
This makes sure SubstNonTypeTemplateParmExpr produced from non-specialization
decls (Type alias templates and concepts) are correctly transformed.
This makes the SubstNonTypeTemplateParmExpr store the parameter type directly,
and uses that instead of relying on the AssociatedDecl.
Fixes #191738
Fixes #196375
[cuda][flang] Diagnose missing CUDA intrinsic modules in Flang semantics (#200509)
- Replace CUDA intrinsic module `CHECK`s with actionable diagnostics
when `cudadevice` or `__cuda_builtins` cannot be read.
- Avoid dereferencing missing CUDA module scopes during implicit CUDA
symbol import.
- Add a semantics test covering the missing CUDA intrinsic module
diagnostic.
[lldb][Windows] Use captured error in ConnectionGenericFile::Read (#200803)
Use the captured value on both branches so the reported error matches
the one that was tested against.
[libc] Add netinet/udp.h containing struct udphdr (#200839)
This patch adds a generated <netinet/udp.h> containing the `udphdr`
structure definition.
There are two styles ("linux" and "BSD") of udphdr field names (and both
of them can be found in the wild), so I follow the glibc and bionic
approach of using an anonymous union. (musl uses a #define on the field
names, which doesn't seem that great).
I've added the target to `include/CMakeLists.txt` and registered it
under target lists in `headers.txt` for the supported Linux platforms
(x86_64, aarch64, and riscv).
To verify layout and alignment correctness, I've added a layout and
field compatibility unit test under `test/src/netinet/udp_test.cpp`.
Assisted by Gemini.
[Clang][AMDGPU] Restore the non-RDC compilation pipeline
The new offload driver uses the LTO compilation pipeline even for non-RDC
compilation. This PR restores the conventional non-RDC flow, where the backend
generates executable code directly, which is then bundled into the HIP fat
binary.
We can revert this change in the future if we decide to deprecate the
distinction between non-RDC and RDC compilation and unify the compilation flow.
[mlir][spirv][tosa] Add remaining TOSA 1.0 SPIR-V TOSA ops (#200383)
Add conversion patterns for additional TOSA 1.0 operations targeting the
SPIR-V TOSA extended instruction set.
This covers pooling and convolution ops, FFT/RFFT, matmul, concat, pad,
rescale, const, const_shape, and identity. Concat is split into
conservative chunks to avoid producing SPIR-V instructions with too many
operands.
Add a multi-result conversion pattern for FFT/RFFT and share the
convolution replacement logic for conv2d, conv3d, and depthwise_conv2d
while keeping transpose_conv2d explicit because it has different
attributes.
Also share constant attribute conversion for const and const_shape,
including integer element type conversions such as index to i32, i4 to
i8, and i48 to i64, and preserve the empty const_shape edge case.
[2 lines not shown]
[LLVM][IR] Make sure that DILabel's line is always printed
This commit ensures that the textual IR of the DILabel always contains
the `line` information. This is required as the absence of a line causes
a parsing failure, i.e., this change fixes the print + parse roundtrip.
[NFC][lldb][windows] break down NativeProcessWindows::OnDebugException (#200832)
This patch breaks down `NativeProcessWindows::OnDebugException` into 3
different handlers (one for each exception) for readability.
[BOLT] Support multiple perf data inputs
Allow multiple -p/-perfdata args (comma-separated and repeated).
Process them in parallel with `--perfdata-jobs/-pj` (default 4,
0 for all available hardware threads). Keep YAML/DataReader
inputs single-profile only.
This also enables density computation with multiple perf files.
Prior to that, it was impossible to compute total density as
it wasn't computed from symbolized profiles.
Depends on
#199323
#199322
#199321
#199320
Test Plan:
Updated pre-aggregated-perf.test and perf_test
[11 lines not shown]
[flang][OpenMP] Restricting Integration test atomic-capture-release.f90 run to x86 and aarch64 (#200770)
Similar to the the change in
`flang/test/Integration/OpenMP/atomic-compare.f90`, restricting the test
case `flang/test/Integration/OpenMP/atomic-capture-release.f90` to run
on
`x86-registered-target & aarch64-registered-target`
This also Fixes
[#200729](https://github.com/llvm/llvm-project/issues/200729)
A comment has been added to the merge in
[[Flang][OpenMP]Handling restrictions of using Memory-Order-Clause with
Atomic-Clause](https://github.com/llvm/llvm-project/pull/199636)
>LLVM Buildbot has detected a new failure on builder
ppc64le-mlir-rhel-clang running on ppc64le-mlir-rhel-test while building
flang,llvm,mlir at step 4 "cmake-configure".
Full details are available at:
[4 lines not shown]
[LoopInterchange] Add test where loop has memory-affected calls (NFC) (#200827)
This patch adds the following two test cases:
- There is a call to a function with `memory(write)` in the loop nest,
which is taken from #200796.
- There is a call to a function with `memory(none)` in the loop nest.
For the former case, we are not allowed to interchange the loops because
the function call may write to an unknown memory location, but the
transformation is still applied, i.e., a miscompilation. As for the
latter case, the call should not prevent the loops from being
interchanged, which seems to be the original intention of the code.
[llvm-objcopy] Strip header from DXContainer's ILDB part during `--dump-section` (#198578)
This strips the header from ILDB part of DXContainer during
`llvm-objcopy --dump-section`, so that the output contains bitcode only.
[lldb][windows] refactor null handling in DynamicLoaderWindowsDYLD (#200821)
This patch thightens the null guards.
---------
Co-authored-by: Nerixyz <nero.9 at hotmail.de>
[clang] Parse `__typeof_unqual__` consistently with `__typeof__` (#198948)
C23 `__typeof_unqual` and `__typeof_unqual__` are supported in all
language modes as an extension.
However, existing tests missed this form:
```cpp
int main() {
__typeof_unqual(int) x = 0;
}
```
That doesn't compile today.
```
<source>:2:4: error: expected expression
2 | __typeof_unqual(int) x = 0;
| ^
1 error generated.
Compiler returned: 1
```
I think the fix is to parse `tok::kw_typeof_unqual` everywhere that we
[14 lines not shown]
[SPIRV] Fix enqueue empty kernel (#187671)
Function reference arguments don't get spv_bitcast after opaque pointer
migration, while data pointer arguments still might. Therefore:
a. getBlockStructInstr() got updated to check G_GLOBAL_VALUE ->
G_ADDRSPACE_CAST pattern for function reference arguments;
b. buildEnqueueKernel() got updated to add bitcast the block literal
pointer from struct* to i8*, as required by OpEnqueueKernel.
---------
Co-authored-by: Arseniy Obolenskiy <gooddoog at student.su>
Co-authored-by: Marcos Maronas <mmaronas at amd.com>
Co-authored-by: Dmitry Sidorov <dsidorov at amd.com>
[lldb][Windows] Don't kill lldb when a thread fails to stop (#200805)
Replace `exit(1)` in `NativeProcessWindows::StopThread` with logging so
a single thread suspend failure no longer terminates lldb itself.