[Clang] Add macro for `__VULKAN__` environment (#196103)
Summary:
Adds a macro like for `__LINUX__` or `__WIN32`. The intention here is to
let code differentiate between vulkan variants or not.
[AArch64][GlobalISel] Remove fconstant_to_constant, moving it to reg-bank-select. (#194778)
This removes the fconstant_to_constant post-legalizer lowering combine,
moving it to where it belongs in reg bank select. The result should be
mostly be no change in generated code.
[mlir][linalg] Fix crash in FoldAddIntoDest on block-arg operands (#195150)
`isDefinedAsZero` was vulnerable to a classic "passing an unchecked
`Operation *` to `TypeSwitch`".
[AArch64][llvm] Simplify and dedupe hint alias parsing code (NFC)
The code which handles instructions that are aliased in the `HINT`
encoding space is very similar and repetitive.
Move common code into templated functions, so that it's consistent and
simpler, whilst still remaining readable.
This also means any future instructions added in the `HINT` space will
be simpler to implement. Net removal of ~86 lines of code.
NFC, apart from a word change in the `tsb csync` error diagnostic
[Clang] Permit `vulkan` as an OS for the SPIRV target architecture (#196101)
Summary:
This is currently rejected in two places, the toolchain creation and the
target itself. For the target we just permit it in the same way we alloe
things like 'amdhsa'. For the driver, the current handling just assumed
everything with 'vulkan' was HLSL. This shouldn't be true so we check
the source file type, and only push through actual HLSL files.
This is intended to more canonically support the 'CLSPV' target that
google has.
[libc] Add byteswap.h header with bswap_16/bswap_32/bswap_64 (#196278)
Added the Linux byteswap.h header providing bswap_16, bswap_32, and
bswap_64 as macros expanding to __builtin_bswap{16,32,64}. These are
always inlined by the compiler to single instructions.
Follows the existing endian.h / endian-macros.h pattern.
Assisted-by: Automated tooling, human reviewed.
[mlir][Interfaces] Fix -Wunused-function (#196314)
These functions are only used inside assert statements, so mark them
[[maybe_unused]] to prevent -Wunused-function when they are used in a
non-asserts build.
[clangd] Fix crash on completion with out-of-range position (#196112)
shouldRunCompletion() checked the Expected<> from positionToOffset() via
operator!() but never consumed the error with takeError(). This caused
an assertion failure when a TriggerCharacter completion request had a
position beyond the document bounds.
LLM was used to generate the unit test.
Fixes: #196072
[libcxx] Remove _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS (#196141)
This was only necessary for ASan container annotations for short
strings. Remove it now that we do not support ASan container annotations
on short strings to:
1. Not suppress Asan on other violations, e.g. std::string::size() on
dead object.
2. Make the code a bit more clean.
Short string annotations were removed in
https://github.com/llvm/llvm-project/pull/194208.
Revert "[SCEV] Introduce loop-uniform SCEV classification." (#196297)
Reverts llvm/llvm-project#194304, as it caused failed asserts - see that
PR for reproducers.
[compiler-rt] Enable ubsan_minimal runtime for SPIR-V (#196149)
The SPIR-V target support for UBSan Minimal Runtime is added to provide
basic undefined behavior detection capabilities for SPIR-V based
devices.
Currently, only the `spirv64` target is supported.
[lldb][test] Add missing include to char16/32_t test (#196300)
Fixes 605feeda1e50aa0064947e64d66d3351b9f9693e / #195514. Failed to
build on AArch64 Linux without it.
Thread Safety Analysis: Fix implicit member access in attributes (#194457)
SExprBuilder previously translated DeclRefExprs referring to FieldDecls
as plain global references (til::LiteralPtr), ignoring the base object.
This caused false positives when members were accessed implicitly (such
as in C, or parameter attributes in C++) because the context of the
parent object was lost.
Fix this by using translateCXXThisExpr() to evaluate SelfArg into a base
expression when translating a DeclRefExpr to a FieldDecl. This makes the
analysis behave correctly for implicit member accesses in attributes.
Assisted-by: Gemini 3 (for debugging and review)
[AArch64][llvm] Add missing form for `LD64B`/`ST64B` instructions
`LD64B` and `ST64B` should be defined as follows[1]:
```
LD64B <Xt>, [<Xn|SP> {,#0}]
```
but they're missing the form that allows a zero immediate offset,
for example:
```
ld64b x2, [x13, #0]
st64b x16, [x13, #0]
```
Add support for zero immediate offsets for these instructions.
[1] https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/LD64B--Single-copy-Atomic-64-byte-Load-
[AArch64][llvm] Some instructions should be `HINT` aliases (NFC)
Implement the following instructions as a `HINT` alias instead of a
dedicated instruction in separate classes:
* `stshh`
* `stcph`
* `shuh`
* `tsb`
Updated all their helper methods too, and updated the `stshh` pseudo
expansion for the intrinsic to emit `HINT #0x30 | policy`.
Code in AArch64AsmPrinter::emitInstruction identified an initial BTI using a
broad bitmask on the HINT immediate, which also matched shuh/stcph (50..52)
This could move the patchable entry label after a non-BTI instruction.
Replaced it with an exact BTI check using the BTI HINT range (32..63) and
AArch64BTIHint::lookupBTIByEncoding(Imm ^ 32).
A following change will remove duplicated code and simplify.
[2 lines not shown]
[libc++][NFC] Remove unused #define (#195831)
We've removed the use of
`_LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE` a while ago, but
didn't remove the `#define` for it.