[RISCV][P-ext] Add RISCVISD::PWZIP for RV32. (#210134)
This node takes 2 32-bit vector inputs and produces a 64-bit vector
result. By extracting the subvector during lowering, we expose more
opportunities for optimizations.
[Android] Drop workarounds for older Android API levels pre 23 (#161893)
Drop workarounds for Android API levels pre 23.
The minimum Android API currently supported by the LTS NDK is 23.
[AArch64][COFF] Branch-protection=standard/pac-ret means "b-key" on Windows (#203989)
On AArch64 Windows the `B-key` is the only supported key for userspace,
let's make "standard" and "pac-ret" options generate "b-key".
Fixes: #203852
[Clang][Sema] Reland -Wstringop-overread with computeDependence fix (#208012)
Reland #183004 and follow-up #205201 (reverted in #207840) which adds `-Wstringop-overread` to warn when memory functions `memcpy`, `memmove`, `memcmp`, and other related builtins read more bytes than the source buffer size.
The revert was due to a crash when a memory function is called on `&x` where `x` is a static constexpr local inside a template. The original PR exposed a bug in `computeDependence(UnaryOperator*)` where only the value-dependence bit is set for this case, when the instantiation-dependence bit should also be set. This is the root cause behind the crash.
Fix `computeDependence` to properly set both value and instantiation-dependence bits, and add a regression for this crash via `warn-stringop-overread.c`.
CodeGen: Rename LibcallLoweringModuleAnalysisResult to ModuleLibcallLoweringInfo
Avoid putting pass manager flavored naming in this class. This is analagous to
TargetLibraryInfo's TargetLibraryInfoImpl.
Co-authored-by: Claude (Claude Opus 4.8) <noreply at anthropic.com>
[flang][cuda] Use managed allocation for saved locals (#210133)
Example:
```fortran
subroutine work
real, allocatable, save :: q(:)
allocate(q(10))
end
```
`SAVE` gives the local allocatable descriptor static storage. Implicitly
attributing it as Unified causes allocation to look it up as a
registered CUDA global, but no device symbol is registered for the
descriptor.
Fix: use Managed attribution for saved subprogram-local allocatables and
pointers, avoiding the invalid CUDA symbol lookup.
[TableGen] Short-circuit !cond operator (#208942)
Fixes #163213
TableGen `!cond` operator currently resolves all subsequent conditions
and values even if it already found a condition that resolves to `true`.
This change short-circuits on the first `true` resolution found
iterating from left to right. It folds a new `CondOpInit` with only the
conditions and values that have already been resolved, including the
current condition and value.
[libc] Implement alloca.h header (#210150)
Implemented the alloca.h header for LLVM libc.
* libc/include/llvm-libc-macros/alloca-macros.h: Defined alloca macro
using __builtin_alloca.
* libc/include/alloca.yaml: Added header specification.
* libc/include/CMakeLists.txt,
libc/include/llvm-libc-macros/CMakeLists.txt: Registered the new header
and macro targets.
* libc/config/linux/*/headers.txt: Enabled the header for Linux targets
(x86_64, aarch64, arm, i386, riscv).
* libc/test/include/alloca_test.cpp, libc/test/include/CMakeLists.txt:
Added and registered functional unit tests.
Tested by running the new unit and hermetic tests.
Assisted-by: Automated tooling, human reviewed.
[docs] Rewrite LLD docs to Markdown (#209897)
Tracking issue: #201242
This is a stacked PR based on #209894 , which will be a standalone
commit that renames *.rst -> *.md before this PR lands for history
preservation purposes. See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This was prepared with rst2myst plus LLM-assisted cleanup. I paged
through all the generated HTML looking for migration artifacts, and all
of the differences I could find appear to be formatting error
corrections. Please spot check my work and approve if it looks good.
[HLSL] Implement RWTexture2DArray (#208725)
Add front-end support for RWTexture2DArray, and update related tests to
include coverage of this resource.
Fixes #194947
---------
Co-authored-by: Tim Corringham <tcorring at amd.com>
[llvm-dwp] Fix endianness issues (#203424)
llvm-dwp fails on SystemZ, which is big-endian, as follows:
$ cat min.c
int main() {}
$ clang -g -O0 -gsplit-dwarf min.c -o min
$ llvm-dwp -e min -o min.dwp
error: compile unit exceeds .debug_info section range: 905969668 >= 58
This is because it hardcodes IsLittleEndian=true in multiple places. Fix
by forwarding endianness of the current object file.
Add a SystemZ-specific test.
Add proper big-endian support to X86/compress.test and add an
explanation regarding what the hardcoded blobs are and how they are
generated.
[lldb] Produce generic results for DWARF relational operations (#210122)
DWARF relational operations produce a generic result, whose width is the
target address size. LLDB currently assigns the C++ `bool` comparison
result directly to `Scalar`; because `Scalar` has no `bool` constructor,
this creates a 32-bit integer even on 64-bit targets.
The stricter binary operand checks added in #201288 exposed this in
x86-64 `_sigtramp` CFI. A later `DW_OP_plus` combines a 64-bit generic
address with the 32-bit relational result, so evaluation fails and
signal-frame unwinding stops. The generic-operand relaxation in #209641
does not cover this case because the relational result is narrower than
the address size.
Convert the results of `DW_OP_eq`, `DW_OP_ge`, `DW_OP_gt`, `DW_OP_le`,
`DW_OP_lt`, and `DW_OP_ne` through the existing `to_generic` helper.
## Testing
Add a unit test that evaluates each relational opcode with an 8-byte
address size and then consumes its result with `DW_OP_plus`.
[CIR] Fix use-after-free when emitting ternary with a throw-expression arm (#208850)
Fixes #208848.
When a conditional operator arm is a noreturn expression, such as
`throw`, `VisitAbstractConditionalOperator` saved an insertion point in
the empty dead-code block created after the expression. The intent was
to insert a `cir.yield` later, once the types of both arms were known.
However, `LexicalScope::cleanup()` removes that empty block when the
arm’s scope exits, leaving the deferred insertion point with a dangling
block pointer.
Avoid saving the insertion point for noreturn arms. These regions
already terminate with `cir.unreachable` and do not require a
`cir.yield`. The CIR verifier accepts ternary regions that terminate
with `cir.unreachable`.
Extended `ternary-throw.cpp` with scalar-rvalue cases covering `throw`
in either arm and in both arms. The existing tests only covered glvalue
conditionals, which take the LValue emission path and never reach this
code.