[SPIR-V] Avoid duplicate untyped pointer types per storage class (#232184)
Each type is cached under one key, and adding it under a pointee key
dropped its untyped pointer entry
Then the next lookup made a second copy and select mixing the copies
crashed
[Analysis] Remove virtual functions in RegionInfoBase (#231958)
MSVC C4661 warns about no suitable definition being provided for an
explicit template instantiation request. In the LLVM dylib build, MSVC
instantiates the extern template base of a dllexported class. This
triggers C4661 for base class templates whose members are only declared,
with their definitions in a separate header.
The above applies to the two derived classes for `RegionInfoBase`,
`RegionInfo` and `MachineRegionInfo`. However, the only virtual method
of importance for `RegionInfoBase` can be moved to the `RegionTraits`
template specializations, removing the need to have class-level
annotations in the derived classes. The other virtual method was the
destructor, which is no longer virtual and kept private, so the base
class can only be destroyed via its friend (derived) classes.
The effort to build LLVM as a dylib is tracked in #109483.
[Clang][counted_by] Don't re-evaluate the base of a counted_by pointer access for -fsanitize=array-bounds
When indexing a 'counted_by' pointer field with -fsanitize=array-bounds,
EmitCountedByBoundsChecking was handed an invalid address and re-emitted
the field's l-value to locate the count. That re-evaluated the struct
base, duplicating its side-effects:
struct p { int count; int *buf __counted_by(count); };
struct p *q;
int f(int i) { return q++->buf[i]; } // 'q' incremented twice
int g(int i) { return get()->buf[i]; } // 'get' called twice
i.e. enabling the sanitizer changed the program's behavior.
When the subscript base is exactly the field load, emit the field's
l-value once, load the pointer from it (as the default case of
EmitPointerWithAlignment does, through EmitLoadOfLValue so that a
'__ptrauth'-qualified field is still authenticated), and pass the
field's address to the bounds check. When there's an intervening cast (e.g.
[6 lines not shown]
[Clang][counted_by][NFC] Add missing tests for counted_by and __builtin_counted_by_ref
Add Sema coverage for __builtin_counted_by_ref:
- a bit-field counter on a 'counted_by' pointer (not just a FAM),
- the '_or_null' and 'sized_by' variants, which return 'void *',
- qualified, enum, and typedef counter types, which determine the
returned pointee type,
- nested, anonymous, by-value, and subscripted bases.
Add CodeGen coverage for the base-expression shapes reaching a counted_by
flexible array member, for both __builtin_dynamic_object_size and
-fsanitize=array-bounds: call and side-effecting bases (which __bdos
must not re-evaluate), pointer chains, conditional bases, negative
constant indices, enum counters, and mixed index widths.
Assisted-by: Claude Opus 5.5
[VPlan] Add missed maybe_unused to createSIVSteps (NFC) (#232216)
This was missed in bb12c270d7 ([VPlan] Strip IR trunc around IntOrFp
inductions, #231837).
TableGen: Store classes and defs in a StringMap (#231573)
Classes and defs were kept in a std::map ordered by name, which makes
every lookup a series of string comparisons over names that often share
long prefixes. Store them in a StringMap instead, and have getClasses()
and getDefs() return a list sorted by name, built when first needed
after records are added.
Gigainstructions executed by llvm-tblgen --null-backend
```
before after
AMDGPU.td 18.17 16.98 -6.6%
X86.td 6.15 5.84 -5.1%
AArch64.td 3.32 3.00 -9.7%
RISCV.td 8.26 7.44 -9.9%
```
Including the backends, all tablegen runs in a build of all targets and
[3 lines not shown]
Use failover.is_single_master_node in license delegates
This commit makes some changes where license delegates decided whether the node is the active controller by reading failover.status.get_local and the VIP rows themselves; they now use the existing failover.is_single_master_node check, same as the TNC heartbeat.
[Mips,RISCV,Sparc] Make options per-context (#232210)
Follow-up to #232170: drop perContext = false from MipsOptions,
MipsMCOptions, RISCVMCOptions, and SparcOptions. Their readers use
MCTargetOptions::LibraryOptions, and MipsOs16 uses its module's
LLVMContext.
LLM-aided
Firewall: NAT: Destination NAT - cleanup some more for https://github.com/opnsense/core/pull/10944
The backwards compat code was introduced ~10 years ago, which seems to be rather irrelevant these days.
Simplify port handling and fix typo in wellknown port handling
[mlir][math] Expose math patterns as transforms (#230042)
Adds math dialect transform ops to start exposing individual patterns.
Initially, f32 expansion and polynomial approximation patterns are
added.
The existing approximation test is converted from a test pass to the new
transform ops to unify usage.
Assisted-by: Claude
[AArch64][SME] NFC: Inline getCompatibilityForChangeToStreamingMode.
This removes the need for the `StreamingIncompatibility` enum and
makes the code a little simpler.
This PR also moves hasPossibleIncompatibleOps to AArch64TTIimpl,
so that we can query the costmodel in a follow-up PR.
IR: Speed up AttrBuilder merge (#232204)
AttrBuilder::merge added the attributes of the other builder one at a
time, each with a binary search and a vector insert into the sorted
list. Both lists are sorted, so merge them in one pass, as the TODO
suggested. This speeds up Attributor manifesting attributes.
Instructions spent in amdgpu-attributor
(opt, parse cost subtracted, median of 3 runs):
rocPRIM test_device_scan, gfx942: 1963M -> 1923M (-2.0%)
Blender Cycles HIP kernel, gfx1100: 636M -> 632M (within noise)
rocPRIM 16 tests, full LTO, closed world: 7415M -> 7273M (-1.9%)
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[DebugInfo] Remove more dead debug intrinsic handling (NFC) (#232180)
This patch removes more leftover code for legacy debug intrinsics:
- llvm::skipDebugIntrinsics, which is now an identity function at all
call sites, along with its unit test.
- Debug intrinsic checks in BasicBlock iteration helpers,
User::replaceUsesOfWith, and Verifier::visitDIAssignIDMetadata.
- Unused location-operand and address methods on DbgVariableIntrinsic
and DbgAssignIntrinsic that became dead after dropping the check in
User::replaceUsesOfWith.
Note that debug info is now represented with DbgRecord rather than
debug intrinsics outside the DirectX backend. Bitcode auto-upgrade
converts debug intrinsics to DbgRecords on load, and the DirectX
backend only materializes debug intrinsics late in DXILDebugInfo,
which strips DIAssignID metadata and does not use the removed code
paths.
Assisted-by: Antigravity
[clang] Migrate away from PointerUnion::dyn_cast (NFC) (#232179)
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:
// FIXME: Replace the uses of is(), get() and dyn_cast() with
// isa<T>, cast<T> and the llvm::dyn_cast<T>
Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses dyn_cast.
Note that loadAPINotes() returns false only after storing a nonnull
APINotesReader * in Readers[*Dir].
Assisted-by: Antigravity
update to py3-cryptodome-4.0.0, this is a nice major update with a move away
from GMP to their own constant-time big integers library, and a lot of other
improvements. See https://www.pycryptodome.org/src/changelog for more info.