| Issue |
178242
|
| Summary |
[AArch64][GISel] Assertion `DstTy.getNumElements() == DemandedElts.getBitWidth() && "DemandedElt width should equal the fixed vector number of elements"' failed.
|
| Labels |
backend:AArch64,
llvm:globalisel,
crash-on-valid,
generated by fuzzer
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/Kahrn5MET
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 <2 x i8> @backsmith_pure_1(<4 x i32> %vqaddq_v2.i.i, ptr %BS_VAR_0) {
entry:
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%0 = phi <64 x i16> [ %2, %for.cond ], [ zeroinitializer, %entry ]
%conv = extractelement <64 x i16> %0, i64 0
%vecext.i = extractelement <4 x i32> %vqaddq_v2.i.i, i16 %conv
%1 = and i32 %vecext.i, 65535
%conv1 = zext i32 %1 to i64
%vecinit16 = insertelement <16 x i64> zeroinitializer, i64 %conv1, i64 0
store <16 x i64> %vecinit16, ptr %BS_VAR_0, align 16
%2 = bitcast <16 x i64> zeroinitializer to <64 x i16>
br label %for.cond
}
```
Dump:
```
llc: /root/llvm-project/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp:177: void llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, const llvm::APInt&, unsigned int): Assertion `DstTy.getNumElements() == DemandedElts.getBitWidth() && "DemandedElt width should equal the fixed vector number of elements"' 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 --global-isel <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'InstructionSelect' on function '@backsmith_pure_1'
#0 0x000000000425bd48 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x425bd48)
#1 0x0000000004258c24 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x0000768810e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x0000768810e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x0000768810e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x0000768810e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x0000768810e2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x0000768810e39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x000000000484b847 llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x484b847)
#9 0x0000000004847a8d llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4847a8d)
#10 0x0000000004847a8d llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4847a8d)
#11 0x000000000484b5a0 llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x484b5a0)
#12 0x0000000004847a8d llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4847a8d)
#13 0x0000000004847d44 llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4847d44)
#14 0x000000000484a168 llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x484a168)
#15 0x000000000484c4f1 llvm::GISelValueTracking::getKnownBits(llvm::Register) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x484c4f1)
#16 0x0000000000cbfa58 (anonymous namespace)::AArch64InstructionSelector::testMOPredicate_MO(unsigned int, llvm::MachineOperand const&, llvm::GIMatchTableExecutor::MatcherState const&) const AArch64InstructionSelector.cpp:0:0
#17 0x0000000000cf0059 (anonymous namespace)::AArch64InstructionSelector::select(llvm::MachineInstr&) AArch64InstructionSelector.cpp:0:0
#18 0x00000000048f46f5 llvm::InstructionSelect::selectMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x48f46f5)
#19 0x00000000048f69f8 llvm::InstructionSelect::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x48f69f8)
#20 0x0000000003115739 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#21 0x00000000037725c6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37725c6)
#22 0x0000000003772971 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3772971)
#23 0x00000000037731df llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37731df)
#24 0x00000000008ea232 compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#25 0x00000000007c59ec main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c59ec)
#26 0x0000768810e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#27 0x0000768810e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#28 0x00000000008df2d5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8df2d5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs