[llvm-bugs] [Bug 40061] New: Greedy Register Allocator fires an assert
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Dec 17 21:05:13 PST 2018
https://bugs.llvm.org/show_bug.cgi?id=40061
Bug ID: 40061
Summary: Greedy Register Allocator fires an assert
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Register Allocator
Assignee: unassignedbugs at nondot.org
Reporter: serguei.katkov at azul.com
CC: llvm-bugs at lists.llvm.org, quentin.colombet at gmail.com
Created attachment 21240
--> https://bugs.llvm.org/attachment.cgi?id=21240&action=edit
Reproducer
The following assert is fired in Greedy Register allocator after the commit
https://reviews.llvm.org/rL339035:
$ ~/work/llvm/build/buildDA/bin/llc -late-remat-update-threshold=0
-code-model=large 1.ll -o /dev/null
llc: /home/skatkov/work/llvm/src/include/llvm/ADT/IntervalMap.h:631: unsigned
int llvm::IntervalMapImpl::LeafNode<KeyT, ValT, N, Traits>::insertFrom(unsigned
int&, unsigned int, KeyT, KeyT, ValT) [with KeyT = llvm::SlotIndex; ValT =
unsigned int; unsigned int N = 9u; Traits =
llvm::IntervalMapInfo<llvm::SlotIndex>]: Assertion `!Traits::stopLess(b, a) &&
"Invalid interval"' failed.
Stack dump:
0. Program arguments: /home/skatkov/work/llvm/build/buildDA/bin/llc
-late-remat-update-threshold=0 -code-model=large 1.ll -o /dev/null
1. Running pass 'Function Pass Manager' on module '1.ll'.
2. Running pass 'Greedy Register Allocator' on function '@test'
#0 0x00007fe0eebbdbc5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/skatkov/work/llvm/src/lib/Support/Unix/Signals.inc:495:0
#1 0x00007fe0eebbdc56 PrintStackTraceSignalHandler(void*)
/home/skatkov/work/llvm/src/lib/Support/Unix/Signals.inc:559:0
#2 0x00007fe0eebbbc91 llvm::sys::RunSignalHandlers()
/home/skatkov/work/llvm/src/lib/Support/Signals.cpp:67:0
#3 0x00007fe0eebbd669 SignalHandler(int)
/home/skatkov/work/llvm/src/lib/Support/Unix/Signals.inc:358:0
#4 0x00007fe0ebacd6d0 __restore_rt (/lib64/libpthread.so.0+0xf6d0)
#5 0x00007fe0eaef7277 __GI_raise
/usr/src/debug/glibc-2.17-c758a686/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#6 0x00007fe0eaef8968 __GI_abort
/usr/src/debug/glibc-2.17-c758a686/stdlib/abort.c:92:0
#7 0x00007fe0eaef0096 __assert_fail_base
/usr/src/debug/glibc-2.17-c758a686/assert/assert.c:92:0
#8 0x00007fe0eaef0142 (/lib64/libc.so.6+0x2f142)
#9 0x00007fe0ef34e0c4 llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned
int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insertFrom(unsigned int&,
unsigned int, llvm::SlotIndex, llvm::SlotIndex, unsigned int)
/home/skatkov/work/llvm/src/include/llvm/ADT/IntervalMap.h:634:0
#10 0x00007fe0ef34c89f llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u,
llvm::IntervalMapInfo<llvm::SlotIndex> >::insert(llvm::SlotIndex,
llvm::SlotIndex, unsigned int)
/home/skatkov/work/llvm/src/include/llvm/ADT/IntervalMap.h:1089:0
#11 0x00007fe0ef34423c llvm::SplitEditor::useIntv(llvm::SlotIndex,
llvm::SlotIndex) /home/skatkov/work/llvm/src/lib/CodeGen/SplitKit.cpp:755:0
#12 0x00007fe0ef349321
llvm::SplitEditor::splitSingleBlock(llvm::SplitAnalysis::BlockInfo const&)
/home/skatkov/work/llvm/src/lib/CodeGen/SplitKit.cpp:1580:0
#13 0x00007fe0ef289da0 (anonymous
namespace)::RAGreedy::splitAroundRegion(llvm::LiveRangeEdit&,
llvm::ArrayRef<unsigned int>)
/home/skatkov/work/llvm/src/lib/CodeGen/RegAllocGreedy.cpp:1708:0
#14 0x00007fe0ef28ba26 (anonymous
namespace)::RAGreedy::doRegionSplit(llvm::LiveInterval&, unsigned int, bool,
llvm::SmallVectorImpl<unsigned int>&)
/home/skatkov/work/llvm/src/lib/CodeGen/RegAllocGreedy.cpp:1995:0
#15 0x00007fe0ef28a959 (anonymous
namespace)::RAGreedy::tryRegionSplit(llvm::LiveInterval&,
llvm::AllocationOrder&, llvm::SmallVectorImpl<unsigned int>&)
/home/skatkov/work/llvm/src/lib/CodeGen/RegAllocGreedy.cpp:1856:0
#16 0x00007fe0ef28e6a2 (anonymous
namespace)::RAGreedy::trySplit(llvm::LiveInterval&, llvm::AllocationOrder&,
llvm::SmallVectorImpl<unsigned int>&)
/home/skatkov/work/llvm/src/lib/CodeGen/RegAllocGreedy.cpp:2483:0
#17 0x00007fe0ef290a78 (anonymous
namespace)::RAGreedy::selectOrSplitImpl(llvm::LiveInterval&,
llvm::SmallVectorImpl<unsigned int>&, llvm::SmallSet<unsigned int, 16u,
std::less<unsigned int> >&, unsigned int)
/home/skatkov/work/llvm/src/lib/CodeGen/RegAllocGreedy.cpp:3082:0
#18 0x00007fe0ef28f814 (anonymous
namespace)::RAGreedy::selectOrSplit(llvm::LiveInterval&,
llvm::SmallVectorImpl<unsigned int>&)
/home/skatkov/work/llvm/src/lib/CodeGen/RegAllocGreedy.cpp:2762:0
#19 0x00007fe0ef279e0c llvm::RegAllocBase::allocatePhysRegs()
/home/skatkov/work/llvm/src/lib/CodeGen/RegAllocBase.cpp:113:0
#20 0x00007fe0ef291eb3 (anonymous
namespace)::RAGreedy::runOnMachineFunction(llvm::MachineFunction&)
/home/skatkov/work/llvm/src/lib/CodeGen/RegAllocGreedy.cpp:3243:0
#21 0x00007fe0ef128390
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/skatkov/work/llvm/src/lib/CodeGen/MachineFunctionPass.cpp:74:0
#22 0x00007fe0eedd9b5c llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/skatkov/work/llvm/src/lib/IR/LegacyPassManager.cpp:1644:0
#23 0x00007fe0eedd9d99 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/skatkov/work/llvm/src/lib/IR/LegacyPassManager.cpp:1679:0
#24 0x00007fe0eedda181 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/skatkov/work/llvm/src/lib/IR/LegacyPassManager.cpp:1744:0
#25 0x00007fe0eedda951 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/skatkov/work/llvm/src/lib/IR/LegacyPassManager.cpp:1857:0
#26 0x00007fe0eeddabd1 llvm::legacy::PassManager::run(llvm::Module&)
/home/skatkov/work/llvm/src/lib/IR/LegacyPassManager.cpp:1889:0
#27 0x0000000000432674 compileModule(char**, llvm::LLVMContext&)
/home/skatkov/work/llvm/src/tools/llc/llc.cpp:600:0
#28 0x00000000004309af main /home/skatkov/work/llvm/src/tools/llc/llc.cpp:351:0
#29 0x00007fe0eaee3445 __libc_start_main
/usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:308:0
#30 0x000000000042e889 _start
(/home/skatkov/work/llvm/build/buildDA/bin/llc+0x42e889)
Aborted (core dumped)
The crash is not reproducible if I run it as:
$ ~/work/llvm/build/buildDA/bin/llc -late-remat-update-threshold=100000
-code-model=large 1.ll -o /dev/null
The reproducer is reduced by bugpoint.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181218/f90c2499/attachment-0001.html>
More information about the llvm-bugs
mailing list