[PATCH] D49519: [RegisterCoalescer] Delay live interval update work until the rematerialization for all the uses from the same def is done

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 11 20:23:45 PST 2018


skatkov added a comment.

Hello @wmi, in our local fuzzing testing we've got the following assert:
src/include/llvm/ADT/IntervalMap.h:630: 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.

Triage points to this patch. Revert of this patch eliminates an assert. Also if I specify -late-remat-update-threshold=100000 test also passes.
Unfortunately at this moment I cannot create a LLVM reproducer for this bug. Also This bug is not reproducible on the current trunk however I have a suspicion that it is just hided not fixed.
I continue investigation.

However if you have some insides or suggestion what it could be or what other commits could fix that bug, could you please share it, it would probably save me a lot of time to narrowing it down.

The stack trace of the crash looks like:
#0  0x00007ffff700c5d7 in raise () from /lib64/libc.so.6
#1  0x00007ffff700dcc8 in abort () from /lib64/libc.so.6
#2  0x00007ffff7005546 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff70055f2 in __assert_fail () from /lib64/libc.so.6
#4  0x00007ffff13b334f in llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insertFrom (this=this at entry=0x7fff4811c0b8, Pos=@0x7fff5d8d4920: 2,

  Size=2, a=..., a at entry=..., b=..., y=<optimized out>) at include/llvm/ADT/IntervalMap.h:630

#5  0x00007ffff13bd56d in llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insert (this=this at entry=0x7fff4811c0b8, a=a at entry=..., b=..., b at entry=...,

  y=<optimized out>) at include/llvm/ADT/IntervalMap.h:1092

#6  0x00007ffff13bd8ef in llvm::SplitEditor::useIntv (this=this at entry=0x7fff4811bff0, Start=Start at entry=..., End=...)

  at lib/CodeGen/SplitKit.cpp:754

#7  0x00007ffff13beeee in llvm::SplitEditor::splitSingleBlock (this=0x7fff4811bff0, BI=...) at lib/CodeGen/SplitKit.cpp:1580
#8  0x00007ffff13297c7 in splitAroundRegion (UsedCands=..., LREdit=..., this=0x7fff482fd010)

  at lib/CodeGen/RegAllocGreedy.cpp:1685

#9  (anonymous namespace)::RAGreedy::doRegionSplit (this=0x7fff482fd010, VirtReg=..., BestCand=6, HasCompact=<optimized out>, NewVRegs=...)

  at lib/CodeGen/RegAllocGreedy.cpp:1968

#10 0x00007ffff1335b49 in tryRegionSplit (NewVRegs=..., Order=..., VirtReg=..., this=<optimized out>)

  at lib/CodeGen/RegAllocGreedy.cpp:1832

#11 trySplit (NewVRegs=..., Order=..., VirtReg=..., this=<optimized out>) at lib/CodeGen/RegAllocGreedy.cpp:2453
#12 (anonymous namespace)::RAGreedy::selectOrSplitImpl (this=0x7fff482fd010, VirtReg=..., NewVRegs=..., FixedRegisters=..., Depth=1, Depth at entry=0)

  at lib/CodeGen/RegAllocGreedy.cpp:3052

#13 0x00007ffff1335f77 in (anonymous namespace)::RAGreedy::selectOrSplit (this=0x7fff482fd010, VirtReg=..., NewVRegs=...)

  at lib/CodeGen/RegAllocGreedy.cpp:2732

#14 0x00007ffff131905e in llvm::RegAllocBase::allocatePhysRegs (this=0x7fff482fd078, this at entry=0x7ffff3e19006 <llvm::MachineModuleInfo::ID>)

  at lib/CodeGen/RegAllocBase.cpp:113

#15 0x00007ffff132f7b1 in (anonymous namespace)::RAGreedy::runOnMachineFunction (this=0x7fff482fd010, mf=...)

  at lib/CodeGen/RegAllocGreedy.cpp:3207

#16 0x00007ffff123b6a5 in llvm::MachineFunctionPass::runOnFunction (this=0x7fff482fd010, F=...)

  at lib/CodeGen/MachineFunctionPass.cpp:61

#17 0x00007ffff1061957 in llvm::FPPassManager::runOnFunction (this=0x7fff480bd530, F=...) at lib/IR/LegacyPassManager.cpp:1586


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D49519/new/

https://reviews.llvm.org/D49519





More information about the llvm-commits mailing list