about summary refs log tree commit diff
path: root/src/rt/jemalloc/test/aligned_alloc.c
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-09-10 14:28:59 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-09-16 13:44:04 -0400
commitb2eb1c01a45cbb7bfc40f24073b60de61e3fad47 (patch)
treed27827c3777a6fbefb654b784d301f383f467361 /src/rt/jemalloc/test/aligned_alloc.c
parent3c31cf25b18a1300d723e7a3b155810b23d4b472 (diff)
downloadrust-b2eb1c01a45cbb7bfc40f24073b60de61e3fad47.tar.gz
rust-b2eb1c01a45cbb7bfc40f24073b60de61e3fad47.zip
add sret + noalias to the out pointer parameter
This brings Rust in line with how `clang` handles return pointers.

Example:

    pub fn bar() -> [uint, .. 8] {
        let a = [0, .. 8];
        a
    }

Before:

    ; Function Attrs: nounwind uwtable
    define void @_ZN3bar17ha4635c6f704bfa334v0.0E([8 x i64]* nocapture, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #1 {
    "function top level":
      %a = alloca [8 x i64], align 8
      %2 = bitcast [8 x i64]* %a to i8*
      call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 64, i32 8, i1 false)
      %3 = bitcast [8 x i64]* %0 to i8*
      call void @llvm.memcpy.p0i8.p0i8.i64(i8* %3, i8* %2, i64 64, i32 8, i1 false)
      ret void
    }

After:

    ; Function Attrs: nounwind uwtable
    define void @_ZN3bar17ha4635c6f704bfa334v0.0E([8 x i64]* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #1 {
    "function top level":
      %2 = bitcast [8 x i64]* %0 to i8*
      call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 64, i32 8, i1 false)
      ret void
    }

Closes #9072
Closes #7298
Closes #9154
Diffstat (limited to 'src/rt/jemalloc/test/aligned_alloc.c')
0 files changed, 0 insertions, 0 deletions