[ADT] Extract DenseMapStorage from DenseMap (NFC) (#226664)
This patch extracts the bucket and occupancy storage management from
DenseMap into a new helper class, densemap::detail::DenseMapStorage,
and updates DenseMap to use it via composition.
DenseMapBase::Rep is also moved to densemap::detail::StorageRep so
that DenseMapStorage::getRep() can return it directly.
This is part of the effort to replace CRTP in DenseMapBase with
composition (see #168255). I'm planning to post a similar patch for
SmallDenseMap before actually removing CRTP.
[CIR] Support type deduction builder for BinaryFPToFPBuiltinOp
For external consumer, it would be easier to have constructor without
type parameter. As a result, we add a new builder, which can deduct type
from lhs directly.
As emitBinaryFPBuiltin is the only consumer for CIR Codegen, it is fine
for internal usage.
[flang][OpenMP] Support allocate clauses on scope constructs (#221229)
Flang already lowers OpenMP 5.2 `allocate` clauses on `scope` constructs
to `omp.scope`, but LLVM IR translation previously rejected them.
This change maps allocation operands to their corresponding private or
firstprivate slots and reuses the existing allocator-backed
private-storage and OpenMPIRBuilder allocation/free paths.
Support is currently limited to host-side fixed-size intrinsic scalar
private and firstprivate variables, including SAVE variables and
individually listed COMMON-block members. Arrays, descriptors, pointers,
allocatables, derived types, named COMMON-block list items, and
target/device allocation remain unsupported.
[clang][NFC] Pass/Return `CharUnits` by value (#226115)
`CharUnits` is just an `int64_t`, but passed around by const reference
for some reason.
Also update the `CharUnits` documentation since we touch most of the
lines anyway (due to clang-format).
[CIR] Support type deduction builder for BinaryFPToFPBuiltinOp
For external consumer, it would be easier to have constructor without
type parameter. As a result, we add a new builder, which can deduct type
from lhs directly.
As emitBinaryFPBuiltin is the only consumer for CIR Codegen, it is fine
for internal usage.
[Clang][ExprConst] Drop PRValue for nothrow new (#226753)
A user defined operator new can accept prvalue for nothrow. However, it
should not be a ConstExpr. Early returns by
isUsableAsGlobalAllocationFunctionInConstantEvaluation instead of doing
LValue evaluation.
Also, move CheckPlacement new logic into new OpCode. This decouples
checking from Interp.cpp to Compiler.cpp.
[orc-rt] Rename lit %{jit} substitution to %{obj-jit}. (#226867)
This substitution jit-loads object files via llvm-jitlink. Future tests,
e.g. for lazy compilation, may want to JIT from other representations
and will need different substitutions. Rename now to make the intent
clear and save us renaming later.
[clang] clang-format two constructors (#226737)
I'd like to change these two in a patch, and the diff looks a bit
confusing since they aren't formatted yet. So format them in a prep
commit to make the diff clearer.
No behavior change.
[libc++][format] Don't leave the output buffer full after a bulk write (#226791)
__output_buffer::push_back writes a code unit before it makes room, so
the buffer must always have a free one. __copy, __transform and __fill
write in chunks of the available space and could end with the buffer
full. Formatting into a back_insert_iterator of a string, vector or
deque goes through a 256 code unit buffer, so an argument or fill whose
length is a multiple of 256, followed by a literal, wrote that literal
past the end of the buffer.
Make room in a full buffer at the end of these functions, as push_back
does.
Fixes #154670
[orc-rt] Rename os-version substitution. (#226863)
This substitution is available and being tested on all platforms. It's
currently only populated on Darwin, but may be useful on other
platforms, so rename it to reflect its role.
[MC] Add ELF::getSymbolInfo and fix bitwise OR between enumeration types. NFC (#226860)
`ELF::STT_FILE | ELF::STB_LOCAL` puts the binding in the type bits,
which only works because STB_LOCAL is 0.
It combines enumerators from two distinct unnamed enums, which is
deprecated in C++20 and ill-formed in C++26 (P2864R2).
[orc-rt] Prefix test tool output, update test. (#226862)
Prefix the triple, page-size, and cpu-features lines of the
orc-rt-process-info-check. The prefixes can be used to ensure that the
test doesn't try to match patterns against the wrong lines.
Also relaxes the feature string check to allow an empty feature string.
[AMDGPU][InstCombine] Fold zero dot operands to accumulator (#225003)
Fold AMDGPU dot intrinsics when either operand is zero.
`dot(a, 0) = 0` and `dot(0, b) = 0`, so replace the intrinsic with its
accumulator.
This avoids unrelated clamp and add/sub reassociation cases.
[SlotIndexes] Add queries for stale indexes
An erased instruction leaves its index list entry in place, making the
index indistinguishable from a block boundary entry. Add
isBlockBoundaryIndex() and isStaleIndex() to tell the two apart, and
canonicalizeIndex() to resolve a stale index to the closest preceding
instruction's register slot, or the block start if none survives.
NFC. No caller yet. LiveDebugVariables is next.
[LiveDebugVariables] Repair stale SlotIndexes
The analysis keeps its indexes from before the first register allocator
until DBG_VALUEs are emitted, by which point passes in between have
erased some of the instructions they point at. Resolve them at the
start of each allocator run and before emitting.
SlotIndexes can then reclaim the entries of erased instructions without
sparing the ones held here, which would have made generated code depend
on -g. Emitted locations are unchanged, except that intervals resolving
to one position now emit a single DBG_VALUE rather than identical
consecutive ones.
[Github] Add LLVM-libc's full-build to Bazel Checks workflow
This PR adds a job to run `bazelisk test --@llvm-project//libc:build_mode=full @llvm-project//libc/...`. It is part of an effort to support LLVM-libc's full build functionality in Bazel.
[bazel][libc] Refactor to allow copts under full-build mode
This PR moves away from having sets of predefined groups of copts and allows just directly using them. This lets the Bazel rules more directly parallel CMake.
[ORC] Call Perf/VTune support wrappers through Proxies (#226677)
Hold PerfSupportPlugin's start/end registration wrappers and
VTuneSupportPlugin's unregister wrapper as Proxy members, replacing
their callSPSWrapper calls. Each proxy is built in the constructor from
the address it already takes, so the constructor signatures are
unchanged. The Perf impl and VTune register wrappers are only used as
alloc-action tags and stay ExecutorAddrs.
[clang] Unique NamespaceAndPrefixStorages with a UniquingSet (NFC) (#224221)
This patch migrates NamespaceAndPrefixStorages in ASTContext from
llvm::FoldingSet to llvm::UniquingSet.
NamespaceAndPrefixStorage keys on a pair of const NamespaceBaseDecl *
and NestedNameSpecifier. Switching to UniquingSet allows us to look
up storages with a typed key, eliminating FoldingSetNodeID
serialization at lookup sites and removing
NamespaceAndPrefixStorage::Profile.
Assisted-by: Antigravity
[AMDGPU] Price scalar integer to fp casts by source width and sign
Scalar sources between a byte and 31 bits fell to the default cost of one
while the matching vector lanes were already priced, which skewed the
difference SLP weighs a bundle against. Such a source is extended before
the conversion, and what the extension takes depends on the width, on the
sign and on whether the subtarget has SDWA and 16 bit instructions.
Sources narrower than a byte are left alone, because their vector form is
not priced either.
[AMDGPU] Price narrow integer to bfloat vector casts
A vector lane of 9 to 15 or 17 to 31 bits converted to bfloat got the
generic cost, which leaves out the rounding. Such a lane is converted to
f32 first like any other narrow lane, so price it as the f32 conversion of
the same source plus the rounding. Lanes of 8 and 16 bits keep their cost.