| Issue |
172265
|
| Summary |
[PowerPC] Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
|
| Labels |
backend:PowerPC,
crash-on-valid
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/PzdTK8qPM
Reduced testcase:
```llvm
target datalayout = "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512"
target triple = "powerpc64le-unknown-linux-musl"
define <32 x i32> @backsmith_pure_1(<32 x i32> %BS_ARG_1, <3 x i32> %0) {
entry:
%vecinit37 = shufflevector <3 x i32> %0, <3 x i32> zeroinitializer, <32 x i32> <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 2, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%shuffle56 = shufflevector <32 x i32> %vecinit37, <32 x i32> %BS_ARG_1, <32 x i32> <i32 4, i32 9, i32 3, i32 3, i32 4, i32 1, i32 1, i32 0, i32 16, i32 5, i32 5, i32 34, i32 3, i32 0, i32 8, i32 2, i32 8, i32 1, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 7, i32 5, i32 3, i32 6, i32 0, i32 3, i32 4, i32 7>
ret <32 x i32> %shuffle56
}
```
The reduced testcase contains the odd-sized vector. But the C reproducer doesn't: https://godbolt.org/z/T1Er6bvx6
Dump:
```
llc: /root/llvm-project/llvm/include/llvm/Support/Casting.h:566: decltype(auto) llvm::cast(From&) [with To = llvm::ShuffleVectorSDNode; From = llvm::SDValue]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' 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 -O1 <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@backsmith_pure_1'
#0 0x000000000421fb68 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x421fb68)
#1 0x000000000421ca14 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x00007881a1442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007881a14969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007881a1442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007881a14287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x00007881a142871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x00007881a1439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x0000000001cb6a1c llvm::PPCTargetLowering::combineVectorShuffle(llvm::ShuffleVectorSDNode*, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x1cb6a1c)
#9 0x0000000001cb6adf llvm::PPCTargetLowering::LowerVECTOR_SHUFFLE(llvm::SDValue, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x1cb6adf)
#10 0x0000000001ce48ee llvm::PPCTargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x1ce48ee)
#11 0x0000000003e9273e (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) (.part.0) LegalizeDAG.cpp:0:0
#12 0x0000000003e95e1e llvm::SelectionDAG::Legalize() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3e95e1e)
#13 0x0000000003fb6262 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fb6262)
#14 0x0000000003fb95b8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fb95b8)
#15 0x0000000003fbb03c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fbb03c)
#16 0x0000000001c77f17 (anonymous namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) PPCISelDAGToDAG.cpp:0:0
#17 0x0000000003fa683f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fa683f)
#18 0x00000000030f5fd9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#19 0x0000000003750ab6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3750ab6)
#20 0x0000000003750e61 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3750e61)
#21 0x00000000037516cf llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37516cf)
#22 0x00000000008fe384 compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#23 0x00000000007c88f9 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c88f9)
#24 0x00007881a1429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#25 0x00007881a1429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#26 0x00000000008f3585 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8f3585)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs