llvm.org GIT mirror llvm / 9b5d11e
Merging r246990: ------------------------------------------------------------------------ r246990 | dsanders | 2015-09-08 10:07:03 +0100 (Tue, 08 Sep 2015) | 9 lines [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 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@247538 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Sanders 4 years ago
2 changed file(s) with 20 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
267267
268268 unsigned getRegisterByName(const char* RegName, EVT VT,
269269 SelectionDAG &DAG) const override;
270
271 /// Returns true if a cast between SrcAS and DestAS is a noop.
272 bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override {
273 // Mips doesn't have any special address spaces so we just reserve
274 // the first 256 for software use (e.g. OpenCL) and treat casts
275 // between them as noops.
276 return SrcAS < 256 && DestAS < 256;
277 }
270278
271279 protected:
272280 SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const;
0 ; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s -check-prefix=ALL
1
2 ; Address spaces 1-255 are software defined.
3 define i32* @cast(i32 *%arg) {
4 %1 = addrspacecast i32* %arg to i32 addrspace(1)*
5 %2 = addrspacecast i32 addrspace(1)* %1 to i32 addrspace(2)*
6 %3 = addrspacecast i32 addrspace(2)* %2 to i32 addrspace(0)*
7 ret i32* %3
8 }
9
10 ; ALL-LABEL: cast:
11 ; ALL: move $2, $4