[llvm] r246990 - [mips] Reserve address spaces 1-255 for software use.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 03:14:33 PDT 2015


Thanks. Merged in r247538.

> -----Original Message-----
> From: Tom Stellard [mailto:tom at stellard.net]
> Sent: 10 September 2015 14:55
> To: Daniel Sanders
> Cc: llvm-commits at lists.llvm.org; Hans Wennborg (hans at chromium.org);
> pekka.jaaskelainen at tut.fi
> Subject: Re: [llvm] r246990 - [mips] Reserve address spaces 1-255 for
> software use.
> 
> On Thu, Sep 10, 2015 at 12:33:46PM +0000, Daniel Sanders wrote:
> > Hi,
> >
> > Is it ok to merge this to the 3.7 branch so that it's in 3.7.1?
> 
> Sure, go ahead.
> 
> -Tom
> >
> > > -----Original Message-----
> > > From: llvm-commits [mailto:llvm-commits-bounces at lists.llvm.org] On
> Behalf
> > > Of Daniel Sanders via llvm-commits
> > > Sent: 08 September 2015 10:07
> > > To: llvm-commits at lists.llvm.org
> > > Subject: [llvm] r246990 - [mips] Reserve address spaces 1-255 for
> software
> > > use.
> > >
> > > Author: dsanders
> > > Date: Tue Sep  8 04:07:03 2015
> > > New Revision: 246990
> > >
> > > URL: http://llvm.org/viewvc/llvm-project?rev=246990&view=rev
> > > Log:
> > > [mips] Reserve address spaces 1-255 for software use.
> > >
> > > Summary: And define them to have noop casts with address spaces 0-
> 255.
> > >
> > > Reviewers: pekka.jaaskelainen
> > >
> > > Subscribers: pekka.jaaskelainen, llvm-commits
> > >
> > > Differential Revision: http://reviews.llvm.org/D12678
> > >
> > > Added:
> > >     llvm/trunk/test/CodeGen/Mips/llvm-ir/addrspacecast.ll
> > > Modified:
> > >     llvm/trunk/lib/Target/Mips/MipsISelLowering.h
> > >
> > > Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h
> > > URL: http://llvm.org/viewvc/llvm-
> > >
> project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=246990&r1=246
> > > 989&r2=246990&view=diff
> > >
> ==========================================================
> > > ====================
> > > --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original)
> > > +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Tue Sep  8 04:07:03
> 2015
> > > @@ -269,6 +269,14 @@ namespace llvm {
> > >      unsigned getRegisterByName(const char* RegName, EVT VT,
> > >                                 SelectionDAG &DAG) const override;
> > >
> > > +    /// Returns true if a cast between SrcAS and DestAS is a noop.
> > > +    bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const
> > > override {
> > > +      // Mips doesn't have any special address spaces so we just reserve
> > > +      // the first 256 for software use (e.g. OpenCL) and treat casts
> > > +      // between them as noops.
> > > +      return SrcAS < 256 && DestAS < 256;
> > > +    }
> > > +
> > >    protected:
> > >      SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const;
> > >
> > >
> > > Added: llvm/trunk/test/CodeGen/Mips/llvm-ir/addrspacecast.ll
> > > URL: http://llvm.org/viewvc/llvm-
> > > project/llvm/trunk/test/CodeGen/Mips/llvm-
> > > ir/addrspacecast.ll?rev=246990&view=auto
> > >
> ==========================================================
> > > ====================
> > > --- llvm/trunk/test/CodeGen/Mips/llvm-ir/addrspacecast.ll (added)
> > > +++ llvm/trunk/test/CodeGen/Mips/llvm-ir/addrspacecast.ll Tue Sep  8
> > > 04:07:03 2015
> > > @@ -0,0 +1,12 @@
> > > +; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s -check-
> prefix=ALL
> > > +
> > > +; Address spaces 1-255 are software defined.
> > > +define i32* @cast(i32 *%arg) {
> > > +  %1 = addrspacecast i32* %arg to i32 addrspace(1)*
> > > +  %2 = addrspacecast i32 addrspace(1)* %1 to i32 addrspace(2)*
> > > +  %3 = addrspacecast i32 addrspace(2)* %2 to i32 addrspace(0)*
> > > +  ret i32* %3
> > > +}
> > > +
> > > +; ALL-LABEL: cast:
> > > +; ALL:           move   $2, $4
> > >
> > >
> > > _______________________________________________
> > > llvm-commits mailing list
> > > llvm-commits at lists.llvm.org
> > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list