Skip to content

Instantly share code, notes, and snippets.

@bluss
Last active October 20, 2016 15:36
Show Gist options
  • Select an option

  • Save bluss/813fecf7cebc8f858379b073e1624870 to your computer and use it in GitHub Desktop.

Select an option

Save bluss/813fecf7cebc8f858379b073e1624870 to your computer and use it in GitHub Desktop.
` rustc -Copt-level=3 --test extend.rs --emit=llvm-ir` using `rustc 1.14.0-nightly (16eeeac78 2016-10-18)` for just bench_chain_extend_ref from https://gist.github.com/bluss/baa98105d141cff3949dda1c1f2d8cce
; ModuleID = 'extend.cgu-0.rs'
source_filename = "extend.cgu-0.rs"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%str_slice = type { i8*, i64 }
%"12.test::Bencher" = type { i64, %"1.std::time::Duration", i64 }
%"1.std::time::Duration" = type { i64, i32 }
%"3.std::vec::Vec<u32>" = type { %"5.alloc::raw_vec::RawVec<u32>", i64 }
%"5.alloc::raw_vec::RawVec<u32>" = type { %"2.std::ptr::Unique<u32>", i64 }
%"2.std::ptr::Unique<u32>" = type { %"2.core::nonzero::NonZero<*const u32>", %"2.std::marker::PhantomData<u32>" }
%"2.core::nonzero::NonZero<*const u32>" = type { i32* }
%"2.std::marker::PhantomData<u32>" = type {}
%"1.std::time::Instant" = type { %"1.std::sys::time::inner::Instant" }
%"1.std::sys::time::inner::Instant" = type { %"1.std::sys::time::Timespec" }
%"1.std::sys::time::Timespec" = type { %"7.libc::unix::timespec" }
%"7.libc::unix::timespec" = type { i64, i64 }
%"12.test::TestDescAndFn" = type { %"12.test::TestDesc", %"12.test::TestFn" }
%"12.test::TestDesc" = type { %"12.test::TestName", i8, %"12.test::ShouldPanic" }
%"12.test::TestName" = type { i64, [0 x i64], [3 x i64] }
%"12.test::ShouldPanic" = type { i64, [0 x i64], [2 x i64] }
%"12.test::TestFn" = type { i64, [0 x i64], [2 x i64] }
%"8.unwind::libunwind::_Unwind_Exception" = type { i64, void (i32, %"8.unwind::libunwind::_Unwind_Exception"*)*, [6 x i64] }
%"8.unwind::libunwind::_Unwind_Context" = type {}
@str9336 = internal constant [17 x i8] c"capacity overflow"
@ref9354 = internal unnamed_addr constant [1 x i32] [i32 1], align 4
@str9355 = internal constant [22 x i8] c"bench_chain_extend_ref"
@ref9356 = internal unnamed_addr constant { { { { i64, %str_slice, [8 x i8] }, i1, [7 x i8], { i64, [16 x i8] } }, { i64, void (%"12.test::Bencher"*)*, [8 x i8] } } } { { { { i64, %str_slice, [8 x i8] }, i1, [7 x i8], { i64, [16 x i8] } }, { i64, void (%"12.test::Bencher"*)*, [8 x i8] } } { { { i64, %str_slice, [8 x i8] }, i1, [7 x i8], { i64, [16 x i8] } } { { i64, %str_slice, [8 x i8] } { i64 0, %str_slice { i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str9355, i32 0, i32 0), i64 22 }, [8 x i8] undef }, i1 false, [7 x i8] undef, { i64, [16 x i8] } { i64 0, [16 x i8] undef } }, { i64, void (%"12.test::Bencher"*)*, [8 x i8] } { i64 1, void (%"12.test::Bencher"*)* @_ZN6extend22bench_chain_extend_ref17h8fd518954ea036deE, [8 x i8] undef } } }, align 8
; Function Attrs: uwtable
define internal fastcc void @"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$7reserve17hb6aaa08583440967E"(%"3.std::vec::Vec<u32>"* nocapture dereferenceable(24), i64) unnamed_addr #0 personality i32 (i32, i32, i64, %"8.unwind::libunwind::_Unwind_Exception"*, %"8.unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
entry-block:
%2 = getelementptr inbounds %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %0, i64 0, i32 1
%3 = load i64, i64* %2, align 8
%.idx.i = getelementptr %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %0, i64 0, i32 0, i32 1
%.idx.val.i = load i64, i64* %.idx.i, align 8
%4 = sub i64 %.idx.val.i, %3
%5 = icmp ult i64 %4, %1
br i1 %5, label %bb6.i, label %"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$7reserve17hd863dcf48dd9df13E.exit"
bb6.i: ; preds = %entry-block
%6 = tail call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %3, i64 %1) #2
%7 = extractvalue { i64, i1 } %6, 1
br i1 %7, label %bb3.i7.i.i, label %"_ZN38_$LT$core..option..Option$LT$T$GT$$GT$6expect17h3407f1016547b9cdE.exit8.i.i"
bb3.i7.i.i: ; preds = %bb6.i
tail call void @_ZN4core6option13expect_failed17hafc66854f3459293E(i8* noalias nonnull readonly getelementptr inbounds ([17 x i8], [17 x i8]* @str9336, i64 0, i64 0), i64 17), !noalias !1
unreachable
"_ZN38_$LT$core..option..Option$LT$T$GT$$GT$6expect17h3407f1016547b9cdE.exit8.i.i": ; preds = %bb6.i
%8 = extractvalue { i64, i1 } %6, 0
%9 = shl i64 %.idx.val.i, 1
%10 = icmp uge i64 %8, %9
%_0.0.sroa.speculated.i.i.i = select i1 %10, i64 %8, i64 %9
%11 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %_0.0.sroa.speculated.i.i.i, i64 4) #2
%12 = extractvalue { i64, i1 } %11, 1
br i1 %12, label %bb3.i.i.i, label %"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$18amortized_new_size17h024d660246c394c9E.exit.i"
bb3.i.i.i: ; preds = %"_ZN38_$LT$core..option..Option$LT$T$GT$$GT$6expect17h3407f1016547b9cdE.exit8.i.i"
tail call void @_ZN4core6option13expect_failed17hafc66854f3459293E(i8* noalias nonnull readonly getelementptr inbounds ([17 x i8], [17 x i8]* @str9336, i64 0, i64 0), i64 17), !noalias !1
unreachable
"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$18amortized_new_size17h024d660246c394c9E.exit.i": ; preds = %"_ZN38_$LT$core..option..Option$LT$T$GT$$GT$6expect17h3407f1016547b9cdE.exit8.i.i"
%13 = extractvalue { i64, i1 } %11, 0
%14 = icmp eq i64 %.idx.val.i, 0
br i1 %14, label %bb10.i, label %bb11.i
bb10.i: ; preds = %"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$18amortized_new_size17h024d660246c394c9E.exit.i"
%15 = tail call i8* @__rust_allocate(i64 %13, i64 4) #2
br label %bb15.i
bb11.i: ; preds = %"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$18amortized_new_size17h024d660246c394c9E.exit.i"
%16 = bitcast %"3.std::vec::Vec<u32>"* %0 to i8**
%17 = load i8*, i8** %16, align 8, !alias.scope !4
%18 = shl i64 %.idx.val.i, 2
%19 = tail call i8* @__rust_reallocate(i8* %17, i64 %18, i64 %13, i64 4) #2
br label %bb15.i
bb15.i: ; preds = %bb11.i, %bb10.i
%ptr.0.i = phi i8* [ %15, %bb10.i ], [ %19, %bb11.i ]
%20 = icmp eq i8* %ptr.0.i, null
br i1 %20, label %bb17.i, label %bb18.i
bb17.i: ; preds = %bb15.i
tail call void @_ZN5alloc3oom3oom17h97560b93ca17f851E()
unreachable
bb18.i: ; preds = %bb15.i
%21 = bitcast %"3.std::vec::Vec<u32>"* %0 to i8**
store i8* %ptr.0.i, i8** %21, align 8
store i64 %_0.0.sroa.speculated.i.i.i, i64* %.idx.i, align 8
br label %"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$7reserve17hd863dcf48dd9df13E.exit"
"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$7reserve17hd863dcf48dd9df13E.exit": ; preds = %entry-block, %bb18.i
ret void
}
; Function Attrs: uwtable
define internal void @_ZN6extend22bench_chain_extend_ref17h8fd518954ea036deE(%"12.test::Bencher"* nocapture dereferenceable(32)) unnamed_addr #0 personality i32 (i32, i32, i64, %"8.unwind::libunwind::_Unwind_Exception"*, %"8.unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
entry-block:
%v.i.i = alloca %"3.std::vec::Vec<u32>", align 8
%dummy.i.i = alloca %"3.std::vec::Vec<u32>", align 8
%start1.i = alloca %"1.std::time::Instant", align 8
%_21.i = alloca %"3.std::vec::Vec<u32>", align 8
%tmp_ret2.i = alloca %"1.std::time::Duration", align 8
%v.i = alloca %"3.std::vec::Vec<u32>", align 8
%1 = bitcast %"3.std::vec::Vec<u32>"* %v.i to i8*
call void @llvm.lifetime.start(i64 24, i8* %1), !noalias !7
%2 = tail call i8* @__rust_allocate(i64 65536, i64 4) #2, !noalias !10
%3 = icmp eq i8* %2, null
br i1 %3, label %bb10.i.i.i, label %bb3.i
bb10.i.i.i: ; preds = %entry-block
call void @_ZN5alloc3oom3oom17h97560b93ca17f851E()
unreachable
bb3.i: ; preds = %entry-block
%4 = ptrtoint i8* %2 to i64
%5 = bitcast %"3.std::vec::Vec<u32>"* %v.i to i64*
store i64 %4, i64* %5, align 8, !alias.scope !13, !noalias !7
%6 = getelementptr inbounds %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %v.i, i64 0, i32 0, i32 1
%7 = getelementptr inbounds %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %v.i, i64 0, i32 1
%8 = bitcast i64* %6 to <2 x i64>*
store <2 x i64> <i64 16384, i64 0>, <2 x i64>* %8, align 8, !alias.scope !13, !noalias !7
invoke fastcc void @"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$7reserve17hb6aaa08583440967E"(%"3.std::vec::Vec<u32>"* nonnull dereferenceable(24) %v.i, i64 16384)
to label %bb3 unwind label %bb6.i, !noalias !7
bb6.i: ; preds = %bb3.i
%9 = landingpad { i8*, i32 }
cleanup
%10 = load i64, i64* %6, align 8, !noalias !7
%not..i.i.i.i.i = icmp eq i64 %10, 0
br i1 %not..i.i.i.i.i, label %bb1, label %bb6.i.i.i.i.i
bb6.i.i.i.i.i: ; preds = %bb6.i
%11 = shl i64 %10, 2
%12 = bitcast %"3.std::vec::Vec<u32>"* %v.i to i8**
%13 = load i8*, i8** %12, align 8, !noalias !7
tail call void @__rust_deallocate(i8* %13, i64 %11, i64 4) #2, !noalias !7
br label %bb1
bb1: ; preds = %bb6.i, %bb6.i.i.i.i.i, %bb6.i.i.i.i27, %bb6
%eh.lpad-body43 = phi { i8*, i32 } [ %eh.lpad-body44, %bb6.i.i.i.i27 ], [ %eh.lpad-body44, %bb6 ], [ %9, %bb6.i.i.i.i.i ], [ %9, %bb6.i ]
resume { i8*, i32 } %eh.lpad-body43
bb3: ; preds = %bb3.i
%14 = getelementptr inbounds %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %v.i, i64 0, i32 0, i32 0, i32 0, i32 0
%15 = load i32*, i32** %14, align 8
%.idx.val.i.i = load i64, i64* %7, align 8, !noalias !7
%16 = getelementptr inbounds i32, i32* %15, i64 %.idx.val.i.i
%17 = bitcast i32* %16 to i8*
%18 = add i64 %.idx.val.i.i, 16383
tail call void @llvm.memset.p0i8.i64(i8* %17, i8 0, i64 65532, i32 4, i1 false), !noalias !7
%scevgep.i.i = getelementptr i32, i32* %15, i64 %18
store i32 0, i32* %scevgep.i.i, align 4, !noalias !7
%19 = add i64 %.idx.val.i.i, 16384
store i64 %19, i64* %7, align 8, !noalias !7
%data.sroa.6.0.copyload = load i64, i64* %6, align 8
call void @llvm.lifetime.end(i64 24, i8* nonnull %1), !noalias !7
%20 = bitcast %"1.std::time::Duration"* %tmp_ret2.i to i8*
call void @llvm.lifetime.start(i64 16, i8* %20)
%21 = bitcast %"1.std::time::Instant"* %start1.i to i8*
call void @llvm.lifetime.start(i64 16, i8* %21)
invoke void @_ZN3std4time7Instant3now17h5851ec34f9ff4cdfE(%"1.std::time::Instant"* noalias nocapture nonnull sret dereferenceable(16) %start1.i)
to label %.noexc18 unwind label %cleanup.body.thread50
.noexc18: ; preds = %bb3
%22 = getelementptr inbounds %"12.test::Bencher", %"12.test::Bencher"* %0, i64 0, i32 0
%23 = load i64, i64* %22, align 8
%24 = icmp eq i64 %23, 0
br i1 %24, label %bb8.i, label %bb7.lr.ph.i
bb7.lr.ph.i: ; preds = %.noexc18
%_21.0..sroa_cast.i = bitcast %"3.std::vec::Vec<u32>"* %_21.i to i8*
%25 = bitcast %"3.std::vec::Vec<u32>"* %v.i.i to i8*
%26 = bitcast %"3.std::vec::Vec<u32>"* %v.i.i to i64*
%27 = getelementptr inbounds %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %v.i.i, i64 0, i32 0, i32 1
%28 = getelementptr inbounds %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %v.i.i, i64 0, i32 1
%29 = getelementptr inbounds %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %v.i.i, i64 0, i32 0, i32 0, i32 0, i32 0
%30 = bitcast %"3.std::vec::Vec<u32>"* %dummy.i.i to i8*
%_20.sroa.0.0..sroa_cast.i = bitcast %"3.std::vec::Vec<u32>"* %dummy.i.i to i8**
%_20.sroa.2.0..sroa_idx18.i = getelementptr inbounds %"3.std::vec::Vec<u32>", %"3.std::vec::Vec<u32>"* %dummy.i.i, i64 0, i32 0, i32 1
%31 = add i64 %.idx.val.i.i, 16385
%32 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %31, i64 4) #2
%33 = extractvalue { i64, i1 } %32, 1
%34 = extractvalue { i64, i1 } %32, 0
%35 = icmp eq i64 %34, 0
%36 = getelementptr inbounds i32, i32* %15, i64 %19
%37 = ptrtoint i32* %15 to i64
%38 = ptrtoint i32* %36 to i64
br i1 %33, label %bb7.i.us, label %bb7.i.preheader
bb7.i.preheader: ; preds = %bb7.lr.ph.i
br label %bb7.i
bb7.i.us: ; preds = %bb7.lr.ph.i
call void @llvm.lifetime.start(i64 24, i8* %_21.0..sroa_cast.i)
call void @llvm.lifetime.start(i64 24, i8* %25), !noalias !14
invoke void @_ZN4core6option13expect_failed17hafc66854f3459293E(i8* noalias nonnull readonly getelementptr inbounds ([17 x i8], [17 x i8]* @str9336, i64 0, i64 0), i64 17)
to label %.noexc22 unwind label %cleanup.body.thread50
bb7.i: ; preds = %bb7.i.preheader, %_ZN4drop17h4dfb1291b66f97dbE.exit.i
%iter.sroa.0.030.i = phi i64 [ %39, %_ZN4drop17h4dfb1291b66f97dbE.exit.i ], [ 0, %bb7.i.preheader ]
%39 = add nuw i64 %iter.sroa.0.030.i, 1
call void @llvm.lifetime.start(i64 24, i8* %_21.0..sroa_cast.i)
call void @llvm.lifetime.start(i64 24, i8* %25), !noalias !14
br i1 %35, label %bb6.i.i, label %bb6.i.i.i.i
.noexc22: ; preds = %bb7.i.us
unreachable
bb6.i.i.i.i: ; preds = %bb7.i
%40 = call i8* @__rust_allocate(i64 %34, i64 4) #2, !noalias !17
%41 = icmp eq i8* %40, null
br i1 %41, label %bb10.i.i.i.i, label %bb6.i.i
bb10.i.i.i.i: ; preds = %bb6.i.i.i.i
invoke void @_ZN5alloc3oom3oom17h97560b93ca17f851E()
to label %.noexc23 unwind label %cleanup.body.thread50
.noexc23: ; preds = %bb10.i.i.i.i
unreachable
bb6.i.i: ; preds = %bb6.i.i.i.i, %bb7.i
%ptr.0.i.i.i.i = phi i8* [ inttoptr (i64 1 to i8*), %bb7.i ], [ %40, %bb6.i.i.i.i ]
%42 = ptrtoint i8* %ptr.0.i.i.i.i to i64
store i64 %42, i64* %26, align 8, !alias.scope !22, !noalias !14
store i64 %31, i64* %27, align 8, !alias.scope !22, !noalias !14
%43 = bitcast i8* %ptr.0.i.i.i.i to i32*
br label %bb1.i.i.i.i.i.i.i
bb1.i.i.i.i.i.i.i: ; preds = %bb18.i.i.i.i.i.i.i, %bb6.i.i
%44 = phi i32* [ %43, %bb6.i.i ], [ %68, %bb18.i.i.i.i.i.i.i ]
%.idx.val.i.i.i.i.i.i.i = phi i64 [ 0, %bb6.i.i ], [ %70, %bb18.i.i.i.i.i.i.i ]
%iterator.sroa.0.0.i.i.i.i.i.i.i = phi i64 [ %37, %bb6.i.i ], [ %iterator.sroa.0.1.i.i.i.i.i.i.i, %bb18.i.i.i.i.i.i.i ]
%iterator.sroa.11.0.i.i.i.i.i.i.i = phi i64 [ ptrtoint ([1 x i32]* @ref9354 to i64), %bb6.i.i ], [ %iterator.sroa.11.1.i.i.i.i.i.i.i, %bb18.i.i.i.i.i.i.i ]
%iterator.sroa.19.0.i.i.i.i.i.i.i = phi i8 [ 0, %bb6.i.i ], [ %iterator.sroa.19.1.i.i.i.i.i.i.i, %bb18.i.i.i.i.i.i.i ]
store i64 %.idx.val.i.i.i.i.i.i.i, i64* %28, align 8, !noalias !14
%trunc.i.i.i.i.i.i.i.i.i = trunc i8 %iterator.sroa.19.0.i.i.i.i.i.i.i to i2
switch i2 %trunc.i.i.i.i.i.i.i.i.i, label %unreachable.i.i.i.i.i.i.i.i.i [
i2 0, label %bb1.i.i.i.i.i.i.i.i.i
i2 1, label %bb2.i.i.i.i.i.i.i.i.i
i2 -2, label %bb3.i.i.i.i.i.i.i.i.i
]
bb1.i.i.i.i.i.i.i.i.i: ; preds = %bb1.i.i.i.i.i.i.i
%45 = inttoptr i64 %iterator.sroa.0.0.i.i.i.i.i.i.i to i32*
%46 = icmp eq i32* %45, %36
br i1 %46, label %bb8.i.i.i.i.i.i.i.i.i, label %"_ZN91_$LT$core..slice..Iter$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17hc8d72ec269db79d5E.exit.i.i.i.i.i.i.i.i.i"
"_ZN91_$LT$core..slice..Iter$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17hc8d72ec269db79d5E.exit.i.i.i.i.i.i.i.i.i": ; preds = %bb1.i.i.i.i.i.i.i.i.i
%47 = getelementptr inbounds i32, i32* %45, i64 1
%48 = ptrtoint i32* %47 to i64
br label %bb9.i.i.i.i.i.i.i
bb2.i.i.i.i.i.i.i.i.i: ; preds = %bb1.i.i.i.i.i.i.i
%49 = inttoptr i64 %iterator.sroa.0.0.i.i.i.i.i.i.i to i32*
%50 = icmp eq i32* %49, %36
br i1 %50, label %"_ZN6extend22bench_chain_extend_ref28_$u7b$$u7b$closure$u7d$$u7d$17h8dedb7ad4440e847E.exit.i", label %bb10.i17.i.i.i.i.i.i.i.i.i
bb10.i17.i.i.i.i.i.i.i.i.i: ; preds = %bb2.i.i.i.i.i.i.i.i.i
%51 = getelementptr inbounds i32, i32* %49, i64 1
%52 = ptrtoint i32* %51 to i64
br label %bb9.i.i.i.i.i.i.i
bb3.i.i.i.i.i.i.i.i.i: ; preds = %bb1.i.i.i.i.i.i.i
%53 = inttoptr i64 %iterator.sroa.11.0.i.i.i.i.i.i.i to i32*
%54 = icmp eq i32* %53, getelementptr inbounds ([1 x i32], [1 x i32]* @ref9354, i64 1, i64 0)
br i1 %54, label %"_ZN6extend22bench_chain_extend_ref28_$u7b$$u7b$closure$u7d$$u7d$17h8dedb7ad4440e847E.exit.i", label %bb10.i14.i.i.i.i.i.i.i.i.i
bb10.i14.i.i.i.i.i.i.i.i.i: ; preds = %bb3.i.i.i.i.i.i.i.i.i
%55 = getelementptr inbounds i32, i32* %53, i64 1
%56 = ptrtoint i32* %55 to i64
br label %bb9.i.i.i.i.i.i.i
bb8.i.i.i.i.i.i.i.i.i: ; preds = %bb1.i.i.i.i.i.i.i.i.i
%57 = inttoptr i64 %iterator.sroa.11.0.i.i.i.i.i.i.i to i32*
%58 = icmp eq i32* %57, getelementptr inbounds ([1 x i32], [1 x i32]* @ref9354, i64 1, i64 0)
br i1 %58, label %"_ZN6extend22bench_chain_extend_ref28_$u7b$$u7b$closure$u7d$$u7d$17h8dedb7ad4440e847E.exit.i", label %bb10.i11.i.i.i.i.i.i.i.i.i
bb10.i11.i.i.i.i.i.i.i.i.i: ; preds = %bb8.i.i.i.i.i.i.i.i.i
%59 = getelementptr inbounds i32, i32* %57, i64 1
%60 = ptrtoint i32* %59 to i64
br label %bb9.i.i.i.i.i.i.i
unreachable.i.i.i.i.i.i.i.i.i: ; preds = %bb1.i.i.i.i.i.i.i
unreachable
bb9.i.i.i.i.i.i.i: ; preds = %bb10.i11.i.i.i.i.i.i.i.i.i, %bb10.i14.i.i.i.i.i.i.i.i.i, %bb10.i17.i.i.i.i.i.i.i.i.i, %"_ZN91_$LT$core..slice..Iter$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17hc8d72ec269db79d5E.exit.i.i.i.i.i.i.i.i.i"
%iterator.sroa.0.1.i.i.i.i.i.i.i = phi i64 [ %iterator.sroa.0.0.i.i.i.i.i.i.i, %bb10.i14.i.i.i.i.i.i.i.i.i ], [ %52, %bb10.i17.i.i.i.i.i.i.i.i.i ], [ %iterator.sroa.0.0.i.i.i.i.i.i.i, %bb10.i11.i.i.i.i.i.i.i.i.i ], [ %48, %"_ZN91_$LT$core..slice..Iter$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17hc8d72ec269db79d5E.exit.i.i.i.i.i.i.i.i.i" ]
%iterator.sroa.11.1.i.i.i.i.i.i.i = phi i64 [ %56, %bb10.i14.i.i.i.i.i.i.i.i.i ], [ %iterator.sroa.11.0.i.i.i.i.i.i.i, %bb10.i17.i.i.i.i.i.i.i.i.i ], [ %60, %bb10.i11.i.i.i.i.i.i.i.i.i ], [ %iterator.sroa.11.0.i.i.i.i.i.i.i, %"_ZN91_$LT$core..slice..Iter$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17hc8d72ec269db79d5E.exit.i.i.i.i.i.i.i.i.i" ]
%iterator.sroa.19.1.i.i.i.i.i.i.i = phi i8 [ %iterator.sroa.19.0.i.i.i.i.i.i.i, %bb10.i14.i.i.i.i.i.i.i.i.i ], [ %iterator.sroa.19.0.i.i.i.i.i.i.i, %bb10.i17.i.i.i.i.i.i.i.i.i ], [ 2, %bb10.i11.i.i.i.i.i.i.i.i.i ], [ %iterator.sroa.19.0.i.i.i.i.i.i.i, %"_ZN91_$LT$core..slice..Iter$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17hc8d72ec269db79d5E.exit.i.i.i.i.i.i.i.i.i" ]
%_0.0.i.ph.in.i.i.i.i.i.i.i.i = phi i32* [ %53, %bb10.i14.i.i.i.i.i.i.i.i.i ], [ %49, %bb10.i17.i.i.i.i.i.i.i.i.i ], [ %57, %bb10.i11.i.i.i.i.i.i.i.i.i ], [ %45, %"_ZN91_$LT$core..slice..Iter$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17hc8d72ec269db79d5E.exit.i.i.i.i.i.i.i.i.i" ]
%.val.i.i.i.i.i.i.i.i.i.i = load i32, i32* %_0.0.i.ph.in.i.i.i.i.i.i.i.i, align 4, !noalias !23
%.idx.val.i.i.i.i.i.i.i.i = load i64, i64* %27, align 8, !alias.scope !34, !noalias !23
%61 = icmp eq i64 %.idx.val.i.i.i.i.i.i.i, %.idx.val.i.i.i.i.i.i.i.i
br i1 %61, label %bb13.i.i.i.i.i.i.i, label %bb18.i.i.i.i.i.i.i
bb13.i.i.i.i.i.i.i: ; preds = %bb9.i.i.i.i.i.i.i
%62 = sub i64 %38, %iterator.sroa.0.1.i.i.i.i.i.i.i
%63 = lshr i64 %62, 2
%64 = sub i64 ptrtoint (i32* getelementptr inbounds ([1 x i32], [1 x i32]* @ref9354, i64 1, i64 0) to i64), %iterator.sroa.11.1.i.i.i.i.i.i.i
%65 = lshr i64 %64, 2
%66 = add nuw nsw i64 %63, 1
%67 = add nuw i64 %66, %65
invoke fastcc void @"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$7reserve17hb6aaa08583440967E"(%"3.std::vec::Vec<u32>"* nonnull dereferenceable(24) %v.i.i, i64 %67)
to label %bb13.i.i.i.i.i.bb18.i.i.i.i.i_crit_edge.i.i unwind label %bb8.i.i.us-lcssa, !noalias !14
bb13.i.i.i.i.i.bb18.i.i.i.i.i_crit_edge.i.i: ; preds = %bb13.i.i.i.i.i.i.i
%.pre.i.i = load i32*, i32** %29, align 8, !alias.scope !37, !noalias !23
br label %bb18.i.i.i.i.i.i.i
bb18.i.i.i.i.i.i.i: ; preds = %bb13.i.i.i.i.i.bb18.i.i.i.i.i_crit_edge.i.i, %bb9.i.i.i.i.i.i.i
%68 = phi i32* [ %.pre.i.i, %bb13.i.i.i.i.i.bb18.i.i.i.i.i_crit_edge.i.i ], [ %44, %bb9.i.i.i.i.i.i.i ]
%69 = getelementptr inbounds i32, i32* %68, i64 %.idx.val.i.i.i.i.i.i.i
store i32 %.val.i.i.i.i.i.i.i.i.i.i, i32* %69, align 4, !noalias !23
%70 = add i64 %.idx.val.i.i.i.i.i.i.i, 1
br label %bb1.i.i.i.i.i.i.i
bb8.i.i.us-lcssa: ; preds = %bb13.i.i.i.i.i.i.i
%lpad.us-lcssa = landingpad { i8*, i32 }
cleanup
%71 = load i64, i64* %27, align 8, !noalias !14
%not..i.i.i.i.i.i = icmp eq i64 %71, 0
br i1 %not..i.i.i.i.i.i, label %bb6, label %bb6.i.i.i.i.i.i
bb6.i.i.i.i.i.i: ; preds = %bb8.i.i.us-lcssa
%72 = shl i64 %71, 2
%73 = bitcast %"3.std::vec::Vec<u32>"* %v.i.i to i8**
%74 = load i8*, i8** %73, align 8, !noalias !14
call void @__rust_deallocate(i8* %74, i64 %72, i64 4) #2, !noalias !14
br label %bb6
"_ZN6extend22bench_chain_extend_ref28_$u7b$$u7b$closure$u7d$$u7d$17h8dedb7ad4440e847E.exit.i": ; preds = %bb8.i.i.i.i.i.i.i.i.i, %bb3.i.i.i.i.i.i.i.i.i, %bb2.i.i.i.i.i.i.i.i.i
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %_21.0..sroa_cast.i, i8* %25, i64 24, i32 8, i1 false)
call void @llvm.lifetime.end(i64 24, i8* %25), !noalias !14
call void @llvm.lifetime.start(i64 24, i8* %30) #2, !noalias !40
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %30, i8* %_21.0..sroa_cast.i, i64 24, i32 8, i1 false) #2, !noalias !44
call void asm "", "r,~{dirflag},~{fpsr},~{flags}"(%"3.std::vec::Vec<u32>"* nonnull %dummy.i.i) #2, !noalias !40, !srcloc !45
%_20.sroa.0.0.copyload.i = load i8*, i8** %_20.sroa.0.0..sroa_cast.i, align 8
%_20.sroa.2.0.copyload.i = load i64, i64* %_20.sroa.2.0..sroa_idx18.i, align 8
call void @llvm.lifetime.end(i64 24, i8* %30) #2, !noalias !40
%not..i.i.i.i.i16 = icmp eq i64 %_20.sroa.2.0.copyload.i, 0
br i1 %not..i.i.i.i.i16, label %_ZN4drop17h4dfb1291b66f97dbE.exit.i, label %bb6.i.i.i.i.i17
bb6.i.i.i.i.i17: ; preds = %"_ZN6extend22bench_chain_extend_ref28_$u7b$$u7b$closure$u7d$$u7d$17h8dedb7ad4440e847E.exit.i"
%75 = shl i64 %_20.sroa.2.0.copyload.i, 2
call void @__rust_deallocate(i8* %_20.sroa.0.0.copyload.i, i64 %75, i64 4) #2
br label %_ZN4drop17h4dfb1291b66f97dbE.exit.i
_ZN4drop17h4dfb1291b66f97dbE.exit.i: ; preds = %bb6.i.i.i.i.i17, %"_ZN6extend22bench_chain_extend_ref28_$u7b$$u7b$closure$u7d$$u7d$17h8dedb7ad4440e847E.exit.i"
call void @llvm.lifetime.end(i64 24, i8* nonnull %_21.0..sroa_cast.i)
%76 = icmp ult i64 %39, %23
br i1 %76, label %bb7.i, label %bb8.i.loopexit
bb8.i.loopexit: ; preds = %_ZN4drop17h4dfb1291b66f97dbE.exit.i
br label %bb8.i
bb8.i: ; preds = %bb8.i.loopexit, %.noexc18
invoke void @_ZN3std4time7Instant7elapsed17h5bac07511bd73b7cE(%"1.std::time::Duration"* noalias nocapture nonnull sret dereferenceable(16) %tmp_ret2.i, %"1.std::time::Instant"* noalias nonnull readonly dereferenceable(16) %start1.i)
to label %bb4 unwind label %cleanup.body.thread50
bb4: ; preds = %bb8.i
%77 = getelementptr inbounds %"1.std::time::Duration", %"1.std::time::Duration"* %tmp_ret2.i, i64 0, i32 0
%78 = getelementptr inbounds %"1.std::time::Duration", %"1.std::time::Duration"* %tmp_ret2.i, i64 0, i32 1
%79 = load i64, i64* %77, align 8
%80 = load i32, i32* %78, align 8
%81 = getelementptr inbounds %"12.test::Bencher", %"12.test::Bencher"* %0, i64 0, i32 1, i32 0
store i64 %79, i64* %81, align 8
%82 = getelementptr inbounds %"12.test::Bencher", %"12.test::Bencher"* %0, i64 0, i32 1, i32 1
store i32 %80, i32* %82, align 4
call void @llvm.lifetime.end(i64 16, i8* %21)
call void @llvm.lifetime.end(i64 16, i8* %20)
%not..i.i.i.i = icmp eq i64 %data.sroa.6.0.copyload, 0
br i1 %not..i.i.i.i, label %bb5, label %bb6.i.i.i.i25
bb6.i.i.i.i25: ; preds = %bb4
%83 = shl i64 %data.sroa.6.0.copyload, 2
%84 = bitcast i32* %15 to i8*
call void @__rust_deallocate(i8* %84, i64 %83, i64 4) #2
br label %bb5
bb5: ; preds = %bb6.i.i.i.i25, %bb4
ret void
bb6: ; preds = %bb8.i.i.us-lcssa, %bb6.i.i.i.i.i.i, %cleanup.body.thread50
%eh.lpad-body44 = phi { i8*, i32 } [ %lpad.thr_comm, %cleanup.body.thread50 ], [ %lpad.us-lcssa, %bb6.i.i.i.i.i.i ], [ %lpad.us-lcssa, %bb8.i.i.us-lcssa ]
%not..i.i.i.i26 = icmp eq i64 %data.sroa.6.0.copyload, 0
br i1 %not..i.i.i.i26, label %bb1, label %bb6.i.i.i.i27
bb6.i.i.i.i27: ; preds = %bb6
%85 = shl i64 %data.sroa.6.0.copyload, 2
%86 = bitcast i32* %15 to i8*
call void @__rust_deallocate(i8* %86, i64 %85, i64 4) #2
br label %bb1
cleanup.body.thread50: ; preds = %bb3, %bb7.i.us, %bb10.i.i.i.i, %bb8.i
%lpad.thr_comm = landingpad { i8*, i32 }
cleanup
br label %bb6
}
; Function Attrs: uwtable
define internal void @_ZN6extend6__test4main17h9f643704610c5bc6E() unnamed_addr #0 {
entry-block:
tail call void @_ZN4test16test_main_static17h9d2a63238910810dE(%"12.test::TestDescAndFn"* noalias nonnull readonly bitcast ({ { { { i64, %str_slice, [8 x i8] }, i1, [7 x i8], { i64, [16 x i8] } }, { i64, void (%"12.test::Bencher"*)*, [8 x i8] } } }* @ref9356 to %"12.test::TestDescAndFn"*), i64 1)
ret void
}
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start(i64, i8* nocapture) #1
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) #1
; Function Attrs: nounwind
declare i32 @rust_eh_personality(i32, i32, i64, %"8.unwind::libunwind::_Unwind_Exception"*, %"8.unwind::libunwind::_Unwind_Context"*) unnamed_addr #2
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end(i64, i8* nocapture) #1
; Function Attrs: cold noinline noreturn
declare void @_ZN4core6option13expect_failed17hafc66854f3459293E(i8* noalias nonnull readonly, i64) unnamed_addr #3
; Function Attrs: cold noinline noreturn
declare void @_ZN5alloc3oom3oom17h97560b93ca17f851E() unnamed_addr #3
; Function Attrs: nounwind readnone
declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) #4
; Function Attrs: nounwind readnone
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4
declare void @_ZN3std4time7Instant3now17h5851ec34f9ff4cdfE(%"1.std::time::Instant"* noalias nocapture sret dereferenceable(16)) unnamed_addr
declare void @_ZN3std4time7Instant7elapsed17h5bac07511bd73b7cE(%"1.std::time::Duration"* noalias nocapture sret dereferenceable(16), %"1.std::time::Instant"* noalias readonly dereferenceable(16)) unnamed_addr
; Function Attrs: nounwind
declare void @__rust_deallocate(i8*, i64, i64) unnamed_addr #2
; Function Attrs: nounwind
declare i8* @__rust_reallocate(i8*, i64, i64, i64) unnamed_addr #2
; Function Attrs: nounwind
declare noalias i8* @__rust_allocate(i64, i64) unnamed_addr #2
declare void @_ZN4test16test_main_static17h9d2a63238910810dE(%"12.test::TestDescAndFn"* noalias nonnull readonly, i64) unnamed_addr
define i64 @main(i64, i8**) unnamed_addr {
top:
%2 = tail call i64 @_ZN3std2rt10lang_start17h14cbded5fe3cd915E(i8* bitcast (void ()* @_ZN6extend6__test4main17h9f643704610c5bc6E to i8*), i64 %0, i8** %1)
ret i64 %2
}
declare i64 @_ZN3std2rt10lang_start17h14cbded5fe3cd915E(i8*, i64, i8**) unnamed_addr
; Function Attrs: argmemonly nounwind
declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i32, i1) #1
attributes #0 = { uwtable }
attributes #1 = { argmemonly nounwind }
attributes #2 = { nounwind }
attributes #3 = { cold noinline noreturn }
attributes #4 = { nounwind readnone }
!llvm.module.flags = !{!0}
!0 = !{i32 1, !"PIE Level", i32 2}
!1 = !{!2}
!2 = distinct !{!2, !3, !"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$18amortized_new_size17h024d660246c394c9E: argument 0"}
!3 = distinct !{!3, !"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$18amortized_new_size17h024d660246c394c9E"}
!4 = !{!5}
!5 = distinct !{!5, !6, !"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$3ptr17h57c29b46ba02fe2aE: argument 0"}
!6 = distinct !{!6, !"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$3ptr17h57c29b46ba02fe2aE"}
!7 = !{!8}
!8 = distinct !{!8, !9, !"_ZN11collections3vec9from_elem17h77215bc09a1f2fffE: argument 0"}
!9 = distinct !{!9, !"_ZN11collections3vec9from_elem17h77215bc09a1f2fffE"}
!10 = !{!11, !8}
!11 = distinct !{!11, !12, !"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$13with_capacity17h6fa3d1648d53f006E: argument 0"}
!12 = distinct !{!12, !"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$13with_capacity17h6fa3d1648d53f006E"}
!13 = !{!11}
!14 = !{!15}
!15 = distinct !{!15, !16, !"_ZN6extend22bench_chain_extend_ref28_$u7b$$u7b$closure$u7d$$u7d$17h8dedb7ad4440e847E: argument 0"}
!16 = distinct !{!16, !"_ZN6extend22bench_chain_extend_ref28_$u7b$$u7b$closure$u7d$$u7d$17h8dedb7ad4440e847E"}
!17 = !{!18, !20, !15}
!18 = distinct !{!18, !19, !"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$13with_capacity17h6bc7103eb318a6b3E: argument 0"}
!19 = distinct !{!19, !"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$13with_capacity17h6bc7103eb318a6b3E"}
!20 = distinct !{!20, !21, !"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$13with_capacity17h6fa3d1648d53f006E: argument 0"}
!21 = distinct !{!21, !"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$13with_capacity17h6fa3d1648d53f006E"}
!22 = !{!20}
!23 = !{!24, !26, !28, !30, !32, !15}
!24 = distinct !{!24, !25, !"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$16extend_desugared17hd38bc64b60ade6f8E: argument 0"}
!25 = distinct !{!25, !"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$16extend_desugared17hd38bc64b60ade6f8E"}
!26 = distinct !{!26, !27, !"_ZN141_$LT$collections..vec..Vec$LT$$LT$I$u20$as$u20$core..iter..traits..IntoIterator$GT$..Item$GT$$u20$as$u20$collections..SpecExtend$LT$I$GT$$GT$11spec_extend17h867f3b6989094b58E: argument 0"}
!27 = distinct !{!27, !"_ZN141_$LT$collections..vec..Vec$LT$$LT$I$u20$as$u20$core..iter..traits..IntoIterator$GT$..Item$GT$$u20$as$u20$collections..SpecExtend$LT$I$GT$$GT$11spec_extend17h867f3b6989094b58E"}
!28 = distinct !{!28, !29, !"_ZN86_$LT$collections..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..Extend$LT$T$GT$$GT$6extend17he7ffad562b22c4a7E: argument 0"}
!29 = distinct !{!29, !"_ZN86_$LT$collections..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..Extend$LT$T$GT$$GT$6extend17he7ffad562b22c4a7E"}
!30 = distinct !{!30, !31, !"_ZN62_$LT$I$u20$as$u20$collections..vec..SpecExtendVec$LT$T$GT$$GT$10extend_vec17h8ffa46fedae5fd3aE: argument 0"}
!31 = distinct !{!31, !"_ZN62_$LT$I$u20$as$u20$collections..vec..SpecExtendVec$LT$T$GT$$GT$10extend_vec17h8ffa46fedae5fd3aE"}
!32 = distinct !{!32, !33, !"_ZN101_$LT$collections..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..Extend$LT$$RF$$u27$a$u20$T$GT$$GT$6extend17h599bb2c991e2e0beE: argument 0"}
!33 = distinct !{!33, !"_ZN101_$LT$collections..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..Extend$LT$$RF$$u27$a$u20$T$GT$$GT$6extend17h599bb2c991e2e0beE"}
!34 = !{!35}
!35 = distinct !{!35, !36, !"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$8capacity17h56ab2b3a93a4cae6E: argument 0"}
!36 = distinct !{!36, !"_ZN39_$LT$collections..vec..Vec$LT$T$GT$$GT$8capacity17h56ab2b3a93a4cae6E"}
!37 = !{!38}
!38 = distinct !{!38, !39, !"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$3ptr17h57c29b46ba02fe2aE: argument 0"}
!39 = distinct !{!39, !"_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$3ptr17h57c29b46ba02fe2aE"}
!40 = !{!41, !43}
!41 = distinct !{!41, !42, !"_ZN4test9black_box17h53805d02e7700cc0E: argument 0"}
!42 = distinct !{!42, !"_ZN4test9black_box17h53805d02e7700cc0E"}
!43 = distinct !{!43, !42, !"_ZN4test9black_box17h53805d02e7700cc0E: argument 1"}
!44 = !{!41}
!45 = !{i32 191}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment