-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
Reproducer: https://godbolt.org/z/s4n78xc9a
Testcase:
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_2(<8 x i16> %BS_ARG_1, i1 %exitcond.not) {
entry:
br label %for.body
for.cond.cleanup: ; preds = %for.body
%vecinit18 = insertelement <4 x i32> zeroinitializer, i32 %BS_VAR_2.025, i64 0
ret <4 x i32> %vecinit18
for.body: ; preds = %for.body, %entry
%BS_VAR_2.025 = phi i32 [ 0, %entry ], [ %2, %for.body ]
%0 = extractelement <8 x i16> %BS_ARG_1, i32 %BS_VAR_2.025
%1 = and i16 %0, 255
%cmp2 = icmp eq i16 %1, 0
%conv4 = zext i1 %cmp2 to i8
%vecinit7 = insertelement <4 x i8> zeroinitializer, i8 %conv4, i64 0
%2 = bitcast <4 x i8> %vecinit7 to i32
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}llc output:
llc: /root/llvm-project/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp:176: 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 -O2 <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'InstructionSelect' on function '@backsmith_pure_2'
#0 0x00000000041c2638 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41c2638)
#1 0x00000000041bf4e4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x000073240b442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x000073240b4969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x000073240b442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x000073240b4287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x000073240b42871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x000073240b439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x000000000477f004 llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x477f004)
#9 0x000000000477b652 llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x477b652)
#10 0x000000000477b652 llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x477b652)
#11 0x000000000477b7a1 llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x477b7a1)
#12 0x000000000477be1f llvm::GISelValueTracking::computeKnownBitsImpl(llvm::Register, llvm::KnownBits&, llvm::APInt const&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x477be1f)
#13 0x000000000477fd21 llvm::GISelValueTracking::getKnownBits(llvm::Register) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x477fd21)
#14 0x0000000000bbd248 (anonymous namespace)::AArch64InstructionSelector::testMOPredicate_MO(unsigned int, llvm::MachineOperand const&, llvm::GIMatchTableExecutor::MatcherState const&) const AArch64InstructionSelector.cpp:0:0
#15 0x0000000000bef022 (anonymous namespace)::AArch64InstructionSelector::select(llvm::MachineInstr&) AArch64InstructionSelector.cpp:0:0
#16 0x0000000004825835 llvm::InstructionSelect::selectMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4825835)
#17 0x0000000004827cc8 llvm::InstructionSelect::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4827cc8)
#18 0x00000000030a1219 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#19 0x00000000036f0a06 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f0a06)
#20 0x00000000036f0db1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f0db1)
#21 0x00000000036f161f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f161f)
#22 0x00000000008fca42 compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#23 0x00000000007c84f9 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c84f9)
#24 0x000073240b429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#25 0x000073240b429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#26 0x00000000008f1275 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8f1275)
Program terminated with signal: SIGSEGV
Compiler returned: 139