[flang][cuda] Keep cycle-broken device globals defined (#211897)
Breaking cyclic global initializers by removing an initializer produced
an
external declaration, which could leave references unresolved during
device
linking.
Replace selected cyclic initializers with zero initializers instead.
This
breaks the NVPTX dependency cycle while preserving device symbol
definitions.
[Sema] Skip expansion statements when determing local extern context (#210512)
This bug showed up as a failed assertion that was asserting that if
not in a function or method context we should be in the global/file
context.
The root cause is that when determining the linkage context for a
decl we were failing to account for the existence of expansion
contexts. Ignoring the assertion failure, the functional effect of
this is that we would fail to detect incorrect local extern
declarations inside expansion contexts. The fix here is to make
sure that we use `getEnclosingNonExpansionStatementContext()` to
find the true DeclContext for the current scope.
The initial report only identified local extern function declarations
but the same bug occurred with extern var decls, but the path did
not lead to an assertion firing, just incorrect behaviour.
Thanks to Sirraide for explaining why this was going wrong, and
[3 lines not shown]
[BOLT] Fix strict mode bug in removal of block referenced by JT
Summary:
BOLT can create a jump table object from a PC-relative
operand reference (e.g. leaq JT(%rip)) whenever the referenced memory
looks like a PIC jump table -- see
BinaryContext::handleAddressRef. This is independent of whether BOLT
recognizes the indirect jump dispatch itself. The jump table
annotation is only attached to the jmp instruction later, in
BinaryFunction::analyzeIndirectBranch, and only when the
target-specific analyzeIndirectBranch matcher recognizes the dispatch
pattern.
If the matcher does not recognize the pattern, the annotation is never
attached to the jmp, even though the jump table object and its entries
exist and reference basic blocks in the function.
In strict mode BOLT still fully processes such a function: it stays
simple, the block is marked as having unknown control flow, and the jump
[12 lines not shown]
news/inn, news/inn-current: Add p5-DBD-SQLite RUN_DEPENDS for SQLITE
ovsqlite-util needs DBI with the DBD::SQLite driver. Declare it under
the SQLITE option so the utility works out of the box.
news/inn, news/inn-current: Switch BERKELEYDB to db18
databases/db5 is EOL. Depend on databases/db18 instead and document
the in-place ovdb_init -u upgrade for ovdb overview users.
PR: 279151
[libc][cpp::string] Do not include null terminator in capacity()
Currently, `capacity()` includes the null terminator of the backing buffer, which does not align with C++20's `std::string`. That is, `s.reserve(s.capacity())` should be a no-op. While there's no requirement these be in-sync, it is less surprising to align its behavior.
Also, this fixes the case where `reserve()` is called on an empty string, where previously the null terminator was not set.
[BOLT] Release pseudo-probe decoder after emit
Summary:
PseudoProbeRewriter builds sizable data structures and then
hold onto them after they are needed.
PseudoProbeRewriter::postEmitFinalizer() parses the input
.pseudo_probe sections into an MCPseudoProbeDecoder whose
address-to-probe and GUID-to-function-desc maps can be very large
(tens of GiB on big binaries with many probes). This is not used again
once probes have been updated, yet they survive into the memory-heavy
DWARF rewrite (updateDebugInfo), directly inflating BOLT's peak RSS at
the worst possible time.
This frees them at the end of the postEmitFinalizer() calls, before
updateDebugInfo runs.
[ProfileData] Split EagerSampleProfileNameTable by key type (NFC) (#211126)
This patch splits EagerSampleProfileNameTable into two separate
classes, EagerStringSampleProfileNameTable and
EagerMD5SampleProfileNameTable. This patch is meant to be a
preparation patch for centralizing and speeding up symbol membership
queries like "is this symbol in the name table?".
Currently, we have two problems with these membership queries:
- Customers build their own data structures like DenseSet<uint64_t> of
MD5 values and StringSet<> to serve those queries. That is, the
sample profile loader does not directly serve those queries.
- There are two places, namely SampleProfileLoader::doInitialization
and SampleProfileNameSet, where we build identical StringSet<> of the
name table entries, costing compilation time at both construction and
destruction time.
[17 lines not shown]
wip/hawk-scheme: import hawk-0.9 as wip/hawk-scheme
Hawk is a tracing JIT compiler for Scheme. It includes a bytecode
compiler, runtime, garbage collector, interpreter, trace recorder, and native
code emitters for x86-64 and aarch64.
wip/hawk-scheme: Fix "hawk --exe" compiler.
The compiler needs clang with the correct library paths.
The executable still needs "paxctl +m", which is not
fixed yet.
[Sema] Skip expansion statements when determing local extern context (#210512) (#211745)
This bug showed up as a failed assertion that was asserting that if
not in a function or method context we should be in the global/file
context.
The root cause is that when determining the linkage context for a
decl we were failing to account for the existence of expansion
contexts. Ignoring the assertion failure, the functional effect of
this is that we would fail to detect incorrect local extern
declarations inside expansion contexts. The fix here is to make
sure that we use `getEnclosingNonExpansionStatementContext()` to
find the true DeclContext for the current scope.
The initial report only identified local extern function declarations
but the same bug occurred with extern var decls, but the path did
not lead to an assertion firing, just incorrect behaviour.
Thanks to Sirraide for explaining why this was going wrong, and
[2 lines not shown]
[LifetimeSafety] Support field-sensitivity in lifetime tracking
This patch enables field-sensitivity when tracking lifetimes of nested objects.
- FactsGenerator now generates `PathElement::getField` for `MemberExpr` accesses, mapping fields to loans.
- LoanPropagation now propagates field paths along flow facts, appending fields to base loans.
- Removes false-positive warnings in `invalidations.cpp` where modifications to one field were incorrectly reported as invalidating iterators/pointers to another field.
- Adds comprehensive unit tests checking nested field access and placeholder fields.
TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
[LifetimeSafety] Support container interior paths and invalidations
This patch completes the implementation of path-sensitive lifetime tracking by supporting container interior paths (`.*`) and deep-nested invalidation.
- Enables `PathElement::getInterior` generation in `FactsGenerator` for GSL Owners and Views (e.g. member functions, function parameters, lambda captures).
- Removes bypass checks in `FactsGenerator::handleInvalidatingCall` to track container invalidation on fields.
- Updates `Checker` to use strict prefix comparison (`isStrictPrefixOf`) for container invalidations, ensuring invalidation of container contents (interior) correctly invalidates iterators but not other sibling fields.
- Reorganizes tests in `invalidations.cpp` by resolving duplicates and distributing them logically.
- Updates unit tests and sema tests with correct expectations for interior paths.
TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23