<div>Hi Tom,</div><div><br></div><div>As far as I can tell EmitLiveInCopies is just there to handle physreg arguments and return values. Is there any reason for these to change late in your backend?</div><div><br></div><div>
- Lang.</div><br><br><div class="gmail_quote">On Tue, Feb 14, 2012 at 7:22 AM, Tom Stellard <span dir="ltr"><<a href="mailto:thomas.stellard@amd.com">thomas.stellard@amd.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Feb 13, 2012 at 10:17:11PM -0800, Lang Hames wrote:<br>
> Hi Tom,<br>
><br>
> I'm pretty sure this function should only ever be called once, by<br>
> SelectionDAG. Do you know where the second call is coming from in your code?<br>
><br>
> Cheers,<br>
> Lang.<br>
<br>
</div>Hi Lang,<br>
<br>
I was calling EmitLiveInCopies() from one of my backend specific passes.<br>
If the function can only be called once, then I'll just try to merge<br>
that pass with into the SelectionDAG.<br>
<br>
Thanks,<br>
Tom<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On Mon, Feb 13, 2012 at 7:03 PM, Stellard, Thomas <<a href="mailto:Tom.Stellard@amd.com">Tom.Stellard@amd.com</a>>wrote:<br>
><br>
> > This patch seems to have been lost on the llvm-commits mailing list.<br>
> >  Would someone be able to review it?<br>
> ><br>
> > Thanks,<br>
> > Tom<br>
> > ________________________________________<br>
> > From: <a href="mailto:llvm-commits-bounces@cs.uiuc.edu">llvm-commits-bounces@cs.uiuc.edu</a> [<a href="mailto:llvm-commits-bounces@cs.uiuc.edu">llvm-commits-bounces@cs.uiuc.edu</a>]<br>
> > on behalf of Tom Stellard [<a href="mailto:thomas.stellard@amd.com">thomas.stellard@amd.com</a>]<br>
> > Sent: Friday, February 03, 2012 1:55 PM<br>
> > To: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> > Subject: Re: [llvm-commits] [PATCH] MachineRegisterInfo: Don't emit the<br>
> > same livein copy more than once<br>
> ><br>
> > On Fri, Jan 27, 2012 at 02:56:03PM -0500, Tom Stellard wrote:<br>
> > > ---<br>
> > ><br>
> > > Is MachineRegisterInfo::EmitLiveInCopies() only meant to be called once<br>
> > > per compile?  If I call it more than once, it emits duplicate copies<br>
> > > which causes the live interval analysis to fail.<br>
> > ><br>
> > >  lib/CodeGen/MachineRegisterInfo.cpp |    4 +++-<br>
> > >  1 files changed, 3 insertions(+), 1 deletions(-)<br>
> > ><br>
> > > diff --git a/lib/CodeGen/MachineRegisterInfo.cpp<br>
> > b/lib/CodeGen/MachineRegisterInfo.cpp<br>
> > > index 266ebf6..fc787f2 100644<br>
> > > --- a/lib/CodeGen/MachineRegisterInfo.cpp<br>
> > > +++ b/lib/CodeGen/MachineRegisterInfo.cpp<br>
> > > @@ -227,7 +227,9 @@<br>
> > MachineRegisterInfo::EmitLiveInCopies(MachineBasicBlock *EntryMBB,<br>
> > >          // complicated by the debug info code for arguments.<br>
> > >          LiveIns.erase(LiveIns.begin() + i);<br>
> > >          --i; --e;<br>
> > > -      } else {<br>
> > > +        //Make sure we don't emit the same livein copies twice, in case<br>
> > this<br>
> > > +        //function is called more than once.<br>
> > > +      } else if (def_empty(LiveIns[i].second)) {<br>
> > >          // Emit a copy.<br>
> > >          BuildMI(*EntryMBB, EntryMBB->begin(), DebugLoc(),<br>
> > >                  TII.get(TargetOpcode::COPY), LiveIns[i].second)<br>
> > > --<br>
> > > 1.7.6.4<br>
> > ><br>
> > ><br>
> ><br>
> > Reposting this as a diff that can be applied via patch -P0 for SVN<br>
> > users.<br>
> ><br>
> > -Tom<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > LLVM Developers mailing list<br>
> > <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
> ><br>
<br>
</div></div></blockquote></div><br>