<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54424>54424</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [AArch64][SVE] Unable to widen vector store
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          stevesuzuki-arm
      </td>
    </tr>
</table>

<pre>
    `add <vscale x 3 x i64>` https://godbolt.org/z/cM9YMqEc4

```
define <vscale x 3 x i64> @add_i64_nxv3(<vscale x 3 x i64> %a0, <vscale x 3 x i64> %a1) #0 {
  %1 = add nsw <vscale x 3 x i64> %a0, %a1
  ret <vscale x 3 x i64> %1
}
```

Crashes with target triple = "aarch64-linux-gnu" -mattr=+sve2 -O3

The same occurs with `sub `and `mul`

```
LLVM ERROR: Unable to widen vector store
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mattr=+sve2 -O3 <source>
1.      Running pass 'Function Pass Manager' on module '<source>'.
2.      Running pass 'AArch64 Instruction Selection' on function '@add_i64_nxv3'
 #0 0x000055c92c3449ef PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000055c92c3421ad SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fa7e9e113c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
 #3 0x00007fa7e98de03b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4303b)
 #4 0x00007fa7e98bd859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #5 0x000055c92c2875e8 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30875e8)
 #6 0x000055c92c287758 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3087758)
 #7 0x000055c92c1e79f5 llvm::DAGTypeLegalizer::WidenVecOp_STORE(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fe79f5)
 #8 0x000055c92c1ea4cb llvm::DAGTypeLegalizer::WidenVectorOperand(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fea4cb)
 #9 0x000055c92c1ac883 llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fac883)
#10 0x000055c92c1ad7e6 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fad7e6)
#11 0x000055c92c14361e llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f4361e)
#12 0x000055c92c147233 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f47233)
#13 0x000055c92c148ee8 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.960) SelectionDAGISel.cpp:0:0
#14 0x000055c92b687546 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2487546)
#15 0x000055c92bb3a7d6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x293a7d6)
#16 0x000055c92bb3ab29 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x293ab29)
#17 0x000055c92bb3b469 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x293b469)
#18 0x000055c929d2f5c8 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#19 0x000055c929c86197 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xa86197)
#20 0x00007fa7e98bf0b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#21 0x000055c929d2604a _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xb2604a)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFmNtu4zYQhp9GviFsSNT5wheO42wXSJogTrfolUFRtK2GplSScpx9-g4pOTG1ySZojTbwQSKtf74ZcoZkirp8nnqJT8oSeeF8ryjhDB1QCO8qibxwAZ1oq3WjvHDm4St4beqyqLme1HIDd9_hTW_yP27-WtDI8y89f9Z_Jn7_srclW1eCvWMEeZFBWMHdShz2oYez936IY-J7eP6uEPQHHs7hIvSRl1501pHpCOChS2RcFerpZwKdAavUPy2Z_skD_c-89PJN17vPuSRqyxR6qvQWaSI3IKll1XBmsTyMCZF0m0RjXon2MN6IFtrQeEe0lvALD1-oPYOG2_BU9mHLkCI7hmpKW9nLg2nVFuaLiNJ87Vo-wBkwXl9_u0GL-_vbexhn9JsgBXDpGuRKJtCeUV1LpOCDdb-_u17MlgsEVnaVRgQV7QaC1NRSm6cGEwaQ2mJC6x3ccL4_fo0bWf8JynBbKdUyBRfIAFeC8rYE--AbNWFDBaGPWhLKJp35pYYGVLa7xlixTT505Xey3kiyQxDedseENhAQ2qu6MVaAoKk4k2N2aDi4Ik0bJ2IzJkoxqataqLGWrXiEjqISlpOicW0kSNMYoVY3rZ4oND5kCTy2G6tnockBBqgSmvE3x8tMHVW3kjKTUJY2MLT3rRCV2KAGzIOJ9KoV1ECgO9NwQwTZGMYUQdOuLlszVXDqiOG0jwh-S3A2szMKfRUK3Oq0l4wze9ULr49GjfQwDdM-AWw2-Qcf_uKY5piGUZSzNbqT4LUdjAczOstqIwj_BcaQG_BsX1elh2cmH7suNaGNGTLfvl-0g4E2DkiJhmJg6UMh3Aula5KynAVBSH20Wklmp-4KZqcpLTCsVQGfMIQrN99MR6O3kpFyouoJFIIL_xBEoAKmX82EjpmsZ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