<div dir="ltr"><br><div>I think I checked in a testing case (AArch64/ragreedy-csr.ll)</div><div><div>; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -regalloc=greedy -regalloc-csr-first-time-cost=15 | FileCheck %s</div><div>
<br></div><div>; This testing case is reduced from 197.parser prune_match function.</div><div>; We make sure that we do not use callee-saved registers (x19 to x25).</div><div>; rdar://16162005</div></div><div><br></div><div>
We can add another RUN line to make sure the testing case can pass with a default value of 5.</div><div><br></div><div>Thanks,</div><div>Manman</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 1, 2014 at 7:10 AM, Chad Rosier <span dir="ltr"><<a href="mailto:mcrosier@codeaurora.org" target="_blank">mcrosier@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Hal,<br>
Sorry, I missed the original message.  This commit was to the now dead AArch64 branch.  Ana was just trying to do a competitive analysis against the ARM64 (now AArch64) branch.  The ARM64 commit, r205248, did not have a test case either.<br>

<br>
Manman,<br>
Can you please add a test case for r205248?  Hal has provided one below.<br>
<br>
 Cjad<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
-----Original Message-----<br>
From: Hal Finkel [mailto:<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>]<br>
Sent: Monday, June 30, 2014 7:55 PM<br>
To: Chad Rosier<br>
Cc: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
Subject: Re: [llvm] r206473 - [AArch64] Implement the getCSRFirstUseCost API, mirroring that in ARM64.<br>
<br>
Any thoughts on this?<br>
<br>
 -Hal<br>
<br>
----- Original Message -----<br>
> From: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>
> To: "Chad Rosier" <<a href="mailto:mcrosier@codeaurora.org">mcrosier@codeaurora.org</a>><br>
> Cc: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> Sent: Sunday, April 20, 2014 10:33:20 PM<br>
> Subject: Re: [llvm] r206473 - [AArch64] Implement the getCSRFirstUseCost      API,    mirroring that in ARM64.<br>
><br>
> Chad,<br>
><br>
> I understand you're mirroring, but do you have a test case for this?<br>
> I don't think that Manman had a test case for the original commit<br>
> either.<br>
><br>
> If I understand what is going on correctly, it should be easy to make<br>
> one. You just need something like this:<br>
><br>
> entry:<br>
> br i1 undef, label %hot, label %cold<br>
><br>
> cold:<br>
>   i32 %v = call i32 whatever() ; this value must be saved, and we<br>
>   should spill here instead of using a callee-saved register<br>
>   call void perror(undef) ; just to make this cold; metadata will<br>
>   also work<br>
>   call asm ; clobber all caller-saved registers<br>
><br>
> hot:<br>
>   %p = phi [0, %entry, %v, %cold]<br>
>   ret i32 %p<br>
><br>
>  -Hal<br>
><br>
> ----- Original Message -----<br>
> > From: "Chad Rosier" <<a href="mailto:mcrosier@codeaurora.org">mcrosier@codeaurora.org</a>><br>
> > To: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> > Sent: Thursday, April 17, 2014 11:19:54 AM<br>
> > Subject: [llvm] r206473 - [AArch64] Implement the<br>
> > getCSRFirstUseCost API,     mirroring that in ARM64.<br>
> ><br>
> > Author: mcrosier<br>
> > Date: Thu Apr 17 11:19:54 2014<br>
> > New Revision: 206473<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=206473&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=206473&view=rev</a><br>
> > Log:<br>
> > [AArch64] Implement the getCSRFirstUseCost API, mirroring that in<br>
> > ARM64.<br>
> ><br>
> > Modified:<br>
> >     llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h<br>
> ><br>
> > Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AA" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AA</a><br>
> > rch64RegisterInfo.h?rev=206473&r1=206472&r2=206473&view=diff<br>
> > ====================================================================<br>
> > ==========<br>
> > --- llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h (original)<br>
> > +++ llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h Thu Apr 17<br>
> > 11:19:54 2014<br>
> > @@ -30,6 +30,13 @@ struct AArch64RegisterInfo : public AArc<br>
> >    const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF =<br>
> >    0)<br>
> >    const;<br>
> >    const uint32_t *getCallPreservedMask(CallingConv::ID) const;<br>
> ><br>
> > +  unsigned getCSRFirstUseCost() const {<br>
> > +    // The cost will be compared against BlockFrequency where<br>
> > entry<br>
> > has the<br>
> > +    // value of 1 << 14. A value of 5 will choose to spill or<br>
> > split<br>
> > really<br>
> > +    // cold path instead of using a callee-saved register.<br>
> > +    return 5;<br>
> > +  }<br>
> > +<br>
> >    const uint32_t *getTLSDescCallPreservedMask() const;<br>
> ><br>
> >    BitVector getReservedRegs(const MachineFunction &MF) const;<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
> ><br>
><br>
> --<br>
> Hal Finkel<br>
> Assistant Computational Scientist<br>
> Leadership Computing Facility<br>
> Argonne National Laboratory<br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
<br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
<br>
</div></div></blockquote></div><br></div>