-
-
Save huonw/b7571a7b5998bfc7b9ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[crate_type="lib"]; | |
pub struct Foo { | |
x: uint, | |
y: uint | |
} | |
#[inline(never)] | |
#[no_mangle] | |
pub fn foo(f: Foo) -> Foo { | |
f | |
} | |
#[no_mangle] | |
pub fn bar(f: Foo) -> Foo { | |
foo(f) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Function Attrs: noinline nounwind uwtable | |
define void @foo(%struct.Foo* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Foo* nocapture readonly) unnamed_addr #1 { | |
"function top level": | |
%3 = bitcast %struct.Foo* %2 to i8* | |
%4 = bitcast %struct.Foo* %0 to i8* | |
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %4, i8* %3, i64 16, i32 8, i1 false) | |
ret void | |
} | |
; Function Attrs: nounwind uwtable | |
define void @bar(%struct.Foo* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Foo* nocapture readonly) unnamed_addr #2 { | |
"function top level": | |
%__self = alloca %struct.Foo, align 8 | |
%3 = bitcast %struct.Foo* %2 to i8* | |
%4 = bitcast %struct.Foo* %__self to i8* | |
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %4, i8* %3, i64 16, i32 8, i1 false) | |
call void @foo(%struct.Foo* sret %0, { i64, %tydesc*, i8*, i8*, i8 }* undef, %struct.Foo* %__self) | |
ret void | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment