<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55114>55114</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AArch64][SVE] Error in bitcast on scalable vector
</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>
https://godbolt.org/z/7s6ThKrzY
```
define <vscale x 4 x i16> @bitcast_nxv1i64(<vscale x 1 x i64> %a) #0 {
%1 = bitcast <vscale x 1 x i64> %a to <vscale x 4 x i16>
ret <vscale x 4 x i16> %1
}
```
Crashes with target triple = "aarch64-linux-gnu" -mattr=+sve2 -O3
```
LLVM ERROR: Invalid size request on a scalable vector.
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 '@bitcast_nxv1i64'
#0 0x000056529c19902f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x000056529c196a9c SignalHandler(int) Signals.cpp:0:0
#2 0x00007fa670c623c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
#3 0x00007fa67072f03b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4303b)
#4 0x00007fa67070e859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x000056529c0db278 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30db278)
#6 0x000056529c0db3e8 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30db3e8)
#7 0x000056529c13b165 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x313b165)
#8 0x000056529c13b190 llvm::TypeSize::operator unsigned long() const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x313b190)
#9 0x000056529c082eb1 llvm::DAGTypeLegalizer::PromoteIntRes_BITCAST(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3082eb1)
#10 0x000056529c0853ea llvm::DAGTypeLegalizer::PromoteIntegerResult(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30853ea)
#11 0x000056529bffbe0f llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2ffbe0f)
#12 0x000056529bffcfc6 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2ffcfc6)
#13 0x000056529bf92703 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f92703)
#14 0x000056529bf96263 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f96263)
#15 0x000056529bf97998 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.960) SelectionDAGISel.cpp:0:0
#16 0x000056529b4d8ad6 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x24d8ad6)
#17 0x000056529b987526 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2987526)
#18 0x000056529b987879 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2987879)
#19 0x000056529b9881b9 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x29881b9)
#20 0x0000565299b3e918 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#21 0x0000565299a98bd7 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xa98bd7)
#22 0x00007fa6707100b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#23 0x0000565299b3531a _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xb3531a)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFmFtz6jYQxz-NedHA2PL9gQdCkjbTpCcTMmemT4wsy-DGSK4kc0g-fVe2ucghTc6UaTMQsGT_97e7uqzIRP46XWtdK8efOfgWXiuRZ6LSEyFXcPUG71hFz-vf5NsfyHGvHXfmRG7_ai9zVpScIcefbxUlFUM7FMC79CLHv0FO4GalpkTpJd9tvTIKHJyc3uuZe6HV3ItD4uAUPn0XOfFVbw-ZDg8MXKNeCv2DANLiA5a9mmT6Q1ow1DsZX5_1di6JWjOFfpR6jTSRKxDTsqwr1gI6GBMi6ToKxlXJm914xRtoQ-MN0VrCHQ6-UlsGDd_8s_r3998f0M3T07cnyAi641tSlTlS5RsD7r8aBs4Ljggy8CQDq1tGtZCT7unH-5vZ4gapJtuUGu7KmhU8VgupTVgGiQYPmmxCxQYuqmq7_xjXUvwJonBZKgUW4QsiPEclp1WTM6TXDFETBpQR-qIloaw3v9DQgPJmUxsrbZMLXemjFCtJNgjC1WwY1wYCQnUramMFCOqyYnLMdnUlJJOmrSJ8NSZKMalLwdVYy4a_QEdW8paTorEwEqSujVCj60ZPFBrvkgge24zVK9dkBwEvuWbV2fibQaBEIyk7DA7P0D41nJd8hWowDybi24ZTA4EeTcMD4WRlGGOTiI3IG5N6HFtiOO4jgs8JzmbtCIHsKnCr016wirXfeuFib9RIn5lDcT-a27ni7lz4C6MQp9RLUxcX6FGC420-nk2CFuWKk-pXSGNl2JOtKHMHz8xs67rUhNYma277Pmh7A-2IpBQNxcDSp0K4F4oLEsUujbBPXbRcShjQkPIlDFCzLkBmywz-QxaX9hQyHbVeS0byiRITF_Lo7rwAVMD00YxvmYlx4foZkqR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