Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created May 24, 2018 18:56
Show Gist options
  • Save alexcrichton/af9175061671962d20c3c9d84f582d46 to your computer and use it in GitHub Desktop.
Save alexcrichton/af9175061671962d20c3c9d84f582d46 to your computer and use it in GitHub Desktop.
; ModuleID = 'foo0-8787f43e282added376259c1adb08b80.rs'
source_filename = "foo0-8787f43e282added376259c1adb08b80.rs"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%"alloc::vec::Vec<&i32>" = type { [0 x i64], { i64*, i64 }, [0 x i64], i64, [0 x i64] }
%"unwind::libunwind::_Unwind_Exception" = type { [0 x i64], i64, [0 x i64], void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [0 x i64], [6 x i64], [0 x i64] }
%"unwind::libunwind::_Unwind_Context" = type { [0 x i8] }
@byte_str.5 = private unnamed_addr constant <{ [12 x i8] }> <{ [12 x i8] c"\01\00\00\00\02\00\00\00\03\00\00\00" }>, align 4
; core::ptr::drop_in_place
; Function Attrs: nounwind uwtable
define internal fastcc void @_ZN4core3ptr13drop_in_place17h6fb8eeb8205906f5E(%"alloc::vec::Vec<&i32>"* nocapture readonly %arg0) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
bb4:
%0 = getelementptr inbounds %"alloc::vec::Vec<&i32>", %"alloc::vec::Vec<&i32>"* %arg0, i64 0, i32 1, i32 1
%1 = load i64, i64* %0, align 8, !alias.scope !0, !noalias !7
%2 = icmp eq i64 %1, 0
br i1 %2, label %_ZN4core3ptr13drop_in_place17h0d3cd11b05bbb87fE.exit, label %bb4.i.i.i
bb4.i.i.i: ; preds = %bb4
%3 = shl i64 %1, 3
%4 = bitcast %"alloc::vec::Vec<&i32>"* %arg0 to i8**
%5 = load i8*, i8** %4, align 8, !alias.scope !9, !nonnull !10
tail call void @__rust_dealloc(i8* nonnull %5, i64 %3, i64 8) #6, !noalias !9
br label %_ZN4core3ptr13drop_in_place17h0d3cd11b05bbb87fE.exit
_ZN4core3ptr13drop_in_place17h0d3cd11b05bbb87fE.exit: ; preds = %bb4, %bb4.i.i.i
ret void
}
; foo::foo
; Function Attrs: uwtable
define i64 @_ZN3foo3foo17hd5840bacd542b40dE() unnamed_addr #1 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
%vector.i.i.i = alloca %"alloc::vec::Vec<&i32>", align 8
%0 = bitcast %"alloc::vec::Vec<&i32>"* %vector.i.i.i to i8*
call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %0), !noalias !11
%1 = bitcast %"alloc::vec::Vec<&i32>"* %vector.i.i.i to i64**
store i64* inttoptr (i64 8 to i64*), i64** %1, align 8, !alias.scope !18, !noalias !11
%2 = getelementptr inbounds %"alloc::vec::Vec<&i32>", %"alloc::vec::Vec<&i32>"* %vector.i.i.i, i64 0, i32 1, i32 1
%3 = bitcast i64* %2 to i8*
call void @llvm.memset.p0i8.i64(i8* nonnull %3, i8 0, i64 16, i32 8, i1 false) #6, !alias.scope !18, !noalias !11
%4 = tail call i8* @__rust_alloc(i64 24, i64 8) #6, !noalias !21
%5 = icmp eq i8* %4, null
br i1 %5, label %bb4.i.i.i.i.i, label %bb39.i.i.i.i.i.i
bb1.i.i.i: ; preds = %bb4.i.i.i.i.i
%6 = landingpad { i8*, i32 }
cleanup
; call core::ptr::drop_in_place
call fastcc void @_ZN4core3ptr13drop_in_place17h6fb8eeb8205906f5E(%"alloc::vec::Vec<&i32>"* nonnull %vector.i.i.i) #7, !noalias !11
resume { i8*, i32 } %6
bb39.i.i.i.i.i.i: ; preds = %start
%7 = bitcast %"alloc::vec::Vec<&i32>"* %vector.i.i.i to i8**
store i8* %4, i8** %7, align 8, !alias.scope !28, !noalias !11
store i64 3, i64* %2, align 8, !alias.scope !28, !noalias !11
call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %0), !noalias !11
tail call void @__rust_dealloc(i8* nonnull %4, i64 24, i64 8) #6, !noalias !29
ret i64 select (i1 icmp eq (<{ [12 x i8] }>* bitcast (i8* getelementptr inbounds (<{ [12 x i8] }>, <{ [12 x i8] }>* @byte_str.5, i64 1, i32 0, i64 0) to <{ [12 x i8] }>*), <{ [12 x i8] }>* @byte_str.5), i64 0, i64 3)
bb4.i.i.i.i.i: ; preds = %start
; invoke alloc::alloc::oom
invoke void @_ZN5alloc5alloc3oom17h7f17a92c5ec59339E()
to label %.noexc10.i.i.i unwind label %bb1.i.i.i, !noalias !11
.noexc10.i.i.i: ; preds = %bb4.i.i.i.i.i
unreachable
}
declare i32 @rust_eh_personality(i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*) unnamed_addr #2
; alloc::alloc::oom
; Function Attrs: noreturn
declare void @_ZN5alloc5alloc3oom17h7f17a92c5ec59339E() unnamed_addr #3
; Function Attrs: nounwind
declare noalias i8* @__rust_alloc(i64, i64) unnamed_addr #4
; Function Attrs: nounwind
declare void @__rust_dealloc(i8*, i64, i64) unnamed_addr #4
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #5
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #5
; Function Attrs: argmemonly nounwind
declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i32, i1) #5
attributes #0 = { nounwind uwtable "probe-stack"="__rust_probestack" }
attributes #1 = { uwtable "probe-stack"="__rust_probestack" }
attributes #2 = { "probe-stack"="__rust_probestack" }
attributes #3 = { noreturn "probe-stack"="__rust_probestack" }
attributes #4 = { nounwind "probe-stack"="__rust_probestack" }
attributes #5 = { argmemonly nounwind }
attributes #6 = { nounwind }
attributes #7 = { noinline }
!0 = !{!1, !3, !5}
!1 = distinct !{!1, !2, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$14current_layout17h26b59317240ba6dcE: %self"}
!2 = distinct !{!2, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$14current_layout17h26b59317240ba6dcE"}
!3 = distinct !{!3, !4, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$14dealloc_buffer17h09d4beee4c7b780dE: %self"}
!4 = distinct !{!4, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$14dealloc_buffer17h09d4beee4c7b780dE"}
!5 = distinct !{!5, !6, !"_ZN82_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h089951ff69d404bfE: %self"}
!6 = distinct !{!6, !"_ZN82_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h089951ff69d404bfE"}
!7 = !{!8}
!8 = distinct !{!8, !2, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$14current_layout17h26b59317240ba6dcE: argument 0"}
!9 = !{!3, !5}
!10 = !{}
!11 = !{!12, !14, !16}
!12 = distinct !{!12, !13, !"_ZN85_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..SpecExtend$LT$T$C$$u20$I$GT$$GT$9from_iter17h6de669119355cd7fE: argument 0"}
!13 = distinct !{!13, !"_ZN85_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..SpecExtend$LT$T$C$$u20$I$GT$$GT$9from_iter17h6de669119355cd7fE"}
!14 = distinct !{!14, !15, !"_ZN86_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..FromIterator$LT$T$GT$$GT$9from_iter17h5f96f7f6d7da3407E: argument 0"}
!15 = distinct !{!15, !"_ZN86_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..FromIterator$LT$T$GT$$GT$9from_iter17h5f96f7f6d7da3407E"}
!16 = distinct !{!16, !17, !"_ZN4core4iter8iterator8Iterator7collect17h3118cda580b46e1bE: argument 0"}
!17 = distinct !{!17, !"_ZN4core4iter8iterator8Iterator7collect17h3118cda580b46e1bE"}
!18 = !{!19}
!19 = distinct !{!19, !20, !"_ZN33_$LT$alloc..vec..Vec$LT$T$GT$$GT$3new17h3b7f0a6fee7d508cE: argument 0"}
!20 = distinct !{!20, !"_ZN33_$LT$alloc..vec..Vec$LT$T$GT$$GT$3new17h3b7f0a6fee7d508cE"}
!21 = !{!22, !24, !26, !12, !14, !16}
!22 = distinct !{!22, !23, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$11try_reserve17h085b337856f84959E: %self"}
!23 = distinct !{!23, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$11try_reserve17h085b337856f84959E"}
!24 = distinct !{!24, !25, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$7reserve17h4a409c3627e31056E: %self"}
!25 = distinct !{!25, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$7reserve17h4a409c3627e31056E"}
!26 = distinct !{!26, !27, !"_ZN33_$LT$alloc..vec..Vec$LT$T$GT$$GT$7reserve17h013ea6c6628cd774E: %self"}
!27 = distinct !{!27, !"_ZN33_$LT$alloc..vec..Vec$LT$T$GT$$GT$7reserve17h013ea6c6628cd774E"}
!28 = !{!22, !24, !26}
!29 = !{!30, !32}
!30 = distinct !{!30, !31, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$14dealloc_buffer17h09d4beee4c7b780dE: %self"}
!31 = distinct !{!31, !"_ZN49_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$14dealloc_buffer17h09d4beee4c7b780dE"}
!32 = distinct !{!32, !33, !"_ZN82_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h089951ff69d404bfE: %self"}
!33 = distinct !{!33, !"_ZN82_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h089951ff69d404bfE"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment