Skip to content

Assertion `isImm() && "Wrong MachineOperand accessor"' failed #169485

@gregbedwell

Description

@gregbedwell

https://godbolt.org/z/b7Y41Er6z
Bisects to bb78728

define <8 x float> @widget(<2 x float> %arg) #0 {
bb:
  %call = tail call float null()
  %shufflevector = shufflevector <2 x float> %arg, <2 x float> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
  %freeze = freeze <8 x float> %shufflevector
  %insertelement = insertelement <8 x float> %freeze, float 0.000000e+00, i64 3
  %shufflevector1 = shufflevector <8 x float> %insertelement, <8 x float> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
  ret <8 x float> %shufflevector1
}

attributes #0 = { "target-cpu"="znver2" }
llc: /root/llvm-project/llvm/include/llvm/CodeGen/MachineOperand.h:557: int64_t llvm::MachineOperand::getImm() const: Assertion `isImm() && "Wrong MachineOperand accessor"' 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 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'Greedy Register Allocator' on function '@widget'
 #0 0x00000000041bfd48 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41bfd48)
 #1 0x00000000041bcbf4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007ba8b8e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007ba8b8e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007ba8b8e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007ba8b8e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007ba8b8e2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007ba8b8e39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x00000000025163f6 llvm::X86InstrInfo::commuteInstructionImpl(llvm::MachineInstr&, bool, unsigned int, unsigned int) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x25163f6)
 #9 0x00000000033ea3f4 llvm::TargetInstrInfo::commuteInstruction(llvm::MachineInstr&, bool, unsigned int, unsigned int) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x33ea3f4)
#10 0x000000000251b42e llvm::X86InstrInfo::commuteOperandsForFold(llvm::MachineInstr&, unsigned int) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x251b42e)
#11 0x000000000251bbae llvm::X86InstrInfo::foldMemoryOperandImpl(llvm::MachineFunction&, llvm::MachineInstr&, unsigned int, llvm::ArrayRef<llvm::MachineOperand>, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, unsigned int, llvm::Align, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x251bbae)
#12 0x000000000251bed2 llvm::X86InstrInfo::foldMemoryOperandImpl(llvm::MachineFunction&, llvm::MachineInstr&, llvm::ArrayRef<unsigned int>, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, int, llvm::LiveIntervals*, llvm::VirtRegMap*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x251bed2)
#13 0x00000000033eacae llvm::TargetInstrInfo::foldMemoryOperand(llvm::MachineInstr&, llvm::ArrayRef<unsigned int>, int, llvm::LiveIntervals*, llvm::VirtRegMap*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x33eacae)
#14 0x000000000351f784 (anonymous namespace)::InlineSpiller::foldMemoryOperand(llvm::ArrayRef<std::pair<llvm::MachineInstr*, unsigned int>>, llvm::MachineInstr*) InlineSpiller.cpp:0:0
#15 0x00000000035213ea (anonymous namespace)::InlineSpiller::spillAroundUses(llvm::Register) InlineSpiller.cpp:0:0
#16 0x00000000035237e9 (anonymous namespace)::InlineSpiller::spill(llvm::LiveRangeEdit&, llvm::AllocationOrder*) InlineSpiller.cpp:0:0
#17 0x00000000032de950 llvm::RAGreedy::selectOrSplitImpl(llvm::LiveInterval const&, llvm::SmallVectorImpl<llvm::Register>&, llvm::SmallSet<llvm::Register, 16u, std::less<llvm::Register>>&, llvm::SmallVector<std::pair<llvm::LiveInterval const*, llvm::MCRegister>, 8u>&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x32de950)
#18 0x00000000032df417 llvm::RAGreedy::selectOrSplit(llvm::LiveInterval const&, llvm::SmallVectorImpl<llvm::Register>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x32df417)
#19 0x00000000035453e0 llvm::RegAllocBase::allocatePhysRegs() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x35453e0)
#20 0x00000000032dafeb llvm::RAGreedy::run(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x32dafeb)
#21 0x00000000032dbc3a (anonymous namespace)::RAGreedyLegacy::runOnMachineFunction(llvm::MachineFunction&) RegAllocGreedy.cpp:0:0
#22 0x00000000030ab719 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#23 0x00000000036f68d6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f68d6)
#24 0x00000000036f6c81 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f6c81)
#25 0x00000000036f74ef llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f74ef)
#26 0x00000000008f953f compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#27 0x00000000007c66e9 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c66e9)
#28 0x00007ba8b8e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#29 0x00007ba8b8e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#30 0x00000000008ee7e5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8ee7e5)
Program terminated with signal: SIGSEGV
Compiler returned: 139

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions