Issue 176314
Summary [AArch64] Assertion `VT == N1.getValueType() && VT == N2.getValueType() && "Invalid VECTOR_SHUFFLE"' failed.
Labels backend:AArch64, crash-on-valid, generated by fuzzer
Assignees
Reporter XChy
    Reproducer: https://godbolt.org/z/Wdej7Mq8T
Testcase:
```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "aarch64-unknown-linux-musl"

define <4 x i32> @backsmith_pure_4(<4 x i32> %0, <4 x i16> %conv.i) {
entry:
  %conv.i19 = trunc <4 x i32> %0 to <4 x i16>
  %shuffle11 = shufflevector <4 x i16> %conv.i19, <4 x i16> %conv.i, <32 x i32> <i32 5, i32 2, i32 5, i32 3, i32 1, i32 6, i32 5, i32 6, i32 5, i32 6, i32 4, i32 6, i32 0, i32 3, i32 5, i32 1, i32 6, i32 7, i32 2, i32 6, i32 3, i32 1, i32 0, i32 4, i32 4, i32 1, i32 2, i32 7, i32 2, i32 2, i32 1, i32 2>
  %conv12 = sext <32 x i16> %shuffle11 to <32 x i32>
  %shuffle14 = shufflevector <32 x i32> %conv12, <32 x i32> zeroinitializer, <4 x i32> <i32 9, i32 25, i32 poison, i32 poison>
  %mul = mul <4 x i32> %0, %shuffle14
  ret <4 x i32> %mul
}
```

Dump:
```
llc: /root/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2194: llvm::SDValue llvm::SelectionDAG::getVectorShuffle(llvm::EVT, const llvm::SDLoc&, llvm::SDValue, llvm::SDValue, llvm::ArrayRef<int>): Assertion `VT == N1.getValueType() && VT == N2.getValueType() && "Invalid VECTOR_SHUFFLE"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'AArch64 Instruction Selection' on function '@backsmith_pure_4'
 #0 0x000000000425ad48 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x425ad48)
 #1 0x0000000004257c24 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007dcb72042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007dcb720969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007dcb72042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007dcb720287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007dcb7202871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007dcb72039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000003fb3047 llvm::SelectionDAG::getVectorShuffle(llvm::EVT, llvm::SDLoc const&, llvm::SDValue, llvm::SDValue, llvm::ArrayRef<int>) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fb3047)
 #9 0x0000000000b8d85d performBuildShuffleExtendCombine(llvm::SDValue, llvm::SelectionDAG&) AArch64ISelLowering.cpp:0:0
#10 0x0000000000bbf2c5 performMulCombine(llvm::SDNode*, llvm::SelectionDAG&, llvm::TargetLowering::DAGCombinerInfo&, llvm::AArch64Subtarget const*) AArch64ISelLowering.cpp:0:0
#11 0x0000000000bd6e81 llvm::AArch64TargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xbd6e81)
#12 0x0000000003e7a78f (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#13 0x0000000003e7c310 (anonymous namespace)::DAGCombiner::Run(llvm::CombineLevel) DAGCombiner.cpp:0:0
#14 0x0000000003e7ed63 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::BatchAAResults*, llvm::CodeGenOptLevel) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3e7ed63)
#15 0x0000000003feb604 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3feb604)
#16 0x0000000003feece8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3feece8)
#17 0x0000000003ff07fc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3ff07fc)
#18 0x0000000003fdba6f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fdba6f)
#19 0x0000000003126579 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#20 0x000000000377c2c6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x377c2c6)
#21 0x000000000377c671 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x377c671)
#22 0x000000000377cedf llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x377cedf)
#23 0x00000000008eb45d compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#24 0x00000000007c6ffc main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c6ffc)
#25 0x00007dcb72029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x00007dcb72029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x00000000008e0505 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8e0505)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to