| Issue |
173722
|
| Summary |
[AArch64][GISel] Assertion `(WideTy.isVector() || WideTy.getSizeInBits() == 128) && "can only unmerge from vector or s128 types!"' failed.
|
| Labels |
backend:AArch64,
llvm:globalisel,
crash-on-valid
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/8reoTdnEf
Testcase (reduced from a well-defined C program with _BitInt):
```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 i2 @backsmith_pure_0(<1 x i16> %call) {
entry:
br i1 false, label %cond.true, label %cond.false
cond.true: ; preds = %entry
%vecext = extractelement <1 x i16> %call, i32 0
%conv = trunc i16 %vecext to i2
br label %cond.end
cond.false: ; preds = %entry
%conv3 = zext i32 0 to i104
%conv4 = trunc i104 %conv3 to i2
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
%cond = phi i2 [ %conv, %cond.true ], [ %conv4, %cond.false ]
ret i2 %cond
}
```
Dump:
```
llc: /root/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp:4088: bool {anonymous}::AArch64InstructionSelector::selectUnmergeValues(llvm::MachineInstr&, llvm::MachineRegisterInfo&): Assertion `(WideTy.isVector() || WideTy.getSizeInBits() == 128) && "can only unmerge from vector or s128 types!"' 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 -O0 <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'InstructionSelect' on function '@backsmith_pure_0'
#0 0x0000000004241848 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4241848)
#1 0x000000000423e6f4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x00007d618f842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007d618f8969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007d618f842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007d618f8287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x00007d618f82871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x00007d618f839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x0000000000ce7fa2 (anonymous namespace)::AArch64InstructionSelector::selectUnmergeValues(llvm::MachineInstr&, llvm::MachineRegisterInfo&) AArch64InstructionSelector.cpp:0:0
#9 0x0000000000d02a28 (anonymous namespace)::AArch64InstructionSelector::select(llvm::MachineInstr&) AArch64InstructionSelector.cpp:0:0
#10 0x00000000048b85e5 llvm::InstructionSelect::selectMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x48b85e5)
#11 0x00000000048ba878 llvm::InstructionSelect::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x48ba878)
#12 0x0000000003119269 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#13 0x000000000376bf16 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x376bf16)
#14 0x000000000376c2c1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x376c2c1)
#15 0x000000000376cb2f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x376cb2f)
#16 0x000000000090253d compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#17 0x00000000007cbc1c main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7cbc1c)
#18 0x00007d618f829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#19 0x00007d618f829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#20 0x00000000008f7215 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8f7215)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs