Skip to content

Instantly share code, notes, and snippets.

@yuyichao

yuyichao/f.ll Secret

Created March 31, 2016 18:07
Show Gist options
  • Save yuyichao/8d6e7e5d436b0e77ed3bb4133b966332 to your computer and use it in GitHub Desktop.
Save yuyichao/8d6e7e5d436b0e77ed3bb4133b966332 to your computer and use it in GitHub Desktop.
; ModuleID = 'julia_f_23781'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%jl_value_t = type { %jl_value_t* }
define void @julia_f_23781(%jl_value_t*) #0 {
top:
call void @llvm.dbg.value(metadata %jl_value_t* null, i64 0, metadata !2, metadata !31), !dbg !32
%1 = alloca [5 x %jl_value_t*], align 8
%.sub = getelementptr inbounds [5 x %jl_value_t*], [5 x %jl_value_t*]* %1, i64 0, i64 0
%2 = getelementptr [5 x %jl_value_t*], [5 x %jl_value_t*]* %1, i64 0, i64 2
store %jl_value_t* null, %jl_value_t** %2, align 8
%3 = getelementptr [5 x %jl_value_t*], [5 x %jl_value_t*]* %1, i64 0, i64 3
store %jl_value_t* null, %jl_value_t** %3, align 8
%4 = getelementptr [5 x %jl_value_t*], [5 x %jl_value_t*]* %1, i64 0, i64 4
store %jl_value_t* null, %jl_value_t** %4, align 8
%5 = bitcast [5 x %jl_value_t*]* %1 to i64*
store i64 6, i64* %5, align 8
%6 = getelementptr [5 x %jl_value_t*], [5 x %jl_value_t*]* %1, i64 0, i64 1
%7 = load i64, i64* bitcast (%jl_value_t*** @jl_tls_states to i64*), align 8
%8 = bitcast %jl_value_t** %6 to i64*
store i64 %7, i64* %8, align 8
store %jl_value_t** %.sub, %jl_value_t*** @jl_tls_states, align 8
call void @llvm.dbg.value(metadata %jl_value_t* %0, i64 0, metadata !2, metadata !31), !dbg !32
store %jl_value_t* %0, %jl_value_t** %2, align 8, !dbg !33
%9 = load i64, i64* inttoptr (i64 139662206951504 to i64*), align 16, !dbg !37
call void @llvm.dbg.value(metadata i64 0, i64 0, metadata !18, metadata !31), !dbg !32
%10 = add i64 %9, 1, !dbg !37
%11 = icmp eq i64 %10, 0, !dbg !37
br i1 %11, label %L9, label %if.lr.ph, !dbg !37
if.lr.ph: ; preds = %top
%12 = getelementptr inbounds %jl_value_t, %jl_value_t* %0, i64 1, !dbg !33
%13 = bitcast %jl_value_t* %12 to i64*, !dbg !33
%14 = load i64, i64* %13, align 8, !dbg !33, !tbaa !40
%15 = icmp sgt i64 %14, 0, !dbg !44
%16 = select i1 %15, i64 %14, i64 0, !dbg !44
%17 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 %16, i64 1), !dbg !47
%18 = extractvalue { i64, i1 } %17, 1, !dbg !47
br i1 %18, label %fail.split, label %if.lr.ph.if.lr.ph.split_crit_edge, !dbg !47
if.lr.ph.if.lr.ph.split_crit_edge: ; preds = %if.lr.ph
%19 = extractvalue { i64, i1 } %17, 0, !dbg !47
%20 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %19, i64 1), !dbg !47
%21 = extractvalue { i64, i1 } %20, 1, !dbg !47
br i1 %21, label %if.lr.ph.split.split.us, label %if.lr.ph.split.if.lr.ph.split.split_crit_edge, !dbg !47
if.lr.ph.split.if.lr.ph.split.split_crit_edge: ; preds = %if.lr.ph.if.lr.ph.split_crit_edge
%22 = extractvalue { i64, i1 } %20, 0, !dbg !47
%23 = icmp slt i64 %22, 1, !dbg !48
br i1 %23, label %if.lr.ph.split.split.split.us, label %if.lr.ph.split.split.if.lr.ph.split.split.split_crit_edge, !dbg !48
if.lr.ph.split.split.us: ; preds = %if.lr.ph.if.lr.ph.split_crit_edge
br i1 undef, label %fail10, label %fail10, !dbg !48
if.lr.ph.split.split.if.lr.ph.split.split.split_crit_edge: ; preds = %if.lr.ph.split.if.lr.ph.split.split_crit_edge
%24 = bitcast %jl_value_t* %0 to float**, !dbg !49
%25 = icmp sgt i64 %22, 0, !dbg !50
br label %L1.preheader, !dbg !37
if.lr.ph.split.split.split.us: ; preds = %if.lr.ph.split.if.lr.ph.split.split_crit_edge
%backedge.overflow = icmp eq i64 %9, -1
br i1 %backedge.overflow, label %scalar.ph, label %overflow.checked, !dbg !37
overflow.checked: ; preds = %if.lr.ph.split.split.split.us
%26 = add i64 %9, 1, !dbg !37
%end.idx = add i64 %9, 1, !dbg !37
%n.vec = and i64 %26, -128, !dbg !37
%cmp.zero = icmp eq i64 %n.vec, 0, !dbg !37
br i1 %cmp.zero, label %middle.block, label %vector.ph, !dbg !37
vector.ph: ; preds = %overflow.checked
br label %vector.body, !dbg !37
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ], !dbg !37
%index.next = add i64 %index, 128, !dbg !37
%27 = icmp eq i64 %index.next, %n.vec, !dbg !37
br i1 %27, label %middle.block, label %vector.body, !dbg !37, !llvm.loop !51
middle.block: ; preds = %vector.body, %overflow.checked
%resume.val = phi i64 [ 0, %overflow.checked ], [ %n.vec, %vector.body ]
%trunc.resume.val = phi i64 [ 0, %overflow.checked ], [ %n.vec, %vector.body ]
%cmp.n = icmp eq i64 %end.idx, %resume.val
br i1 %cmp.n, label %L9.loopexit, label %scalar.ph, !dbg !37
scalar.ph: ; preds = %middle.block, %if.lr.ph.split.split.split.us
%bc.trunc.resume.val = phi i64 [ %trunc.resume.val, %middle.block ], [ 0, %if.lr.ph.split.split.split.us ]
br label %L.backedge.us13, !dbg !37
L.backedge.us13: ; preds = %scalar.ph, %L.backedge.us13
%"#s1.02.us.4" = phi i64 [ %bc.trunc.resume.val, %scalar.ph ], [ %28, %L.backedge.us13 ]
call void @llvm.dbg.value(metadata i64 %28, i64 0, metadata !18, metadata !31), !dbg !32
call void @llvm.dbg.value(metadata i64 %22, i64 0, metadata !20, metadata !31), !dbg !32
%28 = add i64 %"#s1.02.us.4", 1, !dbg !37
%29 = icmp eq i64 %28, %10, !dbg !37
br i1 %29, label %L9.loopexit, label %L.backedge.us13, !dbg !37, !llvm.loop !54
L9.loopexit: ; preds = %middle.block, %L.backedge.us13
br label %L9, !dbg !56
L9.loopexit14: ; preds = %L.backedge
br label %L9, !dbg !56
L9: ; preds = %L9.loopexit14, %L9.loopexit, %top
%30 = load i64, i64* %8, align 8, !dbg !56
store i64 %30, i64* bitcast (%jl_value_t*** @jl_tls_states to i64*), align 8, !dbg !56
ret void, !dbg !56
fail.split: ; preds = %if.lr.ph
%31 = load %jl_value_t*, %jl_value_t** @jl_overflow_exception, align 8, !dbg !47
call void @jl_throw(%jl_value_t* %31), !dbg !47
unreachable, !dbg !47
fail10: ; preds = %if.lr.ph.split.split.us, %if.lr.ph.split.split.us
%32 = load %jl_value_t*, %jl_value_t** @jl_overflow_exception, align 8, !dbg !47
call void @jl_throw(%jl_value_t* %32), !dbg !47
unreachable, !dbg !47
L.backedge.loopexit: ; preds = %if13
br label %L.backedge, !dbg !37
L.backedge: ; preds = %L.backedge.loopexit, %L1.preheader
%33 = add i64 %"#s1.02", 1, !dbg !37
%34 = icmp eq i64 %33, %10, !dbg !37
br i1 %34, label %L9.loopexit14, label %L1.preheader, !dbg !37
L1.preheader: ; preds = %L.backedge, %if.lr.ph.split.split.if.lr.ph.split.split.split_crit_edge
%"#s1.02" = phi i64 [ 0, %if.lr.ph.split.split.if.lr.ph.split.split.split_crit_edge ], [ %33, %L.backedge ]
call void @llvm.dbg.value(metadata i64 %33, i64 0, metadata !18, metadata !31), !dbg !32
call void @llvm.dbg.value(metadata i64 %22, i64 0, metadata !20, metadata !31), !dbg !32
br i1 %25, label %if13.preheader, label %L.backedge, !dbg !50
if13.preheader: ; preds = %L1.preheader
br label %if13, !dbg !49
if13: ; preds = %if13.preheader, %if13
%"##i#7433.01" = phi i64 [ %41, %if13 ], [ 0, %if13.preheader ]
store %jl_value_t* %0, %jl_value_t** %3, align 8, !dbg !49, !llvm.mem.parallel_loop_access !57
%35 = load float*, float** %24, align 8, !dbg !49, !tbaa !59, !llvm.mem.parallel_loop_access !57
%36 = getelementptr float, float* %35, i64 %"##i#7433.01", !dbg !49
%37 = load float, float* %36, align 4, !dbg !49, !tbaa !60, !llvm.mem.parallel_loop_access !57
%38 = fadd float %37, 1.000000e+00, !dbg !49
store %jl_value_t* %0, %jl_value_t** %4, align 8, !dbg !49, !llvm.mem.parallel_loop_access !57
%39 = load float*, float** %24, align 8, !dbg !49, !tbaa !59, !llvm.mem.parallel_loop_access !57
%40 = getelementptr float, float* %39, i64 %"##i#7433.01", !dbg !49
store float %38, float* %40, align 4, !dbg !49, !tbaa !60, !llvm.mem.parallel_loop_access !57
%41 = add nuw nsw i64 %"##i#7433.01", 1, !dbg !61, !simd_loop !13
call void @llvm.dbg.value(metadata i64 %41, i64 0, metadata !22, metadata !31), !dbg !32
%exitcond = icmp eq i64 %41, %22, !dbg !50
br i1 %exitcond, label %L.backedge.loopexit, label %if13, !dbg !50, !llvm.loop !58
}
attributes #0 = { "no-frame-pointer-elim"="true" }
!llvm.module.flags = !{!0, !1}
!0 = !{i32 2, !"Dwarf Version", i32 2}
!1 = !{i32 1, !"Debug Info Version", i32 3}
!2 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", arg: 2, scope: !3, file: !4, line: 2, type: !7)
!3 = !DISubprogram(name: "f", linkageName: "julia_f_23781", scope: null, file: !4, type: !5, isLocal: false, isDefinition: true, isOptimized: true, function: void (%jl_value_t*)* @julia_f_23781, variables: !10)
!4 = !DIFile(filename: "none", directory: ".")
!5 = !DISubroutineType(types: !6)
!6 = !{!7}
!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "jl_value_t", file: !9, line: 71, align: 64, elements: !6)
!9 = !DIFile(filename: "julia.h", directory: "")
!10 = !{!11, !2, !14, !18, !19, !20, !21, !22, !23, !24, !25, !28, !30}
!11 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "#self#", arg: 1, scope: !3, file: !4, line: 2, type: !12)
!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "#f", align: 8, elements: !13, runtimeLang: DW_LANG_Julia)
!13 = !{}
!14 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "##r#7430", scope: !3, file: !4, line: 2, type: !15)
!15 = !DICompositeType(tag: DW_TAG_structure_type, name: "UnitRange", size: 128, align: 64, elements: !16, runtimeLang: DW_LANG_Julia)
!16 = !{!17, !17}
!17 = !DIBasicType(name: "Int64", size: 64, align: 64, encoding: DW_ATE_unsigned)
!18 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "#s1", scope: !3, file: !4, line: 2, type: !17)
!19 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "##i#7431", scope: !3, file: !4, line: 2, type: !17)
!20 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "##n#7432", scope: !3, file: !4, line: 2, type: !17)
!21 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", scope: !3, file: !4, line: 2, type: !17)
!22 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "##i#7433", scope: !3, file: !4, line: 2, type: !17)
!23 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "#2#i", scope: !3, file: !4, line: 2, type: !17)
!24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "##ret#7452", scope: !3, file: !4, line: 2, type: !17)
!25 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "######I#732#5149#7453", scope: !3, file: !4, line: 2, type: !26)
!26 = !DICompositeType(tag: DW_TAG_structure_type, name: "Tuple", size: 64, align: 64, elements: !27, runtimeLang: DW_LANG_Julia)
!27 = !{!17}
!28 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "########_var0#731#733#5150#7454", scope: !3, file: !4, line: 2, type: !29)
!29 = !DIBasicType(name: "Bool", size: 1, align: 8, encoding: DW_ATE_unsigned)
!30 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "######_var1#734#5151#7455", scope: !3, file: !4, line: 2, type: !29)
!31 = !DIExpression()
!32 = !DILocation(line: 2, scope: !3)
!33 = !DILocation(line: 414, column: 1, scope: !34, inlinedAt: !36)
!34 = !DILexicalBlockFile(scope: !3, file: !35, discriminator: 0)
!35 = !DIFile(filename: "abstractarray.jl", directory: ".")
!36 = !DILocation(line: 2, column: 1, scope: !3)
!37 = !DILocation(line: 66, column: 1, scope: !38, inlinedAt: !36)
!38 = !DILexicalBlockFile(scope: !3, file: !39, discriminator: 0)
!39 = !DIFile(filename: "simdloop.jl", directory: ".")
!40 = !{!"jtbaa_arraylen", !41}
!41 = !{!"jtbaa_array", !42}
!42 = !{!"jtbaa_value", !43}
!43 = !{!"jtbaa"}
!44 = !DILocation(line: 83, column: 1, scope: !45, inlinedAt: !36)
!45 = !DILexicalBlockFile(scope: !3, file: !46, discriminator: 0)
!46 = !DIFile(filename: "range.jl", directory: ".")
!47 = !DILocation(line: 67, column: 1, scope: !38, inlinedAt: !36)
!48 = !DILocation(line: 68, column: 1, scope: !38, inlinedAt: !36)
!49 = !DILocation(line: 3, column: 1, scope: !3)
!50 = !DILocation(line: 71, column: 1, scope: !38, inlinedAt: !36)
!51 = distinct !{!51, !52, !53}
!52 = !{!"llvm.loop.vectorize.width", i32 1}
!53 = !{!"llvm.loop.interleave.count", i32 1}
!54 = distinct !{!54, !55, !52, !53}
!55 = !{!"llvm.loop.unroll.runtime.disable"}
!56 = !DILocation(line: 5, column: 1, scope: !3)
!57 = !{!58}
!58 = distinct !{!58}
!59 = !{!"jtbaa_arrayptr", !41}
!60 = !{!"jtbaa_user", !43}
!61 = !DILocation(line: 74, column: 1, scope: !38, inlinedAt: !49)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment