[SSAF][UnsafeBufferUsage] Make UnsafeBufferUsageExtractor a registered ASTConsumer (#191931)
- Removed UnsafeBufferUsageExtractor.h
- Registered UnsafeBufferUsageExtractor
- Changed unit tests to enable the extractor with
`HandleTranslationUnit`
- Fixed bugs in `UnsafeBufferUsageExtractor::HandleTranslationUnit`
---------
Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
[APINotes][unsafe-buffer-usage] Add [[clang::unsafe_buffer_usage]] support in APINotes (#189775)
Support the ``[[clang::unsafe_buffer_usage]]`` attribute in APINotes,
e.g.,
```
Functions:
- Name: myUnsafeFunction
UnsafeBufferUsage: true
```
rdar://171859135
[ROCDL] Add dot intrinsics to rocdl (#193129)
This patch adds dot intrinsic support to the rocdl dialect. Having these
(inc. follow up `amdgpu` wrapper) as first class citizens in MLIR will
allow us to lower thread local reductions involving `<=16bit` data more
effectively. This is in line with the spirit of `dot` intrinsic support
wrt existing edge dialects (`x86`, `nvvm`, `spirv`).
Assisted by: Claude
---------
Signed-off-by: Eric Feng <Eric.Feng at amd.com>
[lldb][test] Add support for building Wasm test inferiors (#192872)
This PR adds support for building the test inferiors to WebAssembly.
Specifically, it allows you to configure a sysroot and resource dir
(pointing at the WASI SDK). The Wasm runtime can be configured through
the `LLDB_TEST_USER_ARGS`.
```
LLDB_TEST_TRIPLE:STRING=wasm32-wasip1
LLDB_TEST_SYSROOT:PATH=/path/to/wasi-sdk-32.0-arm64-macos/share/wasi-sysroot
LLDB_TEST_RESOURCE_DIR:PATH=/path/to/wasi-sdk-32.0-arm64-macos/lib/clang/22/
LLDB_TEST_USER_ARGS:STRING=--setting;platform.plugin.wasm.runtime-path=/path/to/iwasm;--setting;platform.plugin.wasm.runtime-args=--heap-size=1048576;--setting;platform.plugin.wasm.port-arg=-g=
```
With the configuration listed above I was able to confirm that I could
build and run a handful of C and C++ tests. To set expectations: lots of
tests are unsupported because they rely on things not available in Wasm
(e.g. shared libraries) or they use features currently unsupported in
LLDB (most notably: expression evaluation).
[clang] Get the directory identity from `ModuleCache` instead of `FileManager` (#193070)
Using `FileManager`'s caching and deduplication functionality for
assigning identity to the module cache is handy, but it relies on two
assumptions:
* the rest of the compiler consistently calls
`FileManager::getOptionalDirectoryRef()` with `/*CacheFailure=*/false`
for the module cache path,
* the VFS is not caching failed stats for the module cache path.
This PR implements this functionality in the `ModuleCache` interface,
which is conceptually the right place for it. This PR enables us to land
the VFS simplifications in
https://github.com/llvm/llvm-project/pull/190843.
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
This patch also implements what's neceessary to allow overloading
on pure differences in instantiation dependence, making `std::void_t`
usable for SFINAE purposes.
This also readds a few test cases from da98651, which was a previous attempt
at resolving CWG2064.
Fixes #8740
Fixes #61818
Fixes #190388
[clang] Exclude trailing colons from param command names (#192598)
Doxygen accepts param names with trailing colons and they are omitted in
documentation. The comment parser includes the colon in the param name
thus including it in AST dumps. This patch removes a trailing colon and
adds a test for it.
Fixes #185378
[clang][NFC] Prevent scope pollution from repeat type specifiers (#193144)
Fixes #187664
When parsing `type-specifier {class,union,struct,enum,etc} nested-name`
ParseClassSpecifier and ParseEnumSpecifier both operated on the current
declaration scope on the assumption that they were the only type
specifier. Of course in incorrect code that assumption is false, and as
a result when parsing the name specifier they would pollute the the real
scope.
This is not relevant to the semantic correctness: the error is detected
and reported. The problem is that the subsequent state is not correct,
though not in a way that impacts functional behavior of release builds.
In assertion builds however this is detected (via a somewhat obtuse
path) when we attempt to plant namespace location information from the
invalid declaration on the initial declaration.
[2 lines not shown]
[SLP]Fix stale deps for operands of non-scheduled expanded-binop parents
When a parent tree entry does not require scheduling and contains an
expanded binop (e.g. `shl x, 1` modelled as `add x, x`), it never gets
a bundle. So, the operand's `ScheduleData::Dependencies` keeps the count
from the first sibling's `tryScheduleBundle` and misses later-added
entries sharing the same expanded scalar. At real scheduling,
`schedule()` then issues decrements for every current containing entry
and trips `UnscheduledDeps >= 0`.
Fixes #193040
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/193265
[CIR] Implement variably modified type parameter handling (#193072)
CIR was missing checks for variably modified types in its function
handling, so if one of the function arguments was a variable-length
array, we weren't recording the VLA size and hitting an assertion when
we later try to retrieve the VLA size from our map. One dimensional VLAs
are passed as pointers to the array type rather than as variably
modified types, so that didn't trigger the error.
[AArch64][llvm] Improve codegen for svldr_vnum_za/svstr_vnum_za
When compiling `svldr_vnum_za` or `svstr_vnum_za`, the output
assembly has a superfluous `SXTW` instruction (gcc doesn't add
this); this should be excised, see https://godbolt.org/z/sz4s79rf8
In clang we're using int64_t, and `i32` in llvm. The extra `SXTW`
is due to a call to `DAG.getNode(ISD::SIGN_EXTEND...)`. Make them
both 64bit to make the extra `SXTW` go away.
[RISCV] Expand vp.frem (#193218)
As far as I can tell we've never supported lowering vp_frem and
currently crash. The only test that covers it has the evl set to zero so
it's folded to undef. By expanding it to regular frem we can use the
libcall expansion
AMDGPU: ds.atomic.barrier.arrive.rtn.b64 is a source of divergence (#192765)
This intrinsic decrements the barrier's pending count and returns the
old value.
[flang][OpenACC] Limit hoisting out of compute operations. (#193099)
When a compute operation is nested inside a loop-like operation,
LICM for nested regions may hoist operations that are illegal to hoist,
e.g. operations with reference operands/results should not be hoisted,
in general. This patch limits the hoisting for kernel, parallel and
serial.