<br><br><div class="gmail_quote">On Wed Jan 07 2015 at 8:40:55 AM Daniel Sanders <<a href="mailto:Daniel.Sanders@imgtec.com">Daniel.Sanders@imgtec.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> From: Eric Christopher [<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>]<br>
> Sent: 06 January 2015 20:15<br>
> To: Toma Tabacu; Daniel Sanders<br>
> Cc: <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
> Subject: Re: [PATCH] [mips] Always clobber $1 for MIPS inline asm.<br>
><br>
> > We could stop using $at but why is that beneficial? Why does universally<br>
> >  reserving a register to support an (uncommon) construct make more sense to<br>
> >  you than having that construct properly indicate that it may clobber a<br>
> >  specific register? The former sounds like a sledgehammer to me.<br>
><br>
> Totally is, but blindly adding clobbers is much the same, just a more<br>
> focused hammer. I'm not against it, mostly that the original discussion<br>
> didn't say any of these things.<br>
<br>
Agreed. It's currently a compromise between precision and difficulty of implementation.<br>
<br>
> > The work pre-dates me but as far as I can tell the developers of the Mips<br>
> >  port deliberately decided not to reserve $at and emit code in '.set noat'<br>
> >  mode. Presumably this was to see how much of gcc's $at usage is essential<br>
> >  to the correct operation of the output code. It turns out that<br>
><br>
> No, it's been known for a while that the use of macro instructions isn't a<br>
> good idea in the compiler. It's why we switched the gcc port away from<br>
> using them as well.<br>
<br>
Out of curiosity, when did the switch happen? I thought it was emitting macros last time I looked (probably around June) but I could be mistaken.<br></blockquote><div><br></div><div>2001/2002? At one point it emitted things like la, etc.</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> > the answer is 'almost none'. In LLVM's CodeGen, $at isn't particularly<br>
> >  special. The few instructions/macros/<u></u>relocations that need a temporary<br>
> >  register to be $at describe this with an implicit def of AT. Branches like<br>
> >  B are a good example of this (it's worth pointing out that most of the time<br>
> >  we don't really need to clobber $at since the branch target will be in<br>
> >  range). Where the temporary doesn't really need to be $at, we just ask the<br>
> >  register allocator to give us any register. The hard work to avoid<br>
> >  reserving $at is already done and I don't see a good reason to change the<br>
> >  original decision.<br>
><br>
> Agreed. Please do make sure that the places where you need to do this are<br>
> commented though. It's pretty poorly commented at the moment.<br>
><br>
> -eric<br>
<br>
Toma: Could you add a suitable comment to getClobbers()?<br>
<br>
> <a href="http://reviews.llvm.org/D6638" target="_blank">http://reviews.llvm.org/D6638</a><br>
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</blockquote></div>