[lldb][test] Fix 64-bit register assumption in wrapped frame test (#217659)
Added in #216840 / b0e9c530b5f0206de4a4f59f6728dbd5f10a5ca2.
This is failing on our downstream Arm 32-bit Linux bot:
```
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
* frame #0: 0x013d0630 a.out`compute(a=<unavailable>, b=<unavailable>) at main.c:3:10 [synthetic]
frame #1: 0x013d065c a.out`main at main.c:6:25
frame #2: 0xea2b739a libc.so.6`
frame #3: 0xea2b743e libc.so.6`__libc_start_main + 94
frame #4: 0x013d0538 a.out`_start + 40
Expecting sub string: "compute(a=3, b=4)" (was not found)
```
I have not had time to reproduce it locally, but I did notice that the
test packs a struct of registers using `Q` (8 bytes) regardless of
register size.
[6 lines not shown]
[DWARFLinker] Fix getContaingFile typo (NFC) (#217957)
Rename CompileUnit::getContaingFile to getContainingFile and update its
call sites in the parallel DWARF linker.
[CIR] Allow only CIR types in function signatures (#215922)
The calling convention lowering pass expects cir.func operations to
contain only CIR types in the signature. This change adds verifier
support to enforce that.
In the process, I discovered that it wasn't possible to walk the
subtypes of a CIR struct or union. The `AttrTypeSubElementHandler`
implementation to handle that (including the TODO comment) is copied
from the LLVM struct type handling.
Adding tests for this revealed a problem where if the `FuncType`
verifier reports an error, the `FuncOp` parser asserted. This change
fixes that by using `FuncType::getChecked()` to catch and report the
error.
[LLVMABI][AARCH64] Support transparent union arguments (#217686)
This adds support for using the first field in a transparent union for
the purposes of argument classification.
The `useFirstFieldIfTransparentUnion` function was already implemented
for the `X86_64TargetInfo` class. I moved it to the `TargetInfo` base
class because there is nothing target-specific about it.
Assisted-by: Cursor / various models
[llvm-objcopy] Stream ELF output to regular files
Write ELF output directly to seekable regular files instead of first allocating a buffer for the entire output. Keep buffered output for stdout and other non-seekable streams.
Use separate buffered and file-backed output implementations. Serialize regenerated metadata sequentially, seeking once per output range, and report sticky file errors after writing finishes. Truncate and extend seekable output up front so unwritten layout gaps read as zero without being materialized; explicitly overwrite only removed section contents within copied segments.
On a synthetic stamping-style ELF containing a 1 GiB payload, three warm-cache no-op copies had median peak RSS of 2,102,916 KiB before and 1,053,844 KiB after (49.9% lower). Median wall time improved from 1.06 s to 0.77 s, and the outputs were byte-identical.
Co-authored-by: Jeremy Braun <jtbraun at meta.com>
Assisted-by: OpenAI Codex
[Support] Support seekable temporary output streams
Use raw_fd_stream for temporary outputs so callbacks can perform positioned writes and resize the destination. Add raw_fd_ostream::takeError and raw_fd_stream::resize, and return stream failures through Error while preserving an existing destination.
Co-authored-by: Jeremy Braun <jtbraun at meta.com>
Assisted-by: OpenAI Codex
[llvm-objcopy] Route section copies through writeSectionContents
Centralize section byte copies behind a virtual helper so ELF output can later target either a memory buffer or a seekable stream. Materialize SHT_SYMTAB_SHNDX entries using the target ELF word type to preserve output endianness.
Co-authored-by: Jeremy Braun <jtbraun at meta.com>
Assisted-by: OpenAI Codex
[lldb] fix arm64e tests not compiling with an arm64e target (#216397)
Arm64eTestBase.build() only overrode TRIPLE, but ARCH_CFLAGS is a Make
command-line variable set separately by the test harness to a non-arm64e
flag. A plain in-Makefile assignment can't override a command-line
variable, so the compiler silently fell back to the host's default
(non-arm64e) triple and __ptrauth attributes failed to compile. Now
overrides ARCH_CFLAGS too.
[DAG] Remove trivial VP SDNodes. NFC
This removes the codegen parts of the trivial VP intrinsics. It's quite far reaching, but the general categories of code removed are:
- Removing definitions from VPIntrinsics.def
- Legalization and expansion code
- MatchContext used to match over both VP and non-VP nodes
- Some dead DAGCombines and folds in SelectionDAGBuilder
There are still more things to be cleaned up after this, e.g. removing more of the VPIntrinsic class hierarchy, removing ExpandVectorPredication/moving expansion into other places, removing MatchContext from SDPatternMatch
[DAG] Expand vp.*rem and vp.cttz.elts with non-vp nodes.
Trivial VP SDNodes will be removed in an upcoming patch. The division is still predicated so we avoid UB.
[IR] Remove trivial VP intrinsics. NFC
Trivial VP intrinsics are now all autoupgraded to their non-VP counterparts, so the intrinsics themselves are dead.
This removes the intrinsics and their corresponding LangRef definitions, as well as the VPIntrinsic subclasses and some methods in ExpandVectorPredication which are now dead. Removing the SDNodes is deferred to a separate patch.
[RISCV] Use SLLI+ADD for a select of constants that differ by a power of 2 in more cases. (#217812)
Previously we restricted to cases that can use ADDI, but we need
to materialize a constant for the czero+add lowering. Using slli
avoids materializing the delta constant.
I'm restricting to cases where we can't fold the comparison into
the czero.
[libc][math] Add some explicit macro checks to round and roundf. (#217822)
This will allow users to use them without going through our cmake build
checks or forcing the flag `__LIBC_USE_BUILTIN_ROUND`.