Hi Jakob, I've got a good test case that I'm working on at the moment. I noticed something odd though: Is '0' a valid register unit? I'm seeing a LiveInterval with li->reg == 0 show up, which previously wasn't valid. We have a few checks around the place to disregard the '0' physreg - could these trigger on interaction with a '0' interval? That could introduce some subtle bugs. Cheers, Lang. On Wed, Sep 5, 2012 at 4:07 AM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:> > On Sep 2, 2012, at 11:52 PM, Lang Hames <lhames at gmail.com> wrote: > > > Hi Sergei, > > > > I just fixed the broken test case for PR13719 with r163107, but from the > debugging output you've posted it suspect it won't fix your test case. > > > > Your analysis looks good - findLastUseBefore(..) doesn't appear to be > handling physregs. I'm surprised that isn't causing more failures. I'll see > if I can find a failing case in the LLVM test-suite (it's been a while > since I ran live-interval-update over all of it) and try out your > modifications to findLastUseBefore. > > I think Sergei's analysis is correct, but you probably don't want to be > scanning use-def chains for physregs. You are pretty much guaranteed to > visit the entire function. > > Physreg live ranges are usually short. It would be better to scan > instructions instead of use-def chains for physregs. > > /jakob > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120910/f8c8aac8/attachment.html>
On Sep 10, 2012, at 2:26, Lang Hames <lhames at gmail.com> wrote:> Is '0' a valid register unit?Yes it is. /Jakob
On Sep 10, 2012, at 2:26 AM, Lang Hames <lhames at gmail.com> wrote:> I've got a good test case that I'm working on at the moment. I noticed something odd though: Is '0' a valid register unit? I'm seeing a LiveInterval with li->reg == 0 show up, which previously wasn't valid. We have a few checks around the place to disregard the '0' physreg - could these trigger on interaction with a '0' interval? That could introduce some subtle bugs.Right. Regunits are numbered independently from physregs, starting from 0. Each regunit corresponds to one or two physregs, the 'roots', which are typically leaf registers. The mapping is exposed by MCRegUnitIterator and MCRegUnitRootIterator. Regunit live intervals are more strictly defined than the old physreg intervals. The same way a virtreg interval can be computed from all machine operands mentioning the virtreg, regunit intervals can be computed from all physreg operands with TRI->hasRegUnit(MO.getReg(), RegUnit). However, while virtreg live intervals have a one-to-one mapping with machine operands, regunit intervals have a many-to-many mapping with the operands. A single physreg operand can affect multiple regunit intervals, and a regunit interval can be affected by different (overlapping) physregs. It is best to avoid the MCRegUnitRootIterator+MCSuperRegIterator combination because the set of super-registers can be quite large on ARM. /jakob
Hi Jakob, Sergei, I've updated getLastUseBefore in r163685. I'm still looking into a couple of errors, but I suspect that these are due to my build configuration, rather than the patch. Sergei - could you let me know if this fixes your issue? Thanks again for all of your work tracking this down.> It is best to avoid the MCRegUnitRootIterator+MCSuperRegIterator > combination because the set of super-registers can be quite large on ARM. >Done. I've used TRI.hasRegUnit as suggested. Thanks for the advice! Cheers, Lang. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120912/5c00ae0a/attachment.html>