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

Chad Rosier mcrosier at codeaurora.org
Tue Jul 1 07:10:34 PDT 2014


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





More information about the llvm-commits mailing list