[AArch64] Mark X16 as clobbered in PAUTH_EPILOGUE for hint-based PAuthLR (#175991)
When users request branch protection with PAuthLR on targets that do not
support the PAuthLR instructions, the PAUTH_EPILOGUE falls back to using
hint-space instructions. This fallback sequence uses X16 as a temporary
register, but X16 was not listed in the clobber set.
Because Speculative Load Hardening uses X16, this omission made SLH
incompatible with this PAUTH_EPILOGUE path.
Mark X16 as clobbered so the compiler does not assume X16 is preserved
across the epilogue, restoring compatibility with Speculative Load
Hardening and avoiding incorrect register liveness assumptions. The
clobber is added in C++ rather than TableGen, as X16 is only clobbered
when PAuthLR is requested as a branch protection variation and should
not be treated as clobbered unconditionally.
[NFC][SPIR-V] Fix logical-struct-access.ll to pass spirv-val validation (#191792)
OpReturnValue with a pointer type is invalid in SPIR-V Logical
addressing model (Vulkan). The functions in the test return
OpAccessChain results, which are pointers
related to https://github.com/llvm/llvm-project/issues/190736
[libc] Add Annex K strnlen_s function (#186112)
This patch adds the `strnlen_s` function from Annex K.
In order to reduce duplication between `strnlen` and `strnlen_s`, the
common logic has been extracted to a new internal function which both
now call.
In addition to the function definition, the patch adds a unit test and a
fuzzing test.
[TySan][Sanitizer Common] Enable TySan testing in the sanitizer commo… (#191385)
…n test suite
Secondary pr to enable tests after
https://github.com/llvm/llvm-project/pull/183310 enables the features
[flang][NFC] Converted five tests from old lowering to new lowering (part 43) (#191753)
Tests converted from test/Lower/Intrinsics: transpose.f90,
transpose_opt.f90, trim.f90, ubound.f90, ubound01.f90
[MLIR][LLVMIR] Handle MDTuple-of-MDStrings module flags (e.g. riscv-isa) (#188741)
The "riscv-isa" LLVM module flag stores its value as an MDTuple
containing MDStrings (e.g. `\!{\!"rv64i2p1", \!"m2p0"}`). Previously,
this fell through the unrecognized-key path in
`convertModuleFlagValueFromMDTuple`, which emitted a warning and dropped
the flag during import.
This patch adds generic handling for MDTuples whose operands are all
MDStrings:
- Import: convert to `ArrayAttr<StringAttr>` in
`convertModuleFlagValueFromMDTuple`
- Export: convert `ArrayAttr<StringAttr>` back to an MDTuple of
MDStrings in `convertModuleFlagValue`, enabling a lossless round-trip
- Verifier: allow `ArrayAttr<StringAttr>` as a valid `ModuleFlagAttr`
value for keys not otherwise handled by specific verifier branches
Fixes #188122
Assisted-by: Claude Code
[lldb] Add binary multiplication, division, remainder to DIL (#187281)
Add binary arithmetic multiplication, division, remainder to DIL.
This patch also passes DILMode to the parser to check if binary
multiplication is allowed by the mode. This cannot be done in the lexer
alone, because it allows token `*` as a dereference operator for legacy
mode, but that token could also be a binary multiplication allowed only
in full mode.
[MLIR][ODS] Error on optional attribute used outside optional group in assemblyFormat (#188726)
Using an optional attribute directly in assemblyFormat (e.g., `$attr
attr-dict`) without wrapping it in an optional group causes the
generated printer to call `printAttribute` with a null `Attribute` when
the attribute is absent. This leads to a crash in the alias initializer
when it calls `getAlias` on a null attribute.
Add a validation check in `OpFormatParser::verifyAttributes` that
detects this pattern and emits a diagnostic error with a helpful note
pointing users to the correct `($attr^)?` syntax.
Fixes #58064
Assisted-by: Claude Code
[lldb][Process/FreeBSDKernelCore] Improve error handling (#191423)
Improve error handling with the following changes:
- If `kvm_open2()` fails in `DoLoadCore()`, log error with a message
obtained from the function.
- Return false or continue for loop if memory read fails.
- Rename `!error.Success()` to `error.Fail()` for readability (NFC).
Signed-off-by: Minsoo Choo <minsoochoo0122 at proton.me>
[compiler-rt] clang-cl: skip MSVC external-header probe; -std=c++ for unit-test compiles (#191564)
1. `check_cxx_compiler_flag` marked `COMPILER_RT_HAS_EXTERNAL_FLAG` true
for clang-cl, so `/experimental:external` and `/external:anglebrackets`
were passed and clang-cl warned they were unused. Now only probe with
real MSVC (not Clang); set the flag false otherwise; rely on that in
asan/interception/ubsan.
2. Custom compile lines for unit tests didn’t get C++17, so headers hit
`-Wc++17-extensions` (e.g. `constexpr if` / message-less `static_assert`
in FuzzedDataProvider / asan_fake_stack). Now append
`-std=c++${CMAKE_CXX_STANDARD}` or `-std=c++17` for C++ sources in
`clang_compile()` for both standalone and non-standalone builds.
[MLIR][SPIRV] Deduce Shader capability for DescriptorSet/Binding decorations (#188743)
UpdateVCEPass only queried capabilities via QueryCapabilityInterface and
SPIRV type capabilities, but did not check capabilities implied by
decoration attributes on ops. Specifically, the DescriptorSet and
Binding decorations—represented by the `binding` and `descriptor_set`
attributes on `spirv.GlobalVariable`—require the `Shader` capability per
the SPIR-V spec Decoration table, but this was not deduced.
Add an explicit check in UpdateVCEPass: when a `spirv.GlobalVariable`
has a `binding` or `descriptor_set` attribute, require the `Shader`
capability.
Part of #168357
Assisted-by: Claude Code
[clang][test] Fix 32-bit bot failures after cc419f185e13 (#191551)
Use `{{.*}}` instead of `i64` for `memset` size type, as 32-bit
platforms use `i32`.
[LangRef] Correct description of predicate.enable MD (#191496)
The documentation incorrectly stated that this metadata enables/disables
vectorization, but it actually controls predication.
Also clarify that enabling predication implicitly enables vectorization.
[SPIR-V] Add Int64ImageEXT capability for OpTypeImage with 64-bit integer sampled type (#190742)
Fix spirv-val failure:
```
error: line 20: Capability Int64ImageEXT is required when using Sampled Type of 64-bit int
%spirv_Image = OpTypeImage %ulong 3D 0 0 0 0 Unknown ReadOnly
```
Detect when OpTypeImage uses a 64-bit integer as its sampled type and
automatically add the Int64ImageEXT capability and
SPV_EXT_shader_image_int64 extension
related to https://github.com/llvm/llvm-project/issues/190736
[NFC][SPIR-V] Use PatternMatch combinators in SPIRVEmitIntrinsics (#189554)
Replace `dyn_cast<IntrinsicInst> + getIntrinsicID()` chains with
PatternMatch combinators where applicable
[AArch64][GISel] Clamp bitcast to v2i64 (#191360)
This helps to not lower, improving the number of nodes that we expand
into and improving the quality of the generated code.
Originally a part of #177158 by Ryan Cowan