Skip to content

[AArch64][GISel] llc crashed at O1/O2/O3: Assertion `isVector() && "Expected a vector type"' failed. #168495

@XChy

Description

@XChy

Reproducer: https://godbolt.org/z/Y5sdoah3W
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 i8> @backsmith_pure_3(i16 %coerce.val.ii) {
entry:
  %0 = bitcast i16 %coerce.val.ii to <2 x i8>
  %shuffle3 = shufflevector <2 x i8> %0, <2 x i8> zeroinitializer, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
  ret <4 x i8> %shuffle3
}

llc output:

llc: /root/llvm-project/llvm/include/llvm/CodeGenTypes/LowLevelType.h:172: constexpr bool llvm::LLT::isScalable() const: Assertion `isVector() && "Expected a vector 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 -global-isel -O1 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'AArch64PostLegalizerCombiner' on function '@backsmith_pure_3'
 #0 0x00000000041a29e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41a29e8)
 #1 0x000000000419f894 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007145a3e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007145a3e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007145a3e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007145a3e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007145a3e2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007145a3e39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000000bff387 std::_Function_handler<std::pair<unsigned int, llvm::LLT> (llvm::LegalityQuery const&), llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(llvm::AArch64Subtarget const&)::'lambda61'(llvm::LegalityQuery const&)>::_M_invoke(std::_Any_data const&, llvm::LegalityQuery const&) AArch64LegalizerInfo.cpp:0:0
 #9 0x0000000004866800 llvm::LegalizeRuleSet::apply(llvm::LegalityQuery const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4866800)
#10 0x0000000004868096 llvm::LegalizerInfo::getAction(llvm::LegalityQuery const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4868096)
#11 0x000000000478bbd2 llvm::CombinerHelper::isLegal(llvm::LegalityQuery const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x478bbd2)
#12 0x000000000479dfec llvm::CombinerHelper::matchCombineBuildUnmerge(llvm::MachineInstr&, llvm::MachineRegisterInfo&, llvm::Register&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x479dfec)
#13 0x0000000000c5331a (anonymous namespace)::AArch64PostLegalizerCombinerImpl::runCustomAction(unsigned int, llvm::GIMatchTableExecutor::MatcherState const&, llvm::SmallVector<llvm::MachineInstrBuilder, 4u>&) const AArch64PostLegalizerCombiner.cpp:0:0
#14 0x0000000000c58968 bool llvm::GIMatchTableExecutor::executeMatchTable<(anonymous namespace)::AArch64PostLegalizerCombinerImpl const, llvm::Bitset<0u>, std::optional<llvm::SmallVector<std::function<void (llvm::MachineInstrBuilder&)>, 4u>> ((anonymous namespace)::AArch64PostLegalizerCombinerImpl::*)(llvm::MachineOperand&) const, void ((anonymous namespace)::AArch64PostLegalizerCombinerImpl::*)(llvm::MachineInstrBuilder&, llvm::MachineInstr const&, int) const>((anonymous namespace)::AArch64PostLegalizerCombinerImpl const&, llvm::GIMatchTableExecutor::MatcherState&, llvm::GIMatchTableExecutor::ExecInfoTy<llvm::Bitset<0u>, std::optional<llvm::SmallVector<std::function<void (llvm::MachineInstrBuilder&)>, 4u>> ((anonymous namespace)::AArch64PostLegalizerCombinerImpl::*)(llvm::MachineOperand&) const, void ((anonymous namespace)::AArch64PostLegalizerCombinerImpl::*)(llvm::MachineInstrBuilder&, llvm::MachineInstr const&, int) const> const&, llvm::MachineIRBuilder&, unsigned char const*, llvm::TargetInstrInfo const&, llvm::MachineRegisterInfo&, llvm::TargetRegisterInfo const&, llvm::RegisterBankInfo const&, llvm::Bitset<0u> const&, llvm::CodeGenCoverage*) const (.isra.0.constprop.0) AArch64PostLegalizerCombiner.cpp:0:0
#15 0x0000000000c63e03 (anonymous namespace)::AArch64PostLegalizerCombinerImpl::tryCombineAll(llvm::MachineInstr&) const AArch64PostLegalizerCombiner.cpp:0:0
#16 0x0000000004774681 llvm::Combiner::combineMachineInstrs() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4774681)
#17 0x0000000000c647bb (anonymous namespace)::AArch64PostLegalizerCombiner::runOnMachineFunction(llvm::MachineFunction&) (.part.0) AArch64PostLegalizerCombiner.cpp:0:0
#18 0x0000000003090789 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#19 0x00000000036da9c6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36da9c6)
#20 0x00000000036dad71 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36dad71)
#21 0x00000000036db5df llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36db5df)
#22 0x00000000008f821f compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#23 0x00000000007c5db9 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c5db9)
#24 0x00007145a3e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#25 0x00007145a3e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#26 0x00000000008ed4c5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8ed4c5)
Program terminated with signal: SIGSEGV
Compiler returned: 139

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions