[clang] [llvm] [CodeGen] Fix VNInfo mapping in LiveRange::assign (PR #148790)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 15 00:29:38 PDT 2025
pzzp wrote:
This isssue lead to a crash on our private target., but we did not reproduce it in x86 or AMDGPU
crash stacktrace:
llc: /root/baidu/xpu/llvm19/llvm/lib/CodeGen/LiveIntervals.cpp:397: void llvm::LiveIntervals::extendSegmentsToUses(llvm::LiveRange&, llvm::LiveIntervals::ShrinkToUsesWorkList&, llvm::Register, llvm::LaneBitmask): Assertion `ExtVNI == VNI && "Unexpected existing value number"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: bin/llc /root/baidu/xpu/llvm19/llvm/test/CodeGen/XCN/register_coalescer_crash.ll
1. Running pass 'CallGraph Pass Manager' on module '/root/baidu/xpu/llvm19/llvm/test/CodeGen/XCN/register_coalescer_crash.ll'.
2. Running pass 'Register Coalescer' on function '@_ZN3cub26DeviceHistogramSweepKernelINS_17DispatchHistogramILi4ELi3EPtiiiE23PtxHistogramSweepPolicyELi0ELi4ELi3ES2_iNS3_14ScaleTransformENS3_17PassThruTransformEiEEvT3_NS_12ArrayWrapperIiXT2_EEES9_NS8_IPT4_XT2_EEESC_NS8_IT6_XT2_EEENS8_IT5_XT2_EEET7_SH_SH_iNS_9GridQueueIiEE'
#0 0x0000555666017d10 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (bin/llc+0x2c09d10)
#1 0x000055566601511f llvm::sys::RunSignalHandlers() (bin/llc+0x2c0711f)
#2 0x0000555666015275 SignalHandler(int) Signals.cpp:0:0
#3 0x00007f69f3b27520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f69f3b7b9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007f69f3b27476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007f69f3b0d7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007f69f3b0d71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007f69f3b1ee96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x0000555664eabbde llvm::LiveIntervals::extendSegmentsToUses(llvm::LiveRange&, llvm::SmallVector<std::pair<llvm::SlotIndex, llvm::VNInfo*>, 16u>&, llvm::Register, llvm::LaneBitmask) (bin/llc+0x1a9dbde)
#10 0x0000555664eabdeb llvm::LiveIntervals::shrinkToUses(llvm::LiveInterval::SubRange&, llvm::Register) (bin/llc+0x1a9ddeb)
#11 0x0000555664eac316 llvm::LiveIntervals::shrinkToUses(llvm::LiveInterval*, llvm::SmallVectorImpl<llvm::MachineInstr*>*) (bin/llc+0x1a9e316)
#12 0x000055566519104f (anonymous namespace)::RegisterCoalescer::shrinkToUses(llvm::LiveInterval*, llvm::SmallVectorImpl<llvm::MachineInstr*>*) RegisterCoalescer.cpp:0:0
#13 0x00005556651a0782 (anonymous namespace)::RegisterCoalescer::joinCopy(llvm::MachineInstr*, bool&, llvm::SmallPtrSetImpl<llvm::MachineInstr*>&) (.constprop.0) RegisterCoalescer.cpp:0:0
#14 0x00005556651a27fc (anonymous namespace)::RegisterCoalescer::copyCoalesceWorkList(llvm::MutableArrayRef<llvm::MachineInstr*>) RegisterCoalescer.cpp:0:0
#15 0x00005556651a36fd (anonymous namespace)::RegisterCoalescer::coalesceLocals() RegisterCoalescer.cpp:0:0
#16 0x00005556651a6213 (anonymous namespace)::RegisterCoalescer::runOnMachineFunction(llvm::MachineFunction&) RegisterCoalescer.cpp:0:0
#17 0x0000555664f82607 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#18 0x0000555665572b26 llvm::FPPassManager::runOnFunction(llvm::Function&) (bin/llc+0x2164b26)
#19 0x0000555664a74f5a (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) CallGraphSCCPass.cpp:0:0
#20 0x00005556655736e5 llvm::legacy::PassManagerImpl::run(llvm::Module&) (bin/llc+0x21656e5)
#21 0x0000555663ac32de compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#22 0x00005556639ee3f6 main (bin/llc+0x5e03f6)
#23 0x00007f69f3b0ed90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#24 0x00007f69f3b0ee40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#25 0x0000555663ab9b85 _start (bin/llc+0x6abb85
https://github.com/llvm/llvm-project/pull/148790
More information about the llvm-commits
mailing list