[llvm] [DRAFT][SROA] Promote aggregates as integers if they only have intrinsic users (PR #173117)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 19 15:24:02 PST 2025


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

The build failed before running any tests. Click on a failure below to see the details.

<details>
<summary>[code=1] lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/SROA.cpp.obj</summary>

```
FAILED: [code=1] lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/SROA.cpp.obj
sccache C:\clang\clang-msvc\bin\clang-cl.exe  /nologo -TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib\Transforms\Scalar -IC:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar -Iinclude -IC:\_work\llvm-project\llvm-project\llvm\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:__cplusplus /Oi /Brepro /bigobj /permissive- -Werror=unguarded-availability-new /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Folib\Transforms\Scalar\CMakeFiles\LLVMScalarOpts.dir\SROA.cpp.obj /Fdlib\Transforms\Scalar\CMakeFiles\LLVMScalarOpts.dir\LLVMScalarOpts.pdb -c -- C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5307,38): error: indirection requires pointer operand ('LLVMContext' invalid)
5307 |       auto *IntNTy = Type::getIntNTy(*C, P.size() * 8);
|                                      ^~
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5308,7): warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
5308 |       return {IntNTy, isIntegerWideningViable(P, IntNTy, DL), nullptr};
|       ^
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5305,5): note: previous statement is here
5305 |     if (OnlyIntrinsicUsers && DL.isLegalInteger(P.size() * 8) &&
|     ^
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5308,15): error: use of undeclared identifier 'IntNTy'
5308 |       return {IntNTy, isIntegerWideningViable(P, IntNTy, DL), nullptr};
|               ^~~~~~
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5308,50): error: use of undeclared identifier 'IntNTy'
5308 |       return {IntNTy, isIntegerWideningViable(P, IntNTy, DL), nullptr};
|                                                  ^~~~~~
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5312,13): error: use of undeclared identifier 'TypePartitionTy'; did you mean 'getTypePartition'?
5312 |     return {TypePartitionTy, false, nullptr};
|             ^~~~~~~~~~~~~~~
|             getTypePartition
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(4622,14): note: 'getTypePartition' declared here
4622 | static Type *getTypePartition(const DataLayout &DL, Type *Ty, uint64_t Offset,
|              ^
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5312,12): error: no matching constructor for initialization of 'std::tuple<Type *, bool, VectorType *>'
5312 |     return {TypePartitionTy, false, nullptr};
|            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(300,94): note: candidate constructor template not viable: no known conversion from 'Type *(const DataLayout &, Type *, uint64_t, uint64_t)' (aka 'llvm::Type *(const llvm::DataLayout &, llvm::Type *, unsigned long long, unsigned long long)') to 'llvm::Type *const' for 1st argument
300 |     constexpr explicit(_Tuple_conditional_explicit_v<tuple, const _This2&, const _Rest&...>) tuple(
|                                                                                              ^
301 |         const _This& _This_arg, const _Rest&... _Rest_arg) noexcept(conjunction_v<is_nothrow_copy_constructible<_This2>,
|         ~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(503,18): note: candidate constructor template not viable: no known conversion from 'Type *(const DataLayout &, Type *, uint64_t, uint64_t)' (aka 'llvm::Type *(const llvm::DataLayout &, llvm::Type *, unsigned long long, unsigned long long)') to 'allocator_arg_t' for 1st argument
503 |     _CONSTEXPR20 tuple(allocator_arg_t, const _Alloc& _Al, const tuple& _Right)
|                  ^     ~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(507,18): note: candidate constructor template not viable: no known conversion from 'Type *(const DataLayout &, Type *, uint64_t, uint64_t)' (aka 'llvm::Type *(const llvm::DataLayout &, llvm::Type *, unsigned long long, unsigned long long)') to 'allocator_arg_t' for 1st argument
507 |     _CONSTEXPR20 tuple(allocator_arg_t, const _Alloc& _Al, tuple&& _Right)
|                  ^     ~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(244,15): note: candidate template ignored: requirement 'is_same_v<llvm::Type *(*)(const llvm::DataLayout &, llvm::Type *, unsigned long long, unsigned long long), std::_Exact_args_t>' was not satisfied [with _Tag = Type *(*)(const DataLayout &, Type *, uint64_t, uint64_t), _This2 = bool, _Rest2 = <std::nullptr_t>]
244 |     constexpr tuple(_Tag, _This2&& _This_arg, _Rest2&&... _Rest_arg)
|               ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(248,15): note: candidate template ignored: could not match 'index_sequence<_Indices...>' (aka 'integer_sequence<unsigned long long, _Indices...>') against 'std::nullptr_t'
248 |     constexpr tuple(_Tag, _Tpl&& _Right, index_sequence<_Indices...>);
|               ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(257,15): note: candidate template ignored: requirement 'is_same_v<llvm::Type *(*)(const llvm::DataLayout &, llvm::Type *, unsigned long long, unsigned long long), std::_Alloc_exact_args_t>' was not satisfied [with _Tag = Type *(*)(const DataLayout &, Type *, uint64_t, uint64_t), _Alloc = bool, _This2 = std::nullptr_t, _Rest2 = <>]
257 |     constexpr tuple(_Tag, const _Alloc& _Al, _This2&& _This_arg, _Rest2&&... _Rest_arg)
|               ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(266,15): note: candidate template ignored: requirement 'is_same_v<llvm::Type *(*)(const llvm::DataLayout &, llvm::Type *, unsigned long long, unsigned long long), std::_Alloc_unpack_tuple_t>' was not satisfied [with _Tag = Type *(*)(const DataLayout &, Type *, uint64_t, uint64_t), _Alloc = bool, _Tpl = std::nullptr_t]
266 |     constexpr tuple(_Tag, const _Alloc& _Al, _Tpl&& _Right)
|               ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(483,9): note: candidate template ignored: requirement 'conjunction_v<std::_Tuple_perfect_val<std::tuple<llvm::Type *, bool, llvm::VectorType *>, std::nullptr_t>, std::_Tuple_constructible_val<std::tuple<llvm::Type *, bool, llvm::VectorType *>, std::nullptr_t>>' was not satisfied [with _Alloc = bool, _This2 = std::nullptr_t, _Rest2 = <>]
483 |         tuple(allocator_arg_t, const _Alloc& _Al, _This2&& _This_arg, _Rest2&&... _Rest_arg)
|         ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(516,9): note: candidate template ignored: could not match 'tuple<_Other...>' against 'std::nullptr_t'
516 |         tuple(allocator_arg_t, const _Alloc& _Al, const tuple<_Other...>& _Right)
|         ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(540,9): note: candidate template ignored: could not match 'tuple<_Other...>' against 'std::nullptr_t'
540 |         tuple(allocator_arg_t, const _Alloc& _Al, tuple<_Other...>&& _Right)
|         ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(560,9): note: candidate template ignored: could not match 'pair<_First, _Second>' against 'std::nullptr_t'
560 |         tuple(allocator_arg_t, const _Alloc& _Al, const pair<_First, _Second>& _Right)
|         ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(578,9): note: candidate template ignored: could not match 'pair<_First, _Second>' against 'std::nullptr_t'
578 |         tuple(allocator_arg_t, const _Alloc& _Al, pair<_First, _Second>&& _Right)
|         ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(325,81): note: candidate template ignored: requirement 'conjunction_v<std::_Tuple_perfect_val<std::tuple<llvm::Type *, bool, llvm::VectorType *>, llvm::Type *(&)(const llvm::DataLayout &, llvm::Type *, unsigned long long, unsigned long long), bool, std::nullptr_t>, std::_Tuple_constructible_val<std::tuple<llvm::Type *, bool, llvm::VectorType *>, llvm::Type *(&)(const llvm::DataLayout &, llvm::Type *, unsigned long long, unsigned long long), bool, std::nullptr_t>>' was not satisfied [with _This2 = Type *(&)(const DataLayout &, Type *, uint64_t, uint64_t), _Rest2 = <bool, std::nullptr_t>]
325 |     constexpr explicit(_Tuple_conditional_explicit_v<tuple, _This2, _Rest2...>) tuple(_This2&& _This_arg,
|                                                                                 ^
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(440,9): note: candidate constructor template not viable: requires 2 arguments, but 3 were provided
440 |         tuple(allocator_arg_t, const _Alloc& _Al)
|         ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(251,15): note: candidate constructor template not viable: requires 2 arguments, but 3 were provided
251 |     constexpr tuple(_Tag, _Tpl&& _Right)
|               ^     ~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(263,15): note: candidate constructor template not viable: requires 4 arguments, but 3 were provided
263 |     constexpr tuple(_Tag, const _Alloc& _Al, _Tpl&& _Right, index_sequence<_Indices...>);
|               ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(346,5): note: candidate constructor not viable: requires 1 argument, but 3 were provided
346 |     tuple(const tuple&) = default;
|     ^     ~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(347,5): note: candidate constructor not viable: requires 1 argument, but 3 were provided
347 |     tuple(tuple&&)      = default;
|     ^     ~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(354,9): note: candidate constructor template not viable: requires single argument '_Right', but 3 arguments were provided
354 |         tuple(const tuple<_Other...>& _Right) noexcept(
|         ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(378,9): note: candidate constructor template not viable: requires single argument '_Right', but 3 arguments were provided
378 |         tuple(tuple<_Other...>&& _Right) noexcept(_Tuple_nothrow_constructible_v<tuple, _Other...>) // strengthened
|         ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(400,9): note: candidate constructor template not viable: requires single argument '_Right', but 3 arguments were provided
400 |         tuple(const pair<_First, _Second>& _Right) noexcept(
|         ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(419,79): note: candidate constructor template not viable: requires single argument '_Right', but 3 arguments were provided
419 |     constexpr explicit(_Tuple_conditional_explicit_v<tuple, _First, _Second>) tuple(
|                                                                               ^
420 |         pair<_First, _Second>&& _Right) noexcept(_Tuple_nothrow_constructible_v<tuple, _First, _Second>) // strengthened
|         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(463,9): note: candidate constructor template not viable: requires 5 arguments, but 3 were provided
463 |         tuple(allocator_arg_t, const _Alloc& _Al, const _This& _This_arg, const _Rest&... _Rest_arg)
|         ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(276,9): note: candidate constructor template not viable: requires 0 arguments, but 3 were provided
276 |         tuple() noexcept(conjunction_v<is_nothrow_default_constructible<_This2>,
|         ^
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5316,3): error: expected unqualified-id
5316 |   if (LargestIntTy &&
|   ^
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5321,3): error: expected unqualified-id
5321 |   if (DL.isLegalInteger(P.size() * 8))
|   ^
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5325,3): error: expected unqualified-id
5325 |   return {ArrayType::get(Type::getInt8Ty(C), P.size()), false, nullptr};
|   ^
C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Scalar\SROA.cpp(5326,1): error: extraneous closing brace ('}')
5326 | }
| ^
1 warning and 9 errors generated.
```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/173117


More information about the llvm-commits mailing list