llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[AArch64][GISel] Assertion `DstTy.getNumElements() == DemandedElts.getBitWidth() && "DemandedElt width should equal the fixed vector number of elements"' failed.

Open XChy opened this issue 10 months ago • 9 comments

Reproducer: https://godbolt.org/z/Kahrn5MET 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 <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

XChy avatar Jan 27 '26 16:01 XChy

@llvm/issue-subscribers-backend-aarch64

Author: Hongyu Chen (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
</details>

llvmbot avatar Jan 27 '26 16:01 llvmbot

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor is working on this issue. If someone is assigned to the issue or claimed to be working on it, ping the person. After one week without a response, the assignee may be changed.
  2. Leave a comment indicating that you are working on the issue, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

llvmbot avatar Jan 27 '26 17:01 llvmbot

@llvm/issue-subscribers-good-first-issue

Author: Hongyu Chen (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
</details>

llvmbot avatar Jan 27 '26 17:01 llvmbot

The known bits of COPY need the vector types (the number of elements in the vector) to match, or it needs to be handled more like a G_BITCAST but I don't think we handle bitcast yet.

davemgreen avatar Jan 27 '26 17:01 davemgreen

@XChy
Can I work on this ?

Abhiramjampani avatar Jan 27 '26 17:01 Abhiramjampani

I am sorry, but can I also look into this ?

ahmedshakill avatar Jan 27 '26 18:01 ahmedshakill

@Abhiramjampani You are already assigned to another good-first-issue. Which one are you working on?

sweiglbosker avatar Jan 27 '26 21:01 sweiglbosker

@Abhiramjampani You are already assigned to another good-first-issue. Which one are you working on?

Hi, I'll work on #178246 Feel free to assign this to someone else!

Abhiramjampani avatar Jan 28 '26 04:01 Abhiramjampani

@llvm/issue-subscribers-backend-aarch64

Author: Hongyu Chen (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
</details>

llvmbot avatar Feb 26 '26 12:02 llvmbot