[Attributor][NFC] Only seed AAAddressSpace if there is a flat address space (#241350)
Without a flat address space, `AAAddressSpace` gives up in `initialize`,
so seeding it for every load and store pointer is wasted. Skip seeding
in that case; it is still created on demand. Only the dependency-graph
test output changes.
CTMark with `-attributor-enable=full`: -0.05% (O3), -0.18% (ThinLTO).
Co-authored-by: Matt Arsenault <Matthew.Arsenault at amd.com>
Assisted-by: Claude Opus 5.5
[flang] Recognize SIMPLE prefix in purity checks (#232175)
Treat `SIMPLE` as a `PURE` prefix in `PurityChecker::HasPurePrefix`, as
required by F2023 15.8 p2.
Add regression tests for image control statements (C15109) and internal
subprogram purity (C15102).
Fixes #231353
Read TrueSearch exclusions from the file in the Time Machine test
truesearch_client reads the rows of the configuration file without
their exclusions. So the Time Machine test always saw no exclusion. The
test now reads the settings of each row from the file.
top: allow filtering by command name
top(1) already supports interactive command filtering using
the '/' key. Support it also with a command line
argument '-g' / '--grep'.
Reviewed by: kib
Obtained from: OpenBSD
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61160
[BPF] Diagnose unrepresentable BTF array bounds (#240545)
BTF encodes an array length as a 32-bit unsigned constant. Clang can
describe a variable-length array with a debug variable for the count.
Reading that count as an integer crashes the backend. A constant count
above UINT32_MAX is silently truncated.
Check each dimension before encoding it. After reporting an error,
register the array so enclosing types can finish resolving their
references. Keep the zero count used for flexible arrays and arrays with
no recorded dimensions.
Assisted-by: OpenAI Codex
security/py-keepkey: Fix Python 3 and protobuf compatibility
Regenerate protobuf modules at build time to fix import failures with
current protobuf. Use the device-protocol revision matching upstream
7.2.1, which includes the required Tendermint definitions.
Fix Python 2 remnants in keepkeyctl and protobuf_json, and support
the protobuf descriptor API changes. Remove the unused exchange
module, which depends on the obsolete protobuf3 library.
Switch to PEP 517, correct the package version metadata, add the
python category, and expand the port description. Bump PORTREVISION.
PR: 300278
NAS-140886 / 27.0.0-BETA.1 / Simplify `LongString` (#18887)
Our current `LongString` implementation boxes all strings in
`LongStringWrapper`. Sometimes it's transparent, but sometimes we need
to unbox it explicitly, which leads to quite ugly code. This is a better
implementation that does not need that.
(cherry picked from commit 4cab7ceb0073f176525771847ac013d1341b12c8)
(cherry picked from commit cfddcc8b0023a84720f84459479954fd8988152f)
NAS-140886 / 27.1.0 / Simplify `LongString` (by themylogin) (#20193)
Our current `LongString` implementation boxes all strings in
`LongStringWrapper`. Sometimes it's transparent, but sometimes we need
to unbox it explicitly, which leads to quite ugly code. This is a better
implementation that does not need that.
Original PR: https://github.com/truenas/middleware/pull/18887
Co-authored-by: themylogin <themylogin at gmail.com>
[LowerTypeTests] Append jump table aliases to llvm.used once (NFC) (#241146)
buildBitSetsFromFunctionsNative called appendToUsed for each
non-canonical, non-exported jump table alias. Each call rebuilt
llvm.used from scratch and left the old initializer behind as a dead
ConstantArray that still used all of its elements, so N aliases took
quadratic time and left O(N^2) dead uses on the aliases. Walking those
uses (e.g. in the verifier) cost a lot of build time.
Append the aliases just once after the loop instead. There's no change
to the output, but we remove the quadratic behavior. For a large
internal link with FullLTO and cross-DSO CFI, this change reduced the
overall link time from 24 minutes to 18 minutes, and peak RSS from 51
GiB to 28 GiB.
Assisted-by: Claude Opus 5.5
Co-authored-by: Nathan Lanza <nathanlanza at gmail.com>
[gn] Allow use_tsan in macOS buils (#241399)
This requires a host toolchain with a tsan runtime library. If you're
using a custom clang that doesn't have one, you can build it like:
ninja -C out/gn
lib/clang/24/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib
...and then copy that to your clang:
cp out/gn/lib/clang/24/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib \
path/to/lib/clang/24/lib/darwin/
(This also allows ios because a macOS build builds iOS runtime libs.
Without this, the runtime libs would error out. Nobody's likely to use
the runtime libs of a tsan build, but this seems like the simplest way
to make the build happy.)
[lld/mac] Store alloc'd order_file strings on stack, and do less work (#241367)
-order_file files can contain lines that optionally precede a symbol
name with an object file name (e.g. `foo.o:_foo`). This is very rare,
yet we always did some string manipulation. Now we early-exit if this
isn't used.
When it is used, we used to compute a temporary string for objects in
static archives and store it in a string saver. We never use that string
again, so instead store it on the stack. The main motivation here is
that I'd like to parallelize the code calling this function, and our
string saver isn't thread-safe. But it should also save some memory and
seems generally nicer.
No performance change for Chromium Framework. It uses an -order_file
with just a handful entries. If I create an order file with 1.5M entries
(one for each symbol in Chromium Framework), this change reduces link
time from 6.079s ± 0.134s to 5.557s ± 0.036s.
Order files that large are likely rare in practice.
No behavior change.
[ELF] -pie: Reject absolute references to copy relocations and canonical PLT (#240261)
In a PIE, a copy relocation or canonical PLT entry has a load-time
address. Since https://reviews.llvm.org/D66007 , an absolute reference
to one (e.g. R_X86_64_64 in .rodata, R_X86_64_32) is silently resolved
to the link-time address. Report an error unless the reference is
independent of the load base, matching GNU ld.
Fix #236441
[lld-macho] Check the architecture of bitcode and dylibs
ld64 checks bitcode and dylibs against the target architecture, not
just objects, and ignores a file for another architecture with a
warning, or reports an error with -arch_errors_fatal. It treats bitcode
like an object. It is laxer with dylibs and bundle loaders: an arm64
link takes any arm64e dylib, and an arm64e link takes arm64e dylibs
marked userland ABI version 0 or 1 (macOS executables are marked
version 1) and arm64e.x1 dylibs marked version 0. It checks the arm64e
slice of a fat dylib in the same way, but takes an arm64-only TBD in an
arm64e link.
lld checked neither. In an arm64e link it passed arm64 bitcode to LTO,
which compiled it without pointer authentication or failed, depending
on the input order, and it took dylibs of any architecture.
Check bitcode by its target triple and dylibs by their CPU type and
subtype, as ld64 does. Ignored dylibs get no load command.
Assisted-by: Claude Code
[mlir][ArmSVE] Scale the scalable dim index in LegalizeTransferRead (#239583)
`LegalizeTransferRead` collapses the trailing memref dims, from the
scalable one onwards, and reads from the collapsed memref. The index of
the scalable dim then indexes the collapsed dim, but it was kept as is,
so
```mlir
%A = vector.transfer_read %M[%i, %j, %k, %c0], %pad {in_bounds = [true, true]} : memref<?x?x?x8xi8>, vector<[4]x8xi8>
```
read from `%k` instead of `%k * 8`:
```mlir
%collapse_shape = memref.collapse_shape %M [[0], [1], [2, 3]] : memref<?x?x?x8xi8> into memref<?x?x?xi8>
%0 = vector.transfer_read %collapse_shape[%i, %j, %k], %pad {in_bounds = [true]} : memref<?x?x?xi8>, vector<[32]xi8>
```
This patch scales that index by the size of the dims collapsed into it.
[11 lines not shown]
[compiler-rt] mark padding [[maybe_unused]] (#241052)
-Wunused-private-field will soon be able to flag fields in instantiated
class templates. Land this in preparation.
Link: #237374