rust-mir-optimization-explo.../cheval.ll

178 lines
11 KiB
LLVM

; ModuleID = 'cheval.434b2442-cgu.0'
source_filename = "cheval.434b2442-cgu.0"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%"core::fmt::Arguments" = type { { [0 x { [0 x i8]*, i64 }]*, i64 }, { i64*, i64 }, { [0 x { i8*, i64* }]*, i64 } }
%"unwind::libunwind::_Unwind_Exception" = type { i64, void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [6 x i64] }
%"unwind::libunwind::_Unwind_Context" = type { [0 x i8] }
%"core::fmt::Formatter" = type { { i64, i64 }, { i64, i64 }, { {}*, [3 x i64]* }, i32, i32, i8, [7 x i8] }
@vtable.0 = private unnamed_addr constant <{ i8*, [16 x i8], i8*, i8*, i8* }> <{ i8* bitcast (void (i64**)* @"_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h329c60c5ef7796efE" to i8*), [16 x i8] c"\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00", i8* bitcast (i32 (i64**)* @"_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h59ddb332eff5b283E" to i8*), i8* bitcast (i32 (i64**)* @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h4d50961104610955E" to i8*), i8* bitcast (i32 (i64**)* @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h4d50961104610955E" to i8*) }>, align 8
@alloc3 = private unnamed_addr constant <{}> zeroinitializer, align 8
@alloc5 = private unnamed_addr constant <{ [1 x i8] }> <{ [1 x i8] c"\0A" }>, align 1
@alloc4 = private unnamed_addr constant <{ i8*, [8 x i8], i8*, [8 x i8] }> <{ i8* bitcast (<{}>* @alloc3 to i8*), [8 x i8] zeroinitializer, i8* getelementptr inbounds (<{ [1 x i8] }>, <{ [1 x i8] }>* @alloc5, i32 0, i32 0, i32 0), [8 x i8] c"\01\00\00\00\00\00\00\00" }>, align 8
; std::sys_common::backtrace::__rust_begin_short_backtrace
; Function Attrs: noinline nonlazybind uwtable
define internal fastcc void @_ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h41f8b7da52e89b98E(void ()* nocapture noundef nonnull readonly %f) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
tail call void %f()
tail call void asm sideeffect "", "r,~{memory}"({}* undef) #7, !srcloc !3
ret void
}
; std::rt::lang_start
; Function Attrs: nonlazybind uwtable
define hidden i64 @_ZN3std2rt10lang_start17he131ba9074e25360E(void ()* noundef nonnull %main, i64 %argc, i8** %argv) unnamed_addr #1 {
start:
%_8 = alloca i64*, align 8
%0 = bitcast i64** %_8 to i8*
call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0)
%1 = bitcast i64** %_8 to void ()**
store void ()* %main, void ()** %1, align 8
%_5.0 = bitcast i64** %_8 to {}*
; call std::rt::lang_start_internal
%2 = call i64 @_ZN3std2rt19lang_start_internal17h09bcc9fffd987f14E({}* noundef nonnull align 1 %_5.0, [3 x i64]* noalias noundef readonly align 8 dereferenceable(24) bitcast (<{ i8*, [16 x i8], i8*, i8*, i8* }>* @vtable.0 to [3 x i64]*), i64 %argc, i8** %argv)
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0)
ret i64 %2
}
; std::rt::lang_start::{{closure}}
; Function Attrs: inlinehint nonlazybind uwtable
define internal i32 @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h4d50961104610955E"(i64** noalias nocapture noundef readonly align 8 dereferenceable(8) %_1) unnamed_addr #2 {
start:
%0 = bitcast i64** %_1 to void ()**
%_4 = load void ()*, void ()** %0, align 8, !nonnull !4, !noundef !4
; call std::sys_common::backtrace::__rust_begin_short_backtrace
tail call fastcc void @_ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h41f8b7da52e89b98E(void ()* noundef nonnull %_4)
ret i32 0
}
; core::ops::function::FnOnce::call_once{{vtable.shim}}
; Function Attrs: inlinehint nonlazybind uwtable
define internal i32 @"_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h59ddb332eff5b283E"(i64** nocapture readonly %_1) unnamed_addr #2 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
%0 = bitcast i64** %_1 to void ()**
%1 = load void ()*, void ()** %0, align 8, !nonnull !4
; call std::sys_common::backtrace::__rust_begin_short_backtrace
tail call fastcc void @_ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h41f8b7da52e89b98E(void ()* noundef nonnull %1), !noalias !5
ret i32 0
}
; core::ptr::drop_in_place<std::rt::lang_start<()>::{{closure}}>
; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind nonlazybind readnone uwtable willreturn
define internal void @"_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h329c60c5ef7796efE"(i64** nocapture readnone %_1) unnamed_addr #3 {
start:
ret void
}
; cheval::main
; Function Attrs: nonlazybind uwtable
define internal void @_ZN6cheval4main17hb27520a1fe33142bE() unnamed_addr #1 {
start:
%_13 = alloca i64, align 8
%_9 = alloca [1 x { i8*, i64* }], align 8
%_2 = alloca %"core::fmt::Arguments", align 8
%0 = bitcast %"core::fmt::Arguments"* %_2 to i8*
call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %0)
%1 = bitcast [1 x { i8*, i64* }]* %_9 to i8*
call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %1)
%2 = bitcast i64* %_13 to i8*
call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %2)
; call cheval::main_test
%3 = tail call fastcc i64 @_ZN6cheval9main_test17h920cf553da9b6fa6E()
store i64 %3, i64* %_13, align 8
%4 = bitcast [1 x { i8*, i64* }]* %_9 to i64**
store i64* %_13, i64** %4, align 8
%5 = getelementptr inbounds [1 x { i8*, i64* }], [1 x { i8*, i64* }]* %_9, i64 0, i64 0, i32 1
store i64* bitcast (i1 (i64*, %"core::fmt::Formatter"*)* @"_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i64$GT$3fmt17h7f25baa19e0cd7d8E" to i64*), i64** %5, align 8
%6 = getelementptr inbounds %"core::fmt::Arguments", %"core::fmt::Arguments"* %_2, i64 0, i32 0, i32 0
store [0 x { [0 x i8]*, i64 }]* bitcast (<{ i8*, [8 x i8], i8*, [8 x i8] }>* @alloc4 to [0 x { [0 x i8]*, i64 }]*), [0 x { [0 x i8]*, i64 }]** %6, align 8, !alias.scope !8, !noalias !11
%7 = getelementptr inbounds %"core::fmt::Arguments", %"core::fmt::Arguments"* %_2, i64 0, i32 0, i32 1
store i64 2, i64* %7, align 8, !alias.scope !8, !noalias !11
%8 = getelementptr inbounds %"core::fmt::Arguments", %"core::fmt::Arguments"* %_2, i64 0, i32 1, i32 0
store i64* null, i64** %8, align 8, !alias.scope !8, !noalias !11
%9 = getelementptr inbounds %"core::fmt::Arguments", %"core::fmt::Arguments"* %_2, i64 0, i32 2, i32 0
%10 = bitcast [0 x { i8*, i64* }]** %9 to [1 x { i8*, i64* }]**
store [1 x { i8*, i64* }]* %_9, [1 x { i8*, i64* }]** %10, align 8, !alias.scope !8, !noalias !11
%11 = getelementptr inbounds %"core::fmt::Arguments", %"core::fmt::Arguments"* %_2, i64 0, i32 2, i32 1
store i64 1, i64* %11, align 8, !alias.scope !8, !noalias !11
; call std::io::stdio::_print
call void @_ZN3std2io5stdio6_print17hdb1c1fab578c3488E(%"core::fmt::Arguments"* noalias nocapture noundef nonnull dereferenceable(48) %_2)
call void @llvm.lifetime.end.p0i8(i64 48, i8* nonnull %0)
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %2)
call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %1)
ret void
}
; cheval::main_test
; Function Attrs: mustprogress nofree noinline nosync nounwind nonlazybind uwtable willreturn
define internal fastcc i64 @_ZN6cheval9main_test17h920cf553da9b6fa6E() unnamed_addr #4 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
ret i64 5
}
; Function Attrs: nonlazybind uwtable
declare noundef i32 @rust_eh_personality(i32, i32 noundef, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*) unnamed_addr #1
; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #5
; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #5
; std::rt::lang_start_internal
; Function Attrs: nonlazybind uwtable
declare i64 @_ZN3std2rt19lang_start_internal17h09bcc9fffd987f14E({}* noundef nonnull align 1, [3 x i64]* noalias noundef readonly align 8 dereferenceable(24), i64, i8**) unnamed_addr #1
; core::fmt::num::imp::<impl core::fmt::Display for i64>::fmt
; Function Attrs: nonlazybind uwtable
declare noundef zeroext i1 @"_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i64$GT$3fmt17h7f25baa19e0cd7d8E"(i64* noalias noundef readonly align 8 dereferenceable(8), %"core::fmt::Formatter"* noalias noundef align 8 dereferenceable(64)) unnamed_addr #1
; std::io::stdio::_print
; Function Attrs: nonlazybind uwtable
declare void @_ZN3std2io5stdio6_print17hdb1c1fab578c3488E(%"core::fmt::Arguments"* noalias nocapture noundef dereferenceable(48)) unnamed_addr #1
; Function Attrs: nonlazybind
define i32 @main(i32 %0, i8** %1) unnamed_addr #6 {
top:
%_8.i = alloca i64*, align 8
%2 = sext i32 %0 to i64
%3 = bitcast i64** %_8.i to i8*
call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %3)
%4 = bitcast i64** %_8.i to void ()**
store void ()* @_ZN6cheval4main17hb27520a1fe33142bE, void ()** %4, align 8
%_5.0.i = bitcast i64** %_8.i to {}*
; call std::rt::lang_start_internal
%5 = call i64 @_ZN3std2rt19lang_start_internal17h09bcc9fffd987f14E({}* noundef nonnull align 1 %_5.0.i, [3 x i64]* noalias noundef readonly align 8 dereferenceable(24) bitcast (<{ i8*, [16 x i8], i8*, i8*, i8* }>* @vtable.0 to [3 x i64]*), i64 %2, i8** %1)
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %3)
%6 = trunc i64 %5 to i32
ret i32 %6
}
attributes #0 = { noinline nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #1 = { nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #2 = { inlinehint nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #3 = { inlinehint mustprogress nofree norecurse nosync nounwind nonlazybind readnone uwtable willreturn "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #4 = { mustprogress nofree noinline nosync nounwind nonlazybind uwtable willreturn "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #5 = { argmemonly mustprogress nofree nosync nounwind willreturn }
attributes #6 = { nonlazybind "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2}
!0 = !{i32 7, !"PIC Level", i32 2}
!1 = !{i32 7, !"PIE Level", i32 2}
!2 = !{i32 2, !"RtLibUseGOT", i32 1}
!3 = !{i32 3341193}
!4 = !{}
!5 = !{!6}
!6 = distinct !{!6, !7, !"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h4d50961104610955E: %_1"}
!7 = distinct !{!7, !"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h4d50961104610955E"}
!8 = !{!9}
!9 = distinct !{!9, !10, !"_ZN4core3fmt9Arguments6new_v117hfd5b3bd3ae423f07E: argument 0"}
!10 = distinct !{!10, !"_ZN4core3fmt9Arguments6new_v117hfd5b3bd3ae423f07E"}
!11 = !{!12}
!12 = distinct !{!12, !10, !"_ZN4core3fmt9Arguments6new_v117hfd5b3bd3ae423f07E: %args.0"}