[PATCH] D35730: RA: Remove assert on empty live intervals

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 18:00:53 PDT 2017


MatzeB added a reviewer: kparzysz.
MatzeB added inline comments.


================
Comment at: lib/CodeGen/RegAllocBase.cpp:147
       DEBUG(dbgs() << "queuing new interval: " << *SplitVirtReg << "\n");
-      assert(!SplitVirtReg->empty() && "expecting non-empty interval");
       assert(TargetRegisterInfo::isVirtualRegister(SplitVirtReg->reg) &&
----------------
MatzeB wrote:
> arsenm wrote:
> > qcolombet wrote:
> > > qcolombet wrote:
> > > > arsenm wrote:
> > > > > qcolombet wrote:
> > > > > > If that's empty and legit, I believe we shouldn't try to enqueue it.
> > > > > It still needs to be allocated to a register, otherwise an undef vreg use is left around
> > > > The problem IIRC is that I believe later code is not fine with that.
> > > > (BTW, you could have waited for the discussion to be over before committing...)
> > > Regardless of the surrounding code working or not in that case, having an empty live-range that needs a register sounds plain wrong to me.
> > Sorry, I had talked to Matthias about this earlier. The assert is also fairly new and was added last year in r279625 with subregister changes.
> An empty live range that needs a register looks like this and is valid IMO and the normal code handled it fine in my experiments (but it needs to assign a register obviously):
> ```
>   = USE vreg0<undef>
> ```
> 
Ah the infamous r279625, let's add Krzysztof to the reviwers.


https://reviews.llvm.org/D35730





More information about the llvm-commits mailing list