Commit Graph

538927 Commits

Author SHA1 Message Date
Ross Brunton
7e9d708be0 [Offload] Use llvm::Error throughout liboffload internals (#140879)
This removes the `ol_impl_result_t` helper class, replacing it with
`llvm::Error`. In addition, some internal functions that returned
`ol_errc_t` now return `llvm::Error` (with a fancy message).
2025-05-27 13:42:56 -05:00
Farzon Lotfi
909212feec [DirectX] Scalarize Allocas as part of data scalarization (#140165)
- DXILDataScalarization should not just be limited to global data
- Add a scalarization for alloca
- Add ReversePostOrderTraversal of functions and iterate over basic
blocks and run DataScalarizerVisitor.
- fixes #140143
2025-05-27 14:23:29 -04:00
LRFLEW
6a738f6cf7 [libc++] Fix directory name in libcxx rand.dist tests path (#140160)
The path libcxx/test/libcxx/numerics/rand/rand.dis was missing the
't' in rand.dist.
2025-05-27 14:13:21 -04:00
Jacob Lalonde
9d33b92913 Revert "[LLDB][ELF Core] Support all the Generic (Negative) SI Codes." (#141645)
Reverts llvm/llvm-project#140150

Broke the Darwin tests, but they pass on Linux. Reverting to make the
build healthy while I investigate
2025-05-27 10:55:59 -07:00
Helena Kotas
20f1e351c7 [HLSL] Add resource name argument to resource class constructors (#139985)
Adds resource name argument to resource class constructors and to builtin functions that initialize resource handles
`__builtin_hlsl_resource_handlefrombinding` and `__builtin_hlsl_resource_handlefromimplicitbinding`.

Part 1/4 of https://github.com/llvm/llvm-project/issues/105059
2025-05-27 10:41:04 -07:00
Eugene Epshteyn
66a2d4b1e7 [flang] Ensure that the integer for Cray pointer is sized correctly (#140822)
The integer used for Cray pointers should have the size equivalent to
platform's pointer size.
2025-05-27 13:08:35 -04:00
Michael Buch
9392652226 [lldb][docs][NFC] Remove references to obsolete gnu-libstdc++ category (#141610)
This is still leftover from the days when the libc++ and libstdc++
formatters were both written in python and in separate categories. Since
then we group libstdc++ and libc++ formatters into the same cateogry.

This patch removes references to the obsolete `gnu-libstdc++` category
from the docs (and a test).

See [this
thread](https://github.com/llvm/llvm-project/pull/140761#discussion_r2102386080)
for more context
2025-05-27 18:08:17 +01:00
Andreas Jonson
58ead2cee8 [ValueTracking] Support trunc nuw condition in isImpliedCondition (#141528)
Proof: https://alive2.llvm.org/ce/z/oqQyxC
2025-05-27 18:53:29 +02:00
Arthur Eubanks
5ab017a30f [PGO] Don't unconditionally request BBInfo in verifyFuncBFI() (#140804)
This breaks in the case where there are unreachable blocks after an
entry block with no successors, which don't have a `BBInfo`, causing
crashes.

`BBInfo` doesn't exist for unreachable blocks, see
https://reviews.llvm.org/D27280.

Fixes #135828.
2025-05-27 09:47:08 -07:00
Mingming Liu
eb79e340a1 [NFCI] Clean up idempotent stack pop for inline context (#141544)
In the top-of-tree, the stack pops at L414-416 [1] are no-op since there
are prior stack pops at L400-402.

[1]
e015626f18/llvm/lib/ProfileData/SampleProfReader.cpp (L414-L416)
[2]
e015626f18/llvm/lib/ProfileData/SampleProfReader.cpp (L400-L402)
2025-05-27 09:41:54 -07:00
Mingming Liu
15c3adee9f [NFCI]Print LineLocation using its print method to simplify the code. (#141545) 2025-05-27 09:41:28 -07:00
Brox Chen
04eaf6123d [AMDGPU][True16] set true16 mode as default on gfx110x (#140736)
Add RealTrue16Insts to FeatureISAVersion11_0_Common and set true16 mode
as default on gfx110x.
2025-05-27 12:40:49 -04:00
Baranov Victor
e0b19592b2 [clang][AST][NFC] fix spelling typos in clang AST files (#141346) 2025-05-27 19:33:10 +03:00
Jacob Lalonde
ff7bb17c88 [LLDB][ELF Core] Support all the Generic (Negative) SI Codes. (#140150)
Recently, I was on an issue that generated a large number of Coredumps,
and every time in both LLDB and GDB the signal was just `SIGSEGV`.

This was frustrating because we would expect a `SIGSEGV` to have an
address, or ideally even bounds. After some digging I found the
`si_code` consistently was -6. With some help from
[@cdown](https://github.com/cdown), we found neither LLDB or GDB
supports the si_codes sent from [user
space](https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/siginfo.h#L185).

Excerpted from the sigaction man page.
```
       For a regular signal, the following list shows the values which
       can be placed in si_code for any signal, along with the reason
       that the signal was generated.
```

For which I added all of the si_codes to every Linux signal. Now for the
Coredump that triggered this whole investigation we get the accurate and
now very informative summary.

<img width="524" alt="image"
src="https://github.com/user-attachments/assets/5149f781-ef21-4491-a077-8fac862fbc20"
/>


Additionally from @labath's suggestion to move this to platform and
leverage the existing `getSiginfo()` call on thread, we can now inspect
the siginfo struct itself via `thread siginfo`. Giving us another
towards GDB parity on elf cores.
2025-05-27 09:13:50 -07:00
Kazu Hirata
f3b404be97 [TableGen] Fix a warning
This patch fixes:

  clang/utils/TableGen/ClangBuiltinTemplatesEmitter.cpp:25:8: error:
  'llvm::StringSet' may not intend to support class template argument
  deduction [-Werror,-Wctad-maybe-unsupported]
2025-05-27 09:08:45 -07:00
LLVM GN Syncbot
09213afb82 [gn build] Port 5a4571133a 2025-05-27 15:55:32 +00:00
cor3ntin
50937ebff3 [Github] Tweak the good-first-issue message not to require assignment. (#139858)
New contributors can just indicate that they are working on the issue
without requesting assignment.

That shouldd reduce the burden of assigned issues that are not actually
being worked on, and new contributors waiting for a maintainer to
asssign them the issue.

---------

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-05-27 17:50:46 +02:00
Cassandra Beckley
5a4571133a [HLSL] Implement SpirvType and SpirvOpaqueType (#134034)
This implements the design proposed by [Representing SpirvType in
Clang's Type System](https://github.com/llvm/wg-hlsl/pull/181). It
creates `HLSLInlineSpirvType` as a new `Type` subclass, and
`__hlsl_spirv_type` as a new builtin type template to create such a
type.

This new type is lowered to the `spirv.Type` target extension type, as
described in [Target Extension Types for Inline SPIR-V and Decorated
Types](https://github.com/llvm/wg-hlsl/blob/main/proposals/0017-inline-spirv-and-decorated-types.md).
2025-05-27 11:40:54 -04:00
Andrzej Warzyński
58f80536d3 [mlir][linalg] Consolidate tests for scalable vectorization (#141469)
This patch moves scalable vectorization tests into an existing generic
vectorization test file:
  * vectorization-scalable.mlir --> merged into vectorization.mlir

Rationale:
  * Most tests in vectorization-scalable.mlir are variants of existing
    tests in vectorization.mlir. Keeping them together improves
    maintainability.
  * Consolidating tests makes it easier to spot gaps in coverage for
    regular vectorization.
  * In the Vector dialect, we don't separate tests for scalable vectors;
    this change aligns Linalg with that convention.

Notable changes beyond moving tests:
  * Updated one of the two matrix-vector multiplication tests to use
    `linalg.matvec` instead of `linalg.generic`. CHECK lines remain
    unchanged.
  * Simplified the lone `linalg.index` test by removing an unnecessary
    `tensor.extract`. Also removed canonicalization patterns from the
    TD sequence for consistency with other tests.

This patch contributes to the implementation of #141025 — please refer
to that ticket for full context.
2025-05-27 16:39:56 +01:00
Kajetan Puchalski
09a70b1e10 [flang-rt] Explicitly define the default ShallowCopy* templates (#141619)
Not explicitly defining the default case for ShallowCopy* functions does
not meet the requirements for gcc to actually instantiate the templates,
leading to build errors that show up with gcc but not with clang.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
2025-05-27 16:38:48 +01:00
Aaron Ballman
cc5237c7af [C2y] Correctly handle incomplete types in generic selections (#141596)
We were emitting a non-error diagnostic but claiming we emitted an
error, which caused some obvious follow-on problems.

Fixes #141549
2025-05-27 11:29:30 -04:00
Luke Lau
97f6076ded [VectorCombine][X86] Use updated getVectorInstrCost hook (#137823)
This addresses a TODO where previously scalarizeBinopOrCmp
conservatively bailed if one of the operands was a load.

getVectorInstrCost was updated to take in values in
https://reviews.llvm.org/D140498 so we can pass in the scalar value to
be inserted, which should return an accurate cost for a gather.

To prevent regressions on x86 this tries to constant fold NewVecC up
front so we can pass it into TTI and get a more accurate cost.

We want to remove this restriction on RISC-V since this is always
profitable whether or not the scalar is a load.
2025-05-27 16:27:28 +01:00
Ellis Hoag
b5588ce746 [LLD][MachO][NFC] Refactor LOH code (#141153)
In `applyAdrpAddLdr()` we make a transformation that is identical to the
one in `applyAdrpAdd()`, so lets reuse that code. Also refactor
`forEachHint()` to use more `ArrayRef` and move around some lines for
consistancy.
2025-05-27 08:24:25 -07:00
Simon Pilgrim
344f59401e [X86] combineTargetShuffle - fold (vzmovl (shift x, y)) -> (shift (vzmovl x), y) (#141579)
Move VZEXT_MOVL nodes up through shift nodes.

We should be trying harder to move VZEXT_MOVL towards any associated SCALAR_TO_VECTOR nodes to make use of MOVD/Q implicit zeroing of upper elements.

Fixes #141475
2025-05-27 16:21:12 +01:00
Lucas Ramirez
3e18216474 [AMDGPU][Scheduler] Delete RescheduleRegions bitvector from scheduler (NFC) (#141595)
The `GCNScheduleDAGMILive`'s `RescheduleRegions` bitvector is only used
by the rematerialization stage (`PreRARematStage`). Its presence in the
scheduler's state forces us to maintain its value throughout scheduling
even though it is of no use to the iterative scheduling process itself,
which instead relies on each stage's `initGCNRegion` hook to determine
whether the current region should be rescheduled.

This moves the bitvector to the `PreRARematStage`, which uses it to
store the set of regions that must be rescheduled between stage
initialization and region initialization.

This NFC also swaps a call to `GCNRegPressure::getArchVGPRNum(false)`
for a call to `GCNRegPressure::getArchVGPRNum()`---which is equivalent
but simpler in the context---and makes
`GCNSchedStage::finalizeGCNRegion` use its own API to advance to the
next region.
2025-05-27 17:10:28 +02:00
Sander de Smalen
e90ea09489 [AArch64][AsmParser] Support SVE conditions even without +sve. (#141585)
They're just aliases.
2025-05-27 16:10:04 +01:00
Asher Mancinelli
42b1df43e7 [mlir][math] Add missing trig math-to-llvm conversion patterns (#141069)
asin, acos, atan, and atan2 were being lowered to libm calls instead of
llvm intrinsics. Add the conversion patterns to handle these intrinsics
and update tests to expect this.
2025-05-27 08:09:48 -07:00
Florian Hahn
d56deea1e4 [VPlan] Connect Entry to scalar preheader during initial construction. (#140132)
Update initial construction to connect the Plan's entry to the scalar
preheader during initial construction. This moves a small part of the
 skeleton creation out of ILV and will also enable replacing
 VPInstruction::ResumePhi with regular VPPhi recipes.

Resume phis need 2 incoming values to start with, the second being the
bypass value from the scalar ph (and used to replicate the incoming
value for other bypass blocks). Adding the extra edge ensures we
incoming values for resume phis match the incoming blocks.

PR: https://github.com/llvm/llvm-project/pull/140132
2025-05-27 16:07:56 +01:00
Craig Topper
7eb4eef4a5 [RISCV] Use RISCVTargetInstrInfo::copyPhysReg in RISCVMakeCompressible. NFC (#141296) 2025-05-27 08:03:26 -07:00
Rahul Joshi
062353d1f5 [NFC][LLVM] Minor namespace fixes in PassBuilder (#141288)
- No need to prefix `PointerType` with `llvm::`.
- Avoid namespace  block to define `PrintPipelinePasses`.
2025-05-27 07:26:28 -07:00
Rahul Joshi
58f78d84fd [NFC][LLVM] Use formatv automatic index assignment in PassBuilder (#141286) 2025-05-27 07:25:37 -07:00
Brox Chen
764ae04dfd [AMDGPU][True16][CodeGen] add -real-true16 flag to a few gisel gfx12 test (#141503)
This is a NFC change.

Added "-mattr=-real-true16" to a few gfx12 tests. This is for the up
coming GFX12 true16 code change. Set these tests to use fake16 flow
since true16 mode are not fully functional for GISEL
2025-05-27 09:58:27 -04:00
Timothy Werquin
a8e486bfc4 [Bitcode] Fix constexpr expansion creating invalid PHIs (#141560)
Fixes errors about duplicate PHI edges when the input had duplicates
with constexprs in them. The constexpr translation makes new basic
blocks, causing the verifier to complain about duplicate entries in PHI
nodes.
2025-05-27 15:51:48 +02:00
Nikita Popov
904d0c293e [Inline] Only consider provenance captures for scoped alias metadata (#138540)
When determining whether an escape source may alias with a noalias
argument, only take provenance captures into account. If only the
address of the argument was captured, an access through the escape
source is not legal.
2025-05-27 15:15:57 +02:00
Orlando Cazalet-Hyams
29db3058a8 [KeyInstr][Clang] Assign matrix element atom (#134650)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
2025-05-27 13:39:52 +01:00
Orlando Cazalet-Hyams
8b9448edc6 [KeyInstr][Clang] Assign vector element atom (#134649)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
2025-05-27 13:35:14 +01:00
Andrzej Warzyński
e22508ea81 [mlir][vector] Update CombineContractBroadcastMask (#140050)
This patch updates `CombineContractBroadcastMask` to inherit from
`MaskableOpRewritePattern`, enabling it to handle masked
`vector.contract` operations. The pattern rewrites:
```mlir
  %a = vector.broadcast %a_bc
  %res vector.contract %a_bc, %b, ...
```

into:
```mlir
  // Move the broadcast into vector.contract (by updating the indexing
  // maps)
  %res vector.contract %a, %b, ...
```

The main challenge is supporting cases where the pattern drops a leading
unit dimension. For example:
```mlir
func.func @contract_broadcast_unit_dim_reduction_masked(
    %arg0 : vector<8x4xi32>,
    %arg1 : vector<8x4xi32>,
    %arg2 : vector<8x8xi32>,
    %mask: vector<1x8x8x4xi1>) -> vector<8x8xi32> {

  %0 = vector.broadcast %arg0 : vector<8x4xi32> to vector<1x8x4xi32>
  %1 = vector.broadcast %arg1 : vector<8x4xi32> to vector<1x8x4xi32>
  %result = vector.mask %mask {
    vector.contract {
      indexing_maps = [#map0, #map1, #map2],
      iterator_types = ["reduction", "parallel", "parallel", "reduction"],
      kind = #vector.kind<add>
    } %0, %1, %arg2 : vector<1x8x4xi32>, vector<1x8x4xi32> into vector<8x8xi32>
  } : vector<1x8x8x4xi1> -> vector<8x8xi32>

  return %result : vector<8x8xi32>
}
```

Here, the leading unit dimension is dropped. To handle this, the mask is
cast to the correct shape using a `vector.shape_cast`:

```mlir
func.func @contract_broadcast_unit_dim_reduction_masked(
    %arg0: vector<8x4xi32>,
    %arg1: vector<8x4xi32>,
    %arg2: vector<8x8xi32>,
    %arg3: vector<1x8x8x4xi1>) -> vector<8x8xi32> {

  %mask_sc = vector.shape_cast %arg3 : vector<1x8x8x4xi1> to vector<8x8x4xi1>
  %res = vector.mask %mask_sc {
    vector.contract {
      indexing_maps = [#map, #map1, #map2],
      iterator_types = ["parallel", "parallel", "reduction"],
      kind = #vector.kind<add>
    } %arg0, %arg1, %mask_sc : vector<8x4xi32>, vector<8x4xi32> into vector<8x8xi32>
  } : vector<8x8x4xi1> -> vector<8x8xi32>

  return %res : vector<8x8xi32>
}
```

While this isn't ideal - since it introduces a `vector.shape_cast` that
must be cleaned up later - it reflects the best we can do once the input
reaches `CombineContractBroadcastMask`. A more robust solution may
involve simplifying the input earlier. I am leaving that as  a TODO for
myself to explore this further. Posting this now to unblock downstream
work.

LIMITATIONS

Currently, this pattern assumes:
* Only leading dimensions are dropped in the mask.
* All dropped dimensions must be unit-sized.
2025-05-27 13:34:16 +01:00
Pavel Labath
e3e5bd1cb1 [lldb/cmake] Don't call llvm_process_sources (#141217)
It's already called in llvm_add_library.
2025-05-27 14:32:16 +02:00
Orlando Cazalet-Hyams
9e07d0cf60 [KeyInstr][Clang] Bitfield atom (#134648)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
2025-05-27 13:31:59 +01:00
dianqk
e573ffe11f [MemCpyOpt] Check MDep aliases to avoid infinite loops (NFC) (#140376)
cc #103218.
2025-05-27 20:01:22 +08:00
Robin Caloudis
b56b4e02b5 Fix tests of lookup table generator (#139463)
## Why
In
https://github.com/llvm/llvm-project/pull/113612/files#diff-ada12e18f3e902b41b6989b46455c4e32656276e59907026e2464cf57d10d583,
the parameter `qual_name` was introduced. However, the tests have not
been adopted accordingly and hence cannot be executed.

## What
Fix the execution of tests by providing the missing argument.
2025-05-27 13:45:11 +02:00
David Spickett
f30a85b700 [lldb][test] Skip unamed symbol test on Arm
Same purpose as https://github.com/llvm/llvm-project/pull/141407,
comitting this directly to get the bot green sooner.

Co-authored-by: Ely Ronnen <elyronnen@gmail.com>
2025-05-27 11:39:50 +00:00
LLVM GN Syncbot
f36f65bf84 [gn build] Port 6fa8657a62 2025-05-27 10:59:21 +00:00
Lang Hames
6fa8657a62 [ORC] Refactor visit-members in StaticLibraryDefinitionGenerator. (#141546)
This refactor was motivated by two bugs identified in out-of-tree
builds:

1. Some implementations of the VisitMembersFunction type (often used to	
implement special loading semantics, e.g. -all_load or -ObjC) were assuming
that buffers for archive members were null-terminated, which they are not in
general. This was triggering occasional assertions.

2. Archives may include multiple members with the same file name, e.g.
when constructed by appending files with the same name:
  % llvm-ar crs libfoo.a foo.o
  % llvm-ar q libfoo.a foo.o
  % llvm-ar t libfoo.a foo.o
  foo.o

   While confusing, these members may be safe to link (provided that they're
   individually valid and don't define duplicate symbols). In ORC however, the
   archive member name may be used to construct an ORC initializer symbol,
   which must also be unique. In that case the duplicate member names lead to a
   duplicate definition error even if the members define unrelated symbols.

In addition to these bugs, StaticLibraryDefinitionGenerator had grown a
collection of all member buffers (ObjectFilesMap), a BumpPtrAllocator
that was redundantly storing synthesized archive member names (these are
copied into the MemoryBuffers created for each Object, but were never
freed in the allocator), and a set of COFF-specific import files.

To fix the bugs above and simplify StaticLibraryDefinitionGenerator this
patch makes the following changes:

1. StaticLibraryDefinitionGenerator::VisitMembersFunction is generalized
   to take a reference to the containing archive, and the index of the
   member within the archive. It now returns an Expected<bool> indicating
   whether the member visited should be treated as loadable, not loadable,
   or as invalidating the entire archive.
2. A static StaticLibraryDefinitionGenerator::createMemberBuffer method
   is added which creates MemoryBuffers with unique names of the form
   `<archive-name>[<index>](<member-name>)`. This defers construction of
   member names until they're loaded, allowing the BumpPtrAllocator (with
   its redundant name storage) to be removed.
3. The ObjectFilesMap (symbol name -> memory-buffer-ref) is replaced
   with a SymbolToMemberIndexMap (symbol name -> index) which should be
   smaller and faster to construct.
4. The 'loadability' result from VisitMemberFunctions is now taken into
   consideration when building the SymbolToMemberIndexMap so that members
   that have already been loaded / filtered out can be skipped, and do not
   take up any ongoing space.
5. The COFF ImportedDynamicLibraries member is moved out into the
   COFFImportFileScanner utility, which can be used as a
   VisitMemberFunction.

This fixes the bugs described above; and should lower memory consumption
slightly, especially for archives with many files and / or symbol where
most files are eventually loaded.
2025-05-27 20:58:53 +10:00
Simon Pilgrim
7462da18a1 [X86] Add test coverage for #141475 2025-05-27 11:44:58 +01:00
Orlando Cazalet-Hyams
dd8eb1e673 [KeyInstr][Clang] Switch stmt atom (#134643)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
2025-05-27 11:26:40 +01:00
Kerry McLaughlin
b61144bf77 [AArch64] Allow lowering of more types to GET_ACTIVE_LANE_MASK (#140062)
Adds support for operand promotion and splitting/widening the result
of the ISD::GET_ACTIVE_LANE_MASK node.
For AArch64, shouldExpandGetActiveLaneMask now returns false for more
types which we know can be legalised.
2025-05-27 11:21:57 +01:00
Orlando Cazalet-Hyams
bf1d4228f1 [KeyInstr][Clang] Catch variable init atom (#134641)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
2025-05-27 11:12:16 +01:00
Orlando Cazalet-Hyams
059885c703 [KeyInstr] Complex assignment atoms (#134638)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
2025-05-27 11:06:46 +01:00
FabianWolff
47d5e94acb [clang-tidy] readability-redundant-smartptr-get: disable for smart pointers to arrays (#141092)
Currently we generate an incorrect suggestion for shared/unique pointers
to arrays; for instance ([Godbolt](https://godbolt.org/z/Tens1reGP)):
```c++
#include <memory>

void test_shared_ptr_to_array() {
  std::shared_ptr<int[]> i;
  auto s = sizeof(*i.get());
}
```
```
<source>:5:20: warning: redundant get() call on smart pointer [readability-redundant-smartptr-get]
    5 |   auto s = sizeof(*i.get());
      |                    ^~~~~~~
      |                    i
1 warning generated.
```
`sizeof(*i)` is incorrect, though, because the array specialization of
`std::shared/unique_ptr` does not have an `operator*()`. Therefore I
have disabled this check for smart pointers to arrays for now; future
work could, of course, improve on this by suggesting, say,
`sizeof(i[0])` in the above example.
2025-05-27 12:06:08 +02:00