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

Serguei Katkov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 19:13:05 PST 2018


Thank you, Wei.

I'll let you know if I manage to do any progress on this.

Thank you,
Serguei.

> -----Original Message-----
> From: Wei Mi <wmi at google.com>
> Sent: Thursday, December 13, 2018 5:45 AM
> To: reviews+D49519+public+ff99b7aadd2795cb at reviews.llvm.org
> Cc: quentin.colombet at gmail.com; Matthias Braun <matze at braunis.de>;
> Serguei Katkov <serguei.katkov at azul.com>; marcello.maggioni at gmail.com;
> tpr.llvm at botech.co.uk; Chandler Carruth <chandlerc at gmail.com>; David Li
> <davidxl at google.com>; llvm-commits <llvm-commits at lists.llvm.org>
> Subject: Re: [PATCH] D49519: [RegisterCoalescer] Delay live interval update
> work until the rematerialization for all the uses from the same def is done
> 
> Hi Serguei,
> 
> I cannot think of what could possibly go wrong by looking at the stacktrace.
> One thing may be worthy to try is to set
> -late-remat-update-threshold=0 and then try the fuzzing test, that may
> expose the problem on trunk or make creating the reproducer easier.
> 
> Thanks,
> Wei.
> 
> On Tue, Dec 11, 2018 at 8:23 PM Serguei Katkov via Phabricator
> <reviews at reviews.llvm.org> wrote:
> >
> > 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