[llvm] r206473 - [AArch64] Implement the getCSRFirstUseCost API, mirroring that in ARM64.

Manman Ren manman.ren at gmail.com
Tue Jul 1 13:24:33 PDT 2014


I think I checked in a testing case (AArch64/ragreedy-csr.ll)
; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -regalloc=greedy
-regalloc-csr-first-time-cost=15 | FileCheck %s

; This testing case is reduced from 197.parser prune_match function.
; We make sure that we do not use callee-saved registers (x19 to x25).
; rdar://16162005

We can add another RUN line to make sure the testing case can pass with a
default value of 5.

Thanks,
Manman


On Tue, Jul 1, 2014 at 7:10 AM, Chad Rosier <mcrosier at codeaurora.org> wrote:

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


More information about the llvm-commits mailing list