Skip to content

Instantly share code, notes, and snippets.

@vtjnash
Last active April 28, 2019 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vtjnash/8a073c01e0a6e6b29789bb3f7080e72b to your computer and use it in GitHub Desktop.
Save vtjnash/8a073c01e0a6e6b29789bb3f7080e72b to your computer and use it in GitHub Desktop.
bad TBAA/LICM
; *** IR Dump After Loop Invariant Code Motion *** (loop: %L140)
; ModuleID = 'reverse1'
source_filename = "reverse1"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64--linux-gnu"
%jl_value_t = type opaque
@llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (%jl_value_t addrspace(10)* (i8*, i32, i32)* @jl_gc_pool_alloc to i8*), i8* bitcast (%jl_value_t addrspace(10)* (i8*, i64)* @jl_gc_big_alloc to i8*)], section "llvm.metadata"
define void @julia_reverse1_15886(%jl_value_t addrspace(10)* nonnull align 8 dereferenceable(24), i64) !dbg !5 {
top:
%2 = alloca [2 x { { i64, i64 } }], align 8
%3 = alloca { { { i64, i64 } } }, align 8
%4 = alloca { { { i64, i64 } } }, align 8
%5 = alloca i64, align 8
%6 = alloca i64, align 8
%7 = call %jl_value_t*** @julia.ptls_states()
%8 = addrspacecast %jl_value_t addrspace(10)* %0 to %jl_value_t addrspace(11)*, !dbg !7
%9 = bitcast %jl_value_t addrspace(11)* %8 to %jl_value_t addrspace(10)* addrspace(11)*, !dbg !7
%10 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %9, align 8, !dbg !7, !tbaa !16, !nonnull !4, !dereferenceable !21, !align !22
%11 = addrspacecast %jl_value_t addrspace(10)* %10 to %jl_value_t addrspace(11)*, !dbg !23
%12 = bitcast %jl_value_t addrspace(11)* %11 to %jl_value_t addrspace(10)* addrspace(11)*, !dbg !23
%13 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %12, i64 3, !dbg !23
%14 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %13 to i64 addrspace(11)*, !dbg !23
%15 = load i64, i64 addrspace(11)* %14, align 8, !dbg !23, !tbaa !29, !invariant.load !4
%16 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %12, i64 4, !dbg !23
%17 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %16 to i64 addrspace(11)*, !dbg !23
%18 = load i64, i64 addrspace(11)* %17, align 8, !dbg !23, !tbaa !29, !invariant.load !4
%19 = icmp sgt i64 %18, 0, !dbg !31
%20 = select i1 %19, i64 %18, i64 0, !dbg !31
%21 = bitcast %jl_value_t addrspace(11)* %8 to i8 addrspace(11)*, !dbg !41
%22 = getelementptr inbounds i8, i8 addrspace(11)* %21, i64 8, !dbg !41
%23 = bitcast i8 addrspace(11)* %22 to i64 addrspace(11)*, !dbg !42
%24 = load i64, i64 addrspace(11)* %23, align 8, !dbg !46, !tbaa !16
%25 = add i64 %24, 1, !dbg !46
%26 = icmp sgt i64 %15, 0, !dbg !31
%27 = select i1 %26, i64 %15, i64 0, !dbg !31
%28 = add i64 %24, %27, !dbg !53
%29 = getelementptr i8, i8 addrspace(11)* %21, i64 16, !dbg !61
%30 = bitcast i8 addrspace(11)* %29 to i64 addrspace(11)*, !dbg !61
%31 = load i64, i64 addrspace(11)* %30, align 8, !dbg !64, !tbaa !16
%32 = add i64 %31, 1, !dbg !64
%33 = icmp sgt i64 %25, %28, !dbg !68
%34 = select i1 %33, i64 %24, i64 %28, !dbg !73
%35 = add i64 %31, %20, !dbg !76
%36 = icmp sgt i64 %32, %35, !dbg !80
%37 = select i1 %36, i64 %31, i64 %35, !dbg !82
%.sroa.0.sroa.050.0..sroa.0.0..sroa_cast45.sroa_idx = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 0, i32 0, i32 0, !dbg !44
store i64 %25, i64* %.sroa.0.sroa.050.0..sroa.0.0..sroa_cast45.sroa_idx, align 8, !dbg !44, !tbaa !84
%.sroa.0.sroa.251.0..sroa.0.0..sroa_cast45.sroa_idx52 = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 0, i32 0, i32 1, !dbg !44
store i64 %34, i64* %.sroa.0.sroa.251.0..sroa.0.0..sroa_cast45.sroa_idx52, align 8, !dbg !44, !tbaa !84
%.sroa.0.sroa.041.0..sroa.0.0..sroa_cast36.sroa_idx = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 1, i32 0, i32 0, !dbg !44
store i64 %32, i64* %.sroa.0.sroa.041.0..sroa.0.0..sroa_cast36.sroa_idx, align 8, !dbg !44, !tbaa !84
%.sroa.0.sroa.242.0..sroa.0.0..sroa_cast36.sroa_idx43 = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 1, i32 0, i32 1, !dbg !44
store i64 %37, i64* %.sroa.0.sroa.242.0..sroa.0.0..sroa_cast36.sroa_idx43, align 8, !dbg !44, !tbaa !84
%38 = add i64 %1, -1, !dbg !86
%39 = icmp ult i64 %38, 2, !dbg !86
br i1 %39, label %pass, label %fail, !dbg !86
L138: ; preds = %pass
%.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 0
%.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 1
%.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 0
%.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 1
%40 = icmp ne i64 %1, 1
%41 = select i1 %40, i64* %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx, i64* %5
%42 = icmp ne i64 %1, 2
%43 = select i1 %42, i64* %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx, i64* %6
%44 = bitcast %jl_value_t*** %7 to i8*
%45 = bitcast i64* %41 to i8*
%46 = bitcast %jl_value_t*** %7 to i8*
%47 = bitcast i64* %43 to i8*
br label %L140, !dbg !88
L140: ; preds = %L138, %post_box_union14
%value_phi10 = phi i64 [ %77, %L138 ], [ %90, %post_box_union14 ]
store i64 %value_phi10, i64* %5, align 8, !dbg !89
store i64 %value_phi10, i64* %6, align 8, !dbg !94
br i1 %40, label %box_union, label %box_union12, !dbg !89
L166.loopexit: ; preds = %post_box_union14
store i64 %63, i64* %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx, align 8, !dbg !95, !tbaa !84
store i64 %68, i64* %.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34, align 8, !dbg !95, !tbaa !84
store i64 %70, i64* %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx, align 8, !dbg !95, !tbaa !84
store i64 %73, i64* %.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25, align 8, !dbg !95, !tbaa !84
br label %L166, !dbg !101
L166: ; preds = %L166.loopexit, %pass
ret void, !dbg !101
fail: ; preds = %top
%48 = bitcast [2 x { { i64, i64 } }]* %2 to i8*, !dbg !86
%49 = addrspacecast i8* %48 to i8 addrspace(11)*, !dbg !86
call void @jl_bounds_error_unboxed_int(i8 addrspace(11)* %49, %jl_value_t* inttoptr (i64 140246297345024 to %jl_value_t*), i64 %1), !dbg !86
unreachable, !dbg !86
pass: ; preds = %top
%50 = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 %38, !dbg !86
%51 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %9, align 8, !dbg !102, !tbaa !16, !nonnull !4, !dereferenceable !21, !align !22
%52 = addrspacecast %jl_value_t addrspace(10)* %51 to %jl_value_t addrspace(11)*, !dbg !106
%53 = bitcast %jl_value_t addrspace(11)* %52 to %jl_value_t addrspace(10)* addrspace(11)*, !dbg !106
%54 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %53, i64 3, !dbg !106
%55 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %54 to i64 addrspace(11)*, !dbg !106
%56 = load i64, i64 addrspace(11)* %55, align 8, !dbg !106, !tbaa !29, !invariant.load !4
%57 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %53, i64 4, !dbg !106
%58 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %57 to i64 addrspace(11)*, !dbg !106
%59 = load i64, i64 addrspace(11)* %58, align 8, !dbg !106, !tbaa !29, !invariant.load !4
%60 = icmp sgt i64 %59, 0, !dbg !108
%61 = select i1 %60, i64 %59, i64 0, !dbg !108
%62 = load i64, i64 addrspace(11)* %23, align 8, !dbg !112, !tbaa !16
%63 = add i64 %62, 1, !dbg !112
%64 = icmp sgt i64 %56, 0, !dbg !108
%65 = select i1 %64, i64 %56, i64 0, !dbg !108
%66 = add i64 %62, %65, !dbg !116
%67 = icmp sgt i64 %63, %66, !dbg !120
%68 = select i1 %67, i64 %62, i64 %66, !dbg !122
%69 = load i64, i64 addrspace(11)* %30, align 8, !dbg !124, !tbaa !16
%70 = add i64 %69, 1, !dbg !124
%71 = add i64 %69, %61, !dbg !128
%72 = icmp sgt i64 %70, %71, !dbg !132
%73 = select i1 %72, i64 %69, i64 %71, !dbg !134
%74 = getelementptr inbounds { { i64, i64 } }, { { i64, i64 } }* %50, i64 0, i32 0, i32 0, !dbg !136
%75 = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 %38, i32 0, i32 1, !dbg !145
%76 = load i64, i64* %75, align 8, !dbg !148, !tbaa !84
%77 = load i64, i64* %74, align 8, !dbg !148, !tbaa !84
%78 = icmp slt i64 %76, %77, !dbg !148
br i1 %78, label %L166, label %L138, !dbg !141
post_box_union: ; preds = %box_union12, %box_union
%79 = phi %jl_value_t addrspace(10)* [ %80, %box_union ], [ %83, %box_union12 ], !dbg !89
br i1 %42, label %box_union15, label %box_union16, !dbg !89
box_union: ; preds = %L140
%80 = call noalias nonnull %jl_value_t addrspace(10)* @julia.gc_alloc_obj(i8* %44, i64 16, %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140246298315744 to %jl_value_t*) to %jl_value_t addrspace(10)*)) #4, !dbg !89
%81 = bitcast %jl_value_t addrspace(10)* %80 to i8 addrspace(10)*, !dbg !89
call void @llvm.memcpy.p10i8.p0i8.i64(i8 addrspace(10)* align 8 %81, i8* align 8 %45, i64 16, i1 false), !dbg !89, !tbaa !152
br label %post_box_union, !dbg !89
box_union12: ; preds = %L140
%82 = load i64, i64* %41, align 8, !dbg !89, !tbaa !152
%83 = call %jl_value_t addrspace(10)* @jl_box_int64(i64 signext %82), !dbg !89
br label %post_box_union, !dbg !89
post_box_union14: ; preds = %box_union16, %box_union15
%84 = phi %jl_value_t addrspace(10)* [ %91, %box_union15 ], [ %94, %box_union16 ], !dbg !89
%85 = call cc37 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32)* @jl_f_tuple to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* null to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* %79, %jl_value_t addrspace(10)* %84), !dbg !89
%86 = call cc36 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)**, i32)* @jl_apply_generic to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140246409410544 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* nonnull %85), !dbg !101
%87 = call cc37 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32)* @jsys1_println_10491 to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140246406349216 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140246296350896 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* nonnull %86), !dbg !101
%88 = load i64, i64* %75, align 8, !dbg !153, !tbaa !84
%89 = icmp eq i64 %value_phi10, %88, !dbg !153
%90 = add i64 %value_phi10, 1, !dbg !157
br i1 %89, label %L166.loopexit, label %L140, !dbg !101
box_union15: ; preds = %post_box_union
%91 = call noalias nonnull %jl_value_t addrspace(10)* @julia.gc_alloc_obj(i8* %46, i64 16, %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140246298315744 to %jl_value_t*) to %jl_value_t addrspace(10)*)) #4, !dbg !89
%92 = bitcast %jl_value_t addrspace(10)* %91 to i8 addrspace(10)*, !dbg !89
call void @llvm.memcpy.p10i8.p0i8.i64(i8 addrspace(10)* align 8 %92, i8* align 8 %47, i64 16, i1 false), !dbg !89, !tbaa !152
br label %post_box_union14, !dbg !89
box_union16: ; preds = %post_box_union
%93 = load i64, i64* %43, align 8, !dbg !89, !tbaa !152
%94 = call %jl_value_t addrspace(10)* @jl_box_int64(i64 signext %93), !dbg !89
br label %post_box_union14, !dbg !89
}
define nonnull %jl_value_t addrspace(10)* @jfptr_reverse1_15887(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) #0 {
top:
%3 = call %jl_value_t*** @julia.ptls_states()
%4 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %1, i64 1
%5 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %4, !nonnull !4, !dereferenceable !159, !align !160
%6 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %1, i64 2
%7 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %6, !nonnull !4, !dereferenceable !160, !align !160
%8 = bitcast %jl_value_t addrspace(10)* %7 to i64 addrspace(10)*
%9 = addrspacecast i64 addrspace(10)* %8 to i64 addrspace(11)*
%10 = load i64, i64 addrspace(11)* %9, align 8
call void @julia_reverse1_15886(%jl_value_t addrspace(10)* %5, i64 %10)
ret %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140246282792968 to %jl_value_t*) to %jl_value_t addrspace(10)*)
}
declare %jl_value_t*** @julia.ptls_states()
declare nonnull %jl_value_t addrspace(10)* @julia_getindex_14751(%jl_value_t addrspace(10)*, i64)
; Function Attrs: noreturn nounwind
declare void @llvm.trap() #1
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #2
; Function Attrs: noreturn
declare void @jl_bounds_error_unboxed_int(i8 addrspace(11)*, %jl_value_t*, i64) #3
; Function Attrs: allocsize(1)
declare noalias nonnull %jl_value_t addrspace(10)* @julia.gc_alloc_obj(i8*, i64, %jl_value_t addrspace(10)*) #4
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p10i8.p11i8.i64(i8 addrspace(10)* nocapture writeonly, i8 addrspace(11)* nocapture readonly, i64, i1) #2
declare %jl_value_t addrspace(10)* @jl_box_int64(i64 signext)
declare nonnull %jl_value_t addrspace(10)* @jl_f_tuple(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) #0
declare nonnull %jl_value_t addrspace(10)* @jl_apply_generic(%jl_value_t addrspace(10)**, i32) #0
declare nonnull %jl_value_t addrspace(10)* @jsys1_println_10491(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) #0
; Function Attrs: allocsize(1)
declare noalias nonnull %jl_value_t addrspace(10)* @jl_gc_pool_alloc(i8*, i32, i32) #4
; Function Attrs: allocsize(1)
declare noalias nonnull %jl_value_t addrspace(10)* @jl_gc_big_alloc(i8*, i64) #4
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p10i8.p0i8.i64(i8 addrspace(10)* nocapture writeonly, i8* nocapture readonly, i64, i1) #2
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #2
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #2
attributes #0 = { "thunk" }
attributes #1 = { noreturn nounwind }
attributes #2 = { argmemonly nounwind }
attributes #3 = { noreturn }
attributes #4 = { allocsize(1) }
!llvm.module.flags = !{!0, !1}
!llvm.dbg.cu = !{!2}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 1, !"Debug Info Version", i32 3}
!2 = distinct !DICompileUnit(language: DW_LANG_C89, file: !3, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)
!3 = !DIFile(filename: "none", directory: ".")
!4 = !{}
!5 = distinct !DISubprogram(name: "reverse1", linkageName: "julia_reverse1_15886", scope: null, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !2, retainedNodes: !4)
!6 = !DISubroutineType(types: !4)
!7 = !DILocation(line: 20, scope: !8, inlinedAt: !10)
!8 = distinct !DISubprogram(name: "getproperty;", linkageName: "getproperty", scope: !9, file: !9, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!9 = !DIFile(filename: "Base.jl", directory: ".")
!10 = !DILocation(line: 32, scope: !11, inlinedAt: !13)
!11 = distinct !DISubprogram(name: "parent;", linkageName: "parent", scope: !12, file: !12, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!12 = !DIFile(filename: "/data/vtjnash/julia/test/testhelpers/OffsetArrays.jl", directory: ".")
!13 = !DILocation(line: 43, scope: !14, inlinedAt: !15)
!14 = distinct !DISubprogram(name: "axes;", linkageName: "axes", scope: !12, file: !12, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!15 = !DILocation(line: 3, scope: !5)
!16 = !{!17, !17, i64 0}
!17 = !{!"jtbaa_immut", !18, i64 0}
!18 = !{!"jtbaa_value", !19, i64 0}
!19 = !{!"jtbaa_data", !20, i64 0}
!20 = !{!"jtbaa"}
!21 = !{i64 40}
!22 = !{i64 16}
!23 = !DILocation(line: 156, scope: !24, inlinedAt: !26)
!24 = distinct !DISubprogram(name: "size;", linkageName: "size", scope: !25, file: !25, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!25 = !DIFile(filename: "array.jl", directory: ".")
!26 = !DILocation(line: 75, scope: !27, inlinedAt: !13)
!27 = distinct !DISubprogram(name: "axes;", linkageName: "axes", scope: !28, file: !28, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!28 = !DIFile(filename: "abstractarray.jl", directory: ".")
!29 = !{!30, !30, i64 0, i64 1}
!30 = !{!"jtbaa_const", !20, i64 0}
!31 = !DILocation(line: 414, scope: !32, inlinedAt: !34)
!32 = distinct !DISubprogram(name: "max;", linkageName: "max", scope: !33, file: !33, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!33 = !DIFile(filename: "promotion.jl", directory: ".")
!34 = !DILocation(line: 309, scope: !35, inlinedAt: !37)
!35 = distinct !DISubprogram(name: "Type;", linkageName: "Type", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!36 = !DIFile(filename: "range.jl", directory: ".")
!37 = !DILocation(line: 318, scope: !35, inlinedAt: !38)
!38 = !DILocation(line: 140, scope: !39, inlinedAt: !26)
!39 = distinct !DISubprogram(name: "map;", linkageName: "map", scope: !40, file: !40, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!40 = !DIFile(filename: "tuple.jl", directory: ".")
!41 = !DILocation(line: 20, scope: !8, inlinedAt: !13)
!42 = !DILocation(line: 24, scope: !43, inlinedAt: !44)
!43 = distinct !DISubprogram(name: "getindex;", linkageName: "getindex", scope: !40, file: !40, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!44 = !DILocation(line: 44, scope: !45, inlinedAt: !13)
!45 = distinct !DISubprogram(name: "_indices;", linkageName: "_indices", scope: !12, file: !12, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!46 = !DILocation(line: 53, scope: !47, inlinedAt: !49)
!47 = distinct !DISubprogram(name: "+;", linkageName: "+", scope: !48, file: !48, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!48 = !DIFile(filename: "int.jl", directory: ".")
!49 = !DILocation(line: 1016, scope: !50, inlinedAt: !52)
!50 = distinct !DISubprogram(name: "broadcasted;", linkageName: "broadcasted", scope: !51, file: !51, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!51 = !DIFile(filename: "broadcast.jl", directory: ".")
!52 = !DILocation(line: 1216, scope: !50, inlinedAt: !44)
!53 = !DILocation(line: 52, scope: !54, inlinedAt: !55)
!54 = distinct !DISubprogram(name: "-;", linkageName: "-", scope: !48, file: !48, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!55 = !DILocation(line: 104, scope: !56, inlinedAt: !57)
!56 = distinct !DISubprogram(name: "_range;", linkageName: "_range", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!57 = !DILocation(line: 88, scope: !58, inlinedAt: !59)
!58 = distinct !DISubprogram(name: "#range#39;", linkageName: "#range#39", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!59 = !DILocation(line: 0, scope: !60, inlinedAt: !49)
!60 = distinct !DISubprogram(name: "#range;", linkageName: "#range", scope: !3, file: !3, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!61 = !DILocation(line: 201, scope: !62, inlinedAt: !44)
!62 = distinct !DISubprogram(name: "tail;", linkageName: "tail", scope: !63, file: !63, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!63 = !DIFile(filename: "essentials.jl", directory: ".")
!64 = !DILocation(line: 53, scope: !47, inlinedAt: !65)
!65 = !DILocation(line: 1016, scope: !50, inlinedAt: !66)
!66 = !DILocation(line: 1216, scope: !50, inlinedAt: !67)
!67 = !DILocation(line: 44, scope: !45, inlinedAt: !44)
!68 = !DILocation(line: 424, scope: !69, inlinedAt: !70)
!69 = distinct !DISubprogram(name: "<=;", linkageName: "<=", scope: !48, file: !48, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!70 = !DILocation(line: 341, scope: !71, inlinedAt: !73)
!71 = distinct !DISubprogram(name: ">=;", linkageName: ">=", scope: !72, file: !72, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!72 = !DIFile(filename: "operators.jl", directory: ".")
!73 = !DILocation(line: 280, scope: !74, inlinedAt: !75)
!74 = distinct !DISubprogram(name: "unitrange_last;", linkageName: "unitrange_last", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!75 = !DILocation(line: 275, scope: !35, inlinedAt: !55)
!76 = !DILocation(line: 52, scope: !54, inlinedAt: !77)
!77 = !DILocation(line: 104, scope: !56, inlinedAt: !78)
!78 = !DILocation(line: 88, scope: !58, inlinedAt: !79)
!79 = !DILocation(line: 0, scope: !60, inlinedAt: !65)
!80 = !DILocation(line: 424, scope: !69, inlinedAt: !81)
!81 = !DILocation(line: 341, scope: !71, inlinedAt: !82)
!82 = !DILocation(line: 280, scope: !74, inlinedAt: !83)
!83 = !DILocation(line: 275, scope: !35, inlinedAt: !77)
!84 = !{!85, !85, i64 0}
!85 = !{!"jtbaa_stack", !20, i64 0}
!86 = !DILocation(line: 24, scope: !43, inlinedAt: !87)
!87 = !DILocation(line: 4, scope: !5)
!88 = !DILocation(line: 6, scope: !5)
!89 = !DILocation(line: 34, scope: !90, inlinedAt: !91)
!90 = distinct !DISubprogram(name: "_setindex;", linkageName: "_setindex", scope: !40, file: !40, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!91 = !DILocation(line: 31, scope: !92, inlinedAt: !93)
!92 = distinct !DISubprogram(name: "setindex;", linkageName: "setindex", scope: !40, file: !40, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!93 = !DILocation(line: 8, scope: !5)
!94 = !DILocation(line: 34, scope: !90, inlinedAt: !89)
!95 = !DILocation(line: 316, scope: !96, inlinedAt: !98)
!96 = distinct !DISubprogram(name: "Type;", linkageName: "Type", scope: !97, file: !97, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!97 = !DIFile(filename: "indices.jl", directory: ".")
!98 = !DILocation(line: 316, scope: !96, inlinedAt: !99)
!99 = !DILocation(line: 140, scope: !39, inlinedAt: !100)
!100 = !DILocation(line: 7, scope: !5)
!101 = !DILocation(line: 9, scope: !5)
!102 = !DILocation(line: 20, scope: !8, inlinedAt: !103)
!103 = !DILocation(line: 32, scope: !11, inlinedAt: !104)
!104 = !DILocation(line: 43, scope: !14, inlinedAt: !105)
!105 = !DILocation(line: 5, scope: !5)
!106 = !DILocation(line: 156, scope: !24, inlinedAt: !107)
!107 = !DILocation(line: 75, scope: !27, inlinedAt: !104)
!108 = !DILocation(line: 414, scope: !32, inlinedAt: !109)
!109 = !DILocation(line: 309, scope: !35, inlinedAt: !110)
!110 = !DILocation(line: 318, scope: !35, inlinedAt: !111)
!111 = !DILocation(line: 140, scope: !39, inlinedAt: !107)
!112 = !DILocation(line: 53, scope: !47, inlinedAt: !113)
!113 = !DILocation(line: 1016, scope: !50, inlinedAt: !114)
!114 = !DILocation(line: 1216, scope: !50, inlinedAt: !115)
!115 = !DILocation(line: 44, scope: !45, inlinedAt: !104)
!116 = !DILocation(line: 52, scope: !54, inlinedAt: !117)
!117 = !DILocation(line: 104, scope: !56, inlinedAt: !118)
!118 = !DILocation(line: 88, scope: !58, inlinedAt: !119)
!119 = !DILocation(line: 0, scope: !60, inlinedAt: !113)
!120 = !DILocation(line: 424, scope: !69, inlinedAt: !121)
!121 = !DILocation(line: 341, scope: !71, inlinedAt: !122)
!122 = !DILocation(line: 280, scope: !74, inlinedAt: !123)
!123 = !DILocation(line: 275, scope: !35, inlinedAt: !117)
!124 = !DILocation(line: 53, scope: !47, inlinedAt: !125)
!125 = !DILocation(line: 1016, scope: !50, inlinedAt: !126)
!126 = !DILocation(line: 1216, scope: !50, inlinedAt: !127)
!127 = !DILocation(line: 44, scope: !45, inlinedAt: !115)
!128 = !DILocation(line: 52, scope: !54, inlinedAt: !129)
!129 = !DILocation(line: 104, scope: !56, inlinedAt: !130)
!130 = !DILocation(line: 88, scope: !58, inlinedAt: !131)
!131 = !DILocation(line: 0, scope: !60, inlinedAt: !125)
!132 = !DILocation(line: 424, scope: !69, inlinedAt: !133)
!133 = !DILocation(line: 341, scope: !71, inlinedAt: !134)
!134 = !DILocation(line: 280, scope: !74, inlinedAt: !135)
!135 = !DILocation(line: 275, scope: !35, inlinedAt: !129)
!136 = !DILocation(line: 20, scope: !8, inlinedAt: !137)
!137 = !DILocation(line: 563, scope: !138, inlinedAt: !139)
!138 = distinct !DISubprogram(name: "first;", linkageName: "first", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!139 = !DILocation(line: 475, scope: !140, inlinedAt: !141)
!140 = distinct !DISubprogram(name: "isempty;", linkageName: "isempty", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!141 = !DILocation(line: 591, scope: !142, inlinedAt: !143)
!142 = distinct !DISubprogram(name: "iterate;", linkageName: "iterate", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!143 = !DILocation(line: 367, scope: !144, inlinedAt: !88)
!144 = distinct !DISubprogram(name: "iterate;", linkageName: "iterate", scope: !97, file: !97, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!145 = !DILocation(line: 20, scope: !8, inlinedAt: !146)
!146 = !DILocation(line: 568, scope: !147, inlinedAt: !139)
!147 = distinct !DISubprogram(name: "last;", linkageName: "last", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!148 = !DILocation(line: 49, scope: !149, inlinedAt: !150)
!149 = distinct !DISubprogram(name: "<;", linkageName: "<", scope: !48, file: !48, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!150 = !DILocation(line: 294, scope: !151, inlinedAt: !139)
!151 = distinct !DISubprogram(name: ">;", linkageName: ">", scope: !72, file: !72, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!152 = !{!19, !19, i64 0}
!153 = !DILocation(line: 403, scope: !154, inlinedAt: !155)
!154 = distinct !DISubprogram(name: "==;", linkageName: "==", scope: !33, file: !33, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!155 = !DILocation(line: 595, scope: !142, inlinedAt: !156)
!156 = !DILocation(line: 367, scope: !144, inlinedAt: !101)
!157 = !DILocation(line: 53, scope: !47, inlinedAt: !158)
!158 = !DILocation(line: 596, scope: !142, inlinedAt: !156)
!159 = !{i64 24}
!160 = !{i64 8}
This is needed to be able to use -print-(before/after)=.
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 7347be8058..793bf5758d 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -40,6 +40,8 @@
#include <llvm/Support/TargetSelect.h>
#include <llvm/Object/SymbolSize.h>
+#include <llvm/InitializePasses.h>
+
// IR building
#include <llvm/IR/IntrinsicInst.h>
#include <llvm/Object/ObjectFile.h>
@@ -7620,6 +7622,9 @@ static void init_julia_llvm_env(Module *m)
extern "C" void *jl_init_llvm(void)
{
+ PassRegistry &Registry = *PassRegistry::getPassRegistry();
+ initializeLegacyLICMPassPass(Registry);
+
const char *const argv_tailmerge[] = {"", "-enable-tail-merge=0"}; // NOO TOUCHIE; NO TOUCH! See #922
cl::ParseCommandLineOptions(sizeof(argv_tailmerge)/sizeof(argv_tailmerge[0]), argv_tailmerge, "disable-tail-merge\n");
#if defined(_OS_WINDOWS_) && defined(_CPU_X86_64_)
; *** IR Dump Before Canonicalize natural loops *** (function: julia_reverse1_15886)
; ModuleID = 'reverse1'
source_filename = "reverse1"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64--linux-gnu"
%jl_value_t = type opaque
@llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (%jl_value_t addrspace(10)* (i8*, i32, i32)* @jl_gc_pool_alloc to i8*), i8* bitcast (%jl_value_t addrspace(10)* (i8*, i64)* @jl_gc_big_alloc to i8*)], section "llvm.metadata"
define void @julia_reverse1_15886(%jl_value_t addrspace(10)* nonnull align 8 dereferenceable(24), i64) !dbg !5 {
top:
%2 = alloca [2 x { { i64, i64 } }], align 8
%3 = alloca { { { i64, i64 } } }, align 8
%4 = alloca { { { i64, i64 } } }, align 8
%5 = alloca i64, align 8
%6 = alloca i64, align 8
%7 = call %jl_value_t*** @julia.ptls_states()
%8 = addrspacecast %jl_value_t addrspace(10)* %0 to %jl_value_t addrspace(11)*, !dbg !7
%9 = bitcast %jl_value_t addrspace(11)* %8 to %jl_value_t addrspace(10)* addrspace(11)*, !dbg !7
%10 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %9, align 8, !dbg !7, !tbaa !16, !nonnull !4, !dereferenceable !21, !align !22
%11 = addrspacecast %jl_value_t addrspace(10)* %10 to %jl_value_t addrspace(11)*, !dbg !23
%12 = bitcast %jl_value_t addrspace(11)* %11 to %jl_value_t addrspace(10)* addrspace(11)*, !dbg !23
%13 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %12, i64 3, !dbg !23
%14 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %13 to i64 addrspace(11)*, !dbg !23
%15 = load i64, i64 addrspace(11)* %14, align 8, !dbg !23, !tbaa !29, !invariant.load !4
%16 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %12, i64 4, !dbg !23
%17 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %16 to i64 addrspace(11)*, !dbg !23
%18 = load i64, i64 addrspace(11)* %17, align 8, !dbg !23, !tbaa !29, !invariant.load !4
%19 = icmp sgt i64 %18, 0, !dbg !31
%20 = select i1 %19, i64 %18, i64 0, !dbg !31
%21 = bitcast %jl_value_t addrspace(11)* %8 to i8 addrspace(11)*, !dbg !41
%22 = getelementptr inbounds i8, i8 addrspace(11)* %21, i64 8, !dbg !41
%23 = bitcast i8 addrspace(11)* %22 to i64 addrspace(11)*, !dbg !42
%24 = load i64, i64 addrspace(11)* %23, align 8, !dbg !46, !tbaa !16
%25 = add i64 %24, 1, !dbg !46
%26 = icmp sgt i64 %15, 0, !dbg !31
%27 = select i1 %26, i64 %15, i64 0, !dbg !31
%28 = add i64 %24, %27, !dbg !53
%29 = getelementptr i8, i8 addrspace(11)* %21, i64 16, !dbg !61
%30 = bitcast i8 addrspace(11)* %29 to i64 addrspace(11)*, !dbg !61
%31 = load i64, i64 addrspace(11)* %30, align 8, !dbg !64, !tbaa !16
%32 = add i64 %31, 1, !dbg !64
%33 = icmp sgt i64 %25, %28, !dbg !68
%34 = select i1 %33, i64 %24, i64 %28, !dbg !73
%35 = add i64 %31, %20, !dbg !76
%36 = icmp sgt i64 %32, %35, !dbg !80
%37 = select i1 %36, i64 %31, i64 %35, !dbg !82
%.sroa.0.sroa.050.0..sroa.0.0..sroa_cast45.sroa_idx = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 0, i32 0, i32 0, !dbg !44
store i64 %25, i64* %.sroa.0.sroa.050.0..sroa.0.0..sroa_cast45.sroa_idx, align 8, !dbg !44, !tbaa !84
%.sroa.0.sroa.251.0..sroa.0.0..sroa_cast45.sroa_idx52 = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 0, i32 0, i32 1, !dbg !44
store i64 %34, i64* %.sroa.0.sroa.251.0..sroa.0.0..sroa_cast45.sroa_idx52, align 8, !dbg !44, !tbaa !84
%.sroa.0.sroa.041.0..sroa.0.0..sroa_cast36.sroa_idx = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 1, i32 0, i32 0, !dbg !44
store i64 %32, i64* %.sroa.0.sroa.041.0..sroa.0.0..sroa_cast36.sroa_idx, align 8, !dbg !44, !tbaa !84
%.sroa.0.sroa.242.0..sroa.0.0..sroa_cast36.sroa_idx43 = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 1, i32 0, i32 1, !dbg !44
store i64 %37, i64* %.sroa.0.sroa.242.0..sroa.0.0..sroa_cast36.sroa_idx43, align 8, !dbg !44, !tbaa !84
%38 = add i64 %1, -1, !dbg !86
%39 = icmp ult i64 %38, 2, !dbg !86
br i1 %39, label %pass, label %fail, !dbg !86
L138: ; preds = %pass
br label %L140, !dbg !88
L140: ; preds = %L138, %post_box_union14
%value_phi10 = phi i64 [ %73, %L138 ], [ %88, %post_box_union14 ]
%.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 0, !dbg !89
store i64 %59, i64* %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx, align 8, !dbg !89, !tbaa !84
%.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 1, !dbg !89
store i64 %64, i64* %.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34, align 8, !dbg !89, !tbaa !84
%.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 0, !dbg !89
store i64 %66, i64* %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx, align 8, !dbg !89, !tbaa !84
%.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 1, !dbg !89
store i64 %69, i64* %.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25, align 8, !dbg !89, !tbaa !84
%40 = icmp ne i64 %1, 1, !dbg !95
store i64 %value_phi10, i64* %5, align 8, !dbg !97
%41 = select i1 %40, i64* %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx, i64* %5, !dbg !97
%42 = icmp ne i64 %1, 2, !dbg !102
store i64 %value_phi10, i64* %6, align 8, !dbg !103
%43 = select i1 %42, i64* %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx, i64* %6, !dbg !103
br i1 %40, label %box_union, label %box_union12, !dbg !97
L166: ; preds = %pass, %post_box_union14
ret void, !dbg !104
fail: ; preds = %top
%44 = bitcast [2 x { { i64, i64 } }]* %2 to i8*, !dbg !86
%45 = addrspacecast i8* %44 to i8 addrspace(11)*, !dbg !86
call void @jl_bounds_error_unboxed_int(i8 addrspace(11)* %45, %jl_value_t* inttoptr (i64 140499833420800 to %jl_value_t*), i64 %1), !dbg !86
unreachable, !dbg !86
pass: ; preds = %top
%46 = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 %38, !dbg !86
%47 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %9, align 8, !dbg !105, !tbaa !16, !nonnull !4, !dereferenceable !21, !align !22
%48 = addrspacecast %jl_value_t addrspace(10)* %47 to %jl_value_t addrspace(11)*, !dbg !109
%49 = bitcast %jl_value_t addrspace(11)* %48 to %jl_value_t addrspace(10)* addrspace(11)*, !dbg !109
%50 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %49, i64 3, !dbg !109
%51 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %50 to i64 addrspace(11)*, !dbg !109
%52 = load i64, i64 addrspace(11)* %51, align 8, !dbg !109, !tbaa !29, !invariant.load !4
%53 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(11)* %49, i64 4, !dbg !109
%54 = bitcast %jl_value_t addrspace(10)* addrspace(11)* %53 to i64 addrspace(11)*, !dbg !109
%55 = load i64, i64 addrspace(11)* %54, align 8, !dbg !109, !tbaa !29, !invariant.load !4
%56 = icmp sgt i64 %55, 0, !dbg !111
%57 = select i1 %56, i64 %55, i64 0, !dbg !111
%58 = load i64, i64 addrspace(11)* %23, align 8, !dbg !115, !tbaa !16
%59 = add i64 %58, 1, !dbg !115
%60 = icmp sgt i64 %52, 0, !dbg !111
%61 = select i1 %60, i64 %52, i64 0, !dbg !111
%62 = add i64 %58, %61, !dbg !119
%63 = icmp sgt i64 %59, %62, !dbg !123
%64 = select i1 %63, i64 %58, i64 %62, !dbg !125
%65 = load i64, i64 addrspace(11)* %30, align 8, !dbg !127, !tbaa !16
%66 = add i64 %65, 1, !dbg !127
%67 = add i64 %65, %57, !dbg !131
%68 = icmp sgt i64 %66, %67, !dbg !135
%69 = select i1 %68, i64 %65, i64 %67, !dbg !137
%70 = getelementptr inbounds { { i64, i64 } }, { { i64, i64 } }* %46, i64 0, i32 0, i32 0, !dbg !139
%71 = getelementptr inbounds [2 x { { i64, i64 } }], [2 x { { i64, i64 } }]* %2, i64 0, i64 %38, i32 0, i32 1, !dbg !148
%72 = load i64, i64* %71, align 8, !dbg !151, !tbaa !84
%73 = load i64, i64* %70, align 8, !dbg !151, !tbaa !84
%74 = icmp slt i64 %72, %73, !dbg !151
br i1 %74, label %L166, label %L138, !dbg !144
post_box_union: ; preds = %box_union12, %box_union
%75 = phi %jl_value_t addrspace(10)* [ %77, %box_union ], [ %81, %box_union12 ], !dbg !97
br i1 %42, label %box_union15, label %box_union16, !dbg !97
box_union: ; preds = %L140
%76 = bitcast %jl_value_t*** %7 to i8*, !dbg !97
%77 = call noalias nonnull %jl_value_t addrspace(10)* @julia.gc_alloc_obj(i8* %76, i64 16, %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140499834391520 to %jl_value_t*) to %jl_value_t addrspace(10)*)) #4, !dbg !97
%78 = bitcast %jl_value_t addrspace(10)* %77 to i8 addrspace(10)*, !dbg !97
%79 = bitcast i64* %41 to i8*
call void @llvm.memcpy.p10i8.p0i8.i64(i8 addrspace(10)* align 8 %78, i8* align 8 %79, i64 16, i1 false), !dbg !97, !tbaa !155
br label %post_box_union, !dbg !97
box_union12: ; preds = %L140
%80 = load i64, i64* %41, align 8, !dbg !97, !tbaa !155
%81 = call %jl_value_t addrspace(10)* @jl_box_int64(i64 signext %80), !dbg !97
br label %post_box_union, !dbg !97
post_box_union14: ; preds = %box_union16, %box_union15
%82 = phi %jl_value_t addrspace(10)* [ %90, %box_union15 ], [ %94, %box_union16 ], !dbg !97
%83 = call cc37 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32)* @jl_f_tuple to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* null to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* %75, %jl_value_t addrspace(10)* %82), !dbg !97
%84 = call cc36 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)**, i32)* @jl_apply_generic to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140499945486320 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* nonnull %83), !dbg !104
%85 = call cc37 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32)* @jsys1_println_10491 to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140499942424992 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140499832426672 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* nonnull %84), !dbg !104
%86 = load i64, i64* %71, align 8, !dbg !156, !tbaa !84
%87 = icmp eq i64 %value_phi10, %86, !dbg !156
%88 = add i64 %value_phi10, 1, !dbg !159
br i1 %87, label %L166, label %L140, !dbg !104
box_union15: ; preds = %post_box_union
%89 = bitcast %jl_value_t*** %7 to i8*, !dbg !97
%90 = call noalias nonnull %jl_value_t addrspace(10)* @julia.gc_alloc_obj(i8* %89, i64 16, %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140499834391520 to %jl_value_t*) to %jl_value_t addrspace(10)*)) #4, !dbg !97
%91 = bitcast %jl_value_t addrspace(10)* %90 to i8 addrspace(10)*, !dbg !97
%92 = bitcast i64* %43 to i8*
call void @llvm.memcpy.p10i8.p0i8.i64(i8 addrspace(10)* align 8 %91, i8* align 8 %92, i64 16, i1 false), !dbg !97, !tbaa !155
br label %post_box_union14, !dbg !97
box_union16: ; preds = %post_box_union
%93 = load i64, i64* %43, align 8, !dbg !97, !tbaa !155
%94 = call %jl_value_t addrspace(10)* @jl_box_int64(i64 signext %93), !dbg !97
br label %post_box_union14, !dbg !97
}
define nonnull %jl_value_t addrspace(10)* @jfptr_reverse1_15887(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) #0 {
top:
%3 = call %jl_value_t*** @julia.ptls_states()
%4 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %1, i64 1
%5 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %4, !nonnull !4, !dereferenceable !161, !align !162
%6 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %1, i64 2
%7 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %6, !nonnull !4, !dereferenceable !162, !align !162
%8 = bitcast %jl_value_t addrspace(10)* %7 to i64 addrspace(10)*
%9 = addrspacecast i64 addrspace(10)* %8 to i64 addrspace(11)*
%10 = load i64, i64 addrspace(11)* %9, align 8
call void @julia_reverse1_15886(%jl_value_t addrspace(10)* %5, i64 %10)
ret %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140499818868744 to %jl_value_t*) to %jl_value_t addrspace(10)*)
}
declare %jl_value_t*** @julia.ptls_states()
declare nonnull %jl_value_t addrspace(10)* @julia_getindex_14751(%jl_value_t addrspace(10)*, i64)
; Function Attrs: noreturn nounwind
declare void @llvm.trap() #1
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #2
; Function Attrs: noreturn
declare void @jl_bounds_error_unboxed_int(i8 addrspace(11)*, %jl_value_t*, i64) #3
; Function Attrs: allocsize(1)
declare noalias nonnull %jl_value_t addrspace(10)* @julia.gc_alloc_obj(i8*, i64, %jl_value_t addrspace(10)*) #4
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p10i8.p11i8.i64(i8 addrspace(10)* nocapture writeonly, i8 addrspace(11)* nocapture readonly, i64, i1) #2
declare %jl_value_t addrspace(10)* @jl_box_int64(i64 signext)
declare nonnull %jl_value_t addrspace(10)* @jl_f_tuple(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) #0
declare nonnull %jl_value_t addrspace(10)* @jl_apply_generic(%jl_value_t addrspace(10)**, i32) #0
declare nonnull %jl_value_t addrspace(10)* @jsys1_println_10491(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) #0
; Function Attrs: allocsize(1)
declare noalias nonnull %jl_value_t addrspace(10)* @jl_gc_pool_alloc(i8*, i32, i32) #4
; Function Attrs: allocsize(1)
declare noalias nonnull %jl_value_t addrspace(10)* @jl_gc_big_alloc(i8*, i64) #4
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p10i8.p0i8.i64(i8 addrspace(10)* nocapture writeonly, i8* nocapture readonly, i64, i1) #2
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #2
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #2
attributes #0 = { "thunk" }
attributes #1 = { noreturn nounwind }
attributes #2 = { argmemonly nounwind }
attributes #3 = { noreturn }
attributes #4 = { allocsize(1) }
!llvm.module.flags = !{!0, !1}
!llvm.dbg.cu = !{!2}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 1, !"Debug Info Version", i32 3}
!2 = distinct !DICompileUnit(language: DW_LANG_C89, file: !3, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)
!3 = !DIFile(filename: "none", directory: ".")
!4 = !{}
!5 = distinct !DISubprogram(name: "reverse1", linkageName: "julia_reverse1_15886", scope: null, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !2, retainedNodes: !4)
!6 = !DISubroutineType(types: !4)
!7 = !DILocation(line: 20, scope: !8, inlinedAt: !10)
!8 = distinct !DISubprogram(name: "getproperty;", linkageName: "getproperty", scope: !9, file: !9, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!9 = !DIFile(filename: "Base.jl", directory: ".")
!10 = !DILocation(line: 32, scope: !11, inlinedAt: !13)
!11 = distinct !DISubprogram(name: "parent;", linkageName: "parent", scope: !12, file: !12, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!12 = !DIFile(filename: "/data/vtjnash/julia/test/testhelpers/OffsetArrays.jl", directory: ".")
!13 = !DILocation(line: 43, scope: !14, inlinedAt: !15)
!14 = distinct !DISubprogram(name: "axes;", linkageName: "axes", scope: !12, file: !12, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!15 = !DILocation(line: 3, scope: !5)
!16 = !{!17, !17, i64 0}
!17 = !{!"jtbaa_immut", !18, i64 0}
!18 = !{!"jtbaa_value", !19, i64 0}
!19 = !{!"jtbaa_data", !20, i64 0}
!20 = !{!"jtbaa"}
!21 = !{i64 40}
!22 = !{i64 16}
!23 = !DILocation(line: 156, scope: !24, inlinedAt: !26)
!24 = distinct !DISubprogram(name: "size;", linkageName: "size", scope: !25, file: !25, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!25 = !DIFile(filename: "array.jl", directory: ".")
!26 = !DILocation(line: 75, scope: !27, inlinedAt: !13)
!27 = distinct !DISubprogram(name: "axes;", linkageName: "axes", scope: !28, file: !28, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!28 = !DIFile(filename: "abstractarray.jl", directory: ".")
!29 = !{!30, !30, i64 0, i64 1}
!30 = !{!"jtbaa_const", !20, i64 0}
!31 = !DILocation(line: 414, scope: !32, inlinedAt: !34)
!32 = distinct !DISubprogram(name: "max;", linkageName: "max", scope: !33, file: !33, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!33 = !DIFile(filename: "promotion.jl", directory: ".")
!34 = !DILocation(line: 309, scope: !35, inlinedAt: !37)
!35 = distinct !DISubprogram(name: "Type;", linkageName: "Type", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!36 = !DIFile(filename: "range.jl", directory: ".")
!37 = !DILocation(line: 318, scope: !35, inlinedAt: !38)
!38 = !DILocation(line: 140, scope: !39, inlinedAt: !26)
!39 = distinct !DISubprogram(name: "map;", linkageName: "map", scope: !40, file: !40, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!40 = !DIFile(filename: "tuple.jl", directory: ".")
!41 = !DILocation(line: 20, scope: !8, inlinedAt: !13)
!42 = !DILocation(line: 24, scope: !43, inlinedAt: !44)
!43 = distinct !DISubprogram(name: "getindex;", linkageName: "getindex", scope: !40, file: !40, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!44 = !DILocation(line: 44, scope: !45, inlinedAt: !13)
!45 = distinct !DISubprogram(name: "_indices;", linkageName: "_indices", scope: !12, file: !12, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!46 = !DILocation(line: 53, scope: !47, inlinedAt: !49)
!47 = distinct !DISubprogram(name: "+;", linkageName: "+", scope: !48, file: !48, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!48 = !DIFile(filename: "int.jl", directory: ".")
!49 = !DILocation(line: 1016, scope: !50, inlinedAt: !52)
!50 = distinct !DISubprogram(name: "broadcasted;", linkageName: "broadcasted", scope: !51, file: !51, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!51 = !DIFile(filename: "broadcast.jl", directory: ".")
!52 = !DILocation(line: 1216, scope: !50, inlinedAt: !44)
!53 = !DILocation(line: 52, scope: !54, inlinedAt: !55)
!54 = distinct !DISubprogram(name: "-;", linkageName: "-", scope: !48, file: !48, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!55 = !DILocation(line: 104, scope: !56, inlinedAt: !57)
!56 = distinct !DISubprogram(name: "_range;", linkageName: "_range", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!57 = !DILocation(line: 88, scope: !58, inlinedAt: !59)
!58 = distinct !DISubprogram(name: "#range#39;", linkageName: "#range#39", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!59 = !DILocation(line: 0, scope: !60, inlinedAt: !49)
!60 = distinct !DISubprogram(name: "#range;", linkageName: "#range", scope: !3, file: !3, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!61 = !DILocation(line: 201, scope: !62, inlinedAt: !44)
!62 = distinct !DISubprogram(name: "tail;", linkageName: "tail", scope: !63, file: !63, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!63 = !DIFile(filename: "essentials.jl", directory: ".")
!64 = !DILocation(line: 53, scope: !47, inlinedAt: !65)
!65 = !DILocation(line: 1016, scope: !50, inlinedAt: !66)
!66 = !DILocation(line: 1216, scope: !50, inlinedAt: !67)
!67 = !DILocation(line: 44, scope: !45, inlinedAt: !44)
!68 = !DILocation(line: 424, scope: !69, inlinedAt: !70)
!69 = distinct !DISubprogram(name: "<=;", linkageName: "<=", scope: !48, file: !48, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!70 = !DILocation(line: 341, scope: !71, inlinedAt: !73)
!71 = distinct !DISubprogram(name: ">=;", linkageName: ">=", scope: !72, file: !72, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!72 = !DIFile(filename: "operators.jl", directory: ".")
!73 = !DILocation(line: 280, scope: !74, inlinedAt: !75)
!74 = distinct !DISubprogram(name: "unitrange_last;", linkageName: "unitrange_last", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!75 = !DILocation(line: 275, scope: !35, inlinedAt: !55)
!76 = !DILocation(line: 52, scope: !54, inlinedAt: !77)
!77 = !DILocation(line: 104, scope: !56, inlinedAt: !78)
!78 = !DILocation(line: 88, scope: !58, inlinedAt: !79)
!79 = !DILocation(line: 0, scope: !60, inlinedAt: !65)
!80 = !DILocation(line: 424, scope: !69, inlinedAt: !81)
!81 = !DILocation(line: 341, scope: !71, inlinedAt: !82)
!82 = !DILocation(line: 280, scope: !74, inlinedAt: !83)
!83 = !DILocation(line: 275, scope: !35, inlinedAt: !77)
!84 = !{!85, !85, i64 0}
!85 = !{!"jtbaa_stack", !20, i64 0}
!86 = !DILocation(line: 24, scope: !43, inlinedAt: !87)
!87 = !DILocation(line: 4, scope: !5)
!88 = !DILocation(line: 6, scope: !5)
!89 = !DILocation(line: 316, scope: !90, inlinedAt: !92)
!90 = distinct !DISubprogram(name: "Type;", linkageName: "Type", scope: !91, file: !91, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!91 = !DIFile(filename: "indices.jl", directory: ".")
!92 = !DILocation(line: 316, scope: !90, inlinedAt: !93)
!93 = !DILocation(line: 140, scope: !39, inlinedAt: !94)
!94 = !DILocation(line: 7, scope: !5)
!95 = !DILocation(line: 403, scope: !96, inlinedAt: !97)
!96 = distinct !DISubprogram(name: "==;", linkageName: "==", scope: !33, file: !33, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!97 = !DILocation(line: 34, scope: !98, inlinedAt: !99)
!98 = distinct !DISubprogram(name: "_setindex;", linkageName: "_setindex", scope: !40, file: !40, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!99 = !DILocation(line: 31, scope: !100, inlinedAt: !101)
!100 = distinct !DISubprogram(name: "setindex;", linkageName: "setindex", scope: !40, file: !40, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!101 = !DILocation(line: 8, scope: !5)
!102 = !DILocation(line: 403, scope: !96, inlinedAt: !103)
!103 = !DILocation(line: 34, scope: !98, inlinedAt: !97)
!104 = !DILocation(line: 9, scope: !5)
!105 = !DILocation(line: 20, scope: !8, inlinedAt: !106)
!106 = !DILocation(line: 32, scope: !11, inlinedAt: !107)
!107 = !DILocation(line: 43, scope: !14, inlinedAt: !108)
!108 = !DILocation(line: 5, scope: !5)
!109 = !DILocation(line: 156, scope: !24, inlinedAt: !110)
!110 = !DILocation(line: 75, scope: !27, inlinedAt: !107)
!111 = !DILocation(line: 414, scope: !32, inlinedAt: !112)
!112 = !DILocation(line: 309, scope: !35, inlinedAt: !113)
!113 = !DILocation(line: 318, scope: !35, inlinedAt: !114)
!114 = !DILocation(line: 140, scope: !39, inlinedAt: !110)
!115 = !DILocation(line: 53, scope: !47, inlinedAt: !116)
!116 = !DILocation(line: 1016, scope: !50, inlinedAt: !117)
!117 = !DILocation(line: 1216, scope: !50, inlinedAt: !118)
!118 = !DILocation(line: 44, scope: !45, inlinedAt: !107)
!119 = !DILocation(line: 52, scope: !54, inlinedAt: !120)
!120 = !DILocation(line: 104, scope: !56, inlinedAt: !121)
!121 = !DILocation(line: 88, scope: !58, inlinedAt: !122)
!122 = !DILocation(line: 0, scope: !60, inlinedAt: !116)
!123 = !DILocation(line: 424, scope: !69, inlinedAt: !124)
!124 = !DILocation(line: 341, scope: !71, inlinedAt: !125)
!125 = !DILocation(line: 280, scope: !74, inlinedAt: !126)
!126 = !DILocation(line: 275, scope: !35, inlinedAt: !120)
!127 = !DILocation(line: 53, scope: !47, inlinedAt: !128)
!128 = !DILocation(line: 1016, scope: !50, inlinedAt: !129)
!129 = !DILocation(line: 1216, scope: !50, inlinedAt: !130)
!130 = !DILocation(line: 44, scope: !45, inlinedAt: !118)
!131 = !DILocation(line: 52, scope: !54, inlinedAt: !132)
!132 = !DILocation(line: 104, scope: !56, inlinedAt: !133)
!133 = !DILocation(line: 88, scope: !58, inlinedAt: !134)
!134 = !DILocation(line: 0, scope: !60, inlinedAt: !128)
!135 = !DILocation(line: 424, scope: !69, inlinedAt: !136)
!136 = !DILocation(line: 341, scope: !71, inlinedAt: !137)
!137 = !DILocation(line: 280, scope: !74, inlinedAt: !138)
!138 = !DILocation(line: 275, scope: !35, inlinedAt: !132)
!139 = !DILocation(line: 20, scope: !8, inlinedAt: !140)
!140 = !DILocation(line: 563, scope: !141, inlinedAt: !142)
!141 = distinct !DISubprogram(name: "first;", linkageName: "first", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!142 = !DILocation(line: 475, scope: !143, inlinedAt: !144)
!143 = distinct !DISubprogram(name: "isempty;", linkageName: "isempty", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!144 = !DILocation(line: 591, scope: !145, inlinedAt: !146)
!145 = distinct !DISubprogram(name: "iterate;", linkageName: "iterate", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!146 = !DILocation(line: 367, scope: !147, inlinedAt: !88)
!147 = distinct !DISubprogram(name: "iterate;", linkageName: "iterate", scope: !91, file: !91, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!148 = !DILocation(line: 20, scope: !8, inlinedAt: !149)
!149 = !DILocation(line: 568, scope: !150, inlinedAt: !142)
!150 = distinct !DISubprogram(name: "last;", linkageName: "last", scope: !36, file: !36, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!151 = !DILocation(line: 49, scope: !152, inlinedAt: !153)
!152 = distinct !DISubprogram(name: "<;", linkageName: "<", scope: !48, file: !48, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!153 = !DILocation(line: 294, scope: !154, inlinedAt: !142)
!154 = distinct !DISubprogram(name: ">;", linkageName: ">", scope: !72, file: !72, type: !6, isLocal: false, isDefinition: true, isOptimized: true, unit: !2, retainedNodes: !4)
!155 = !{!19, !19, i64 0}
!156 = !DILocation(line: 403, scope: !96, inlinedAt: !157)
!157 = !DILocation(line: 595, scope: !145, inlinedAt: !158)
!158 = !DILocation(line: 367, scope: !147, inlinedAt: !104)
!159 = !DILocation(line: 53, scope: !47, inlinedAt: !160)
!160 = !DILocation(line: 596, scope: !145, inlinedAt: !158)
!161 = !{i64 24}
!162 = !{i64 8}
LICM sinking instruction: %92 = bitcast i64* %43 to i8*
remark: <unknown>:0:0: sinking bitcast
LICM sinking instruction: %91 = bitcast %jl_value_t addrspace(10)* %90 to i8 addrspace(10)*, !dbg !97
remark: tuple.jl:34:0: sinking bitcast
LICM sinking instruction: %89 = bitcast %jl_value_t*** %7 to i8*, !dbg !97
remark: tuple.jl:34:0: sinking bitcast
LICM sinking instruction: %79 = bitcast i64* %41 to i8*
remark: <unknown>:0:0: sinking bitcast
LICM sinking instruction: %78 = bitcast %jl_value_t addrspace(10)* %77 to i8 addrspace(10)*, !dbg !97
remark: tuple.jl:34:0: sinking bitcast
LICM sinking instruction: %76 = bitcast %jl_value_t*** %7 to i8*, !dbg !97
remark: tuple.jl:34:0: sinking bitcast
LICM sinking instruction: %.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 1, !dbg !89
remark: indices.jl:316:0: sinking getelementptr
LICM sinking instruction: %.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 1, !dbg !89
remark: indices.jl:316:0: sinking getelementptr
LICM hoisting to L138: %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 0, !dbg !89
remark: indices.jl:316:0: hoisting getelementptr
LICM hoisting to L138: %.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 1, !dbg !89
remark: indices.jl:316:0: hoisting getelementptr
LICM hoisting to L138: %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 0, !dbg !89
remark: indices.jl:316:0: hoisting getelementptr
LICM hoisting to L138: %.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 1, !dbg !89
remark: indices.jl:316:0: hoisting getelementptr
LICM hoisting to L138: %40 = icmp ne i64 %1, 1, !dbg !95
remark: promotion.jl:403:0: hoisting icmp
LICM hoisting to L138: %41 = select i1 %40, i64* %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx, i64* %5, !dbg !95
remark: tuple.jl:34:0: hoisting select
LICM hoisting to L138: %42 = icmp ne i64 %1, 2, !dbg !100
remark: promotion.jl:403:0: hoisting icmp
LICM hoisting to L138: %43 = select i1 %42, i64* %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx, i64* %6, !dbg !100
remark: tuple.jl:34:0: hoisting select
LICM hoisting to L138: %76 = bitcast %jl_value_t*** %7 to i8*, !dbg !95
remark: tuple.jl:34:0: hoisting bitcast
LICM hoisting to L138: %79 = bitcast i64* %41 to i8*
remark: <unknown>:0:0: hoisting bitcast
LICM hoisting to L138: %89 = bitcast %jl_value_t*** %7 to i8*, !dbg !95
remark: tuple.jl:34:0: hoisting bitcast
LICM hoisting to L138: %92 = bitcast i64* %43 to i8*
remark: <unknown>:0:0: hoisting bitcast
LICM: Promoting value stored to in loop: %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 0
remark: indices.jl:316:0: Moving accesses to memory location out of the loop
LICM: Promoting value stored to in loop: %.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 1
remark: indices.jl:316:0: Moving accesses to memory location out of the loop
LICM: Promoting value stored to in loop: %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 0
remark: indices.jl:316:0: Moving accesses to memory location out of the loop
LICM: Promoting value stored to in loop: %.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 1
remark: indices.jl:316:0: Moving accesses to memory location out of the loop
*** IR Dump After Loop Invariant Code Motion ***
; Preheader:
L138: ; preds = %pass
%.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 0
%.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %3, i64 0, i32 0, i32 0, i32 1
%.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 0
%.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25 = getelementptr inbounds { { { i64, i64 } } }, { { { i64, i64 } } }* %4, i64 0, i32 0, i32 0, i32 1
%40 = icmp ne i64 %1, 1
%41 = select i1 %40, i64* %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx, i64* %5
%42 = icmp ne i64 %1, 2
%43 = select i1 %42, i64* %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx, i64* %6
%44 = bitcast %jl_value_t*** %7 to i8*
%45 = bitcast i64* %41 to i8*
%46 = bitcast %jl_value_t*** %7 to i8*
%47 = bitcast i64* %43 to i8*
br label %L140, !dbg !88
; Loop:
L140: ; preds = %L138, %post_box_union14
%value_phi10 = phi i64 [ %77, %L138 ], [ %90, %post_box_union14 ]
store i64 %value_phi10, i64* %5, align 8, !dbg !89
store i64 %value_phi10, i64* %6, align 8, !dbg !94
br i1 %40, label %box_union, label %box_union12, !dbg !89
box_union12: ; preds = %L140
%82 = load i64, i64* %41, align 8, !dbg !89, !tbaa !152
%83 = call %jl_value_t addrspace(10)* @jl_box_int64(i64 signext %82), !dbg !89
br label %post_box_union, !dbg !89
box_union: ; preds = %L140
%80 = call noalias nonnull %jl_value_t addrspace(10)* @julia.gc_alloc_obj(i8* %44, i64 16, %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140079435221984 to %jl_value_t*) to %jl_value_t addrspace(10)*)) #4, !dbg !89
%81 = bitcast %jl_value_t addrspace(10)* %80 to i8 addrspace(10)*, !dbg !89
call void @llvm.memcpy.p10i8.p0i8.i64(i8 addrspace(10)* align 8 %81, i8* align 8 %45, i64 16, i1 false), !dbg !89, !tbaa !152
br label %post_box_union, !dbg !89
post_box_union: ; preds = %box_union12, %box_union
%79 = phi %jl_value_t addrspace(10)* [ %80, %box_union ], [ %83, %box_union12 ], !dbg !89
br i1 %42, label %box_union15, label %box_union16, !dbg !89
box_union16: ; preds = %post_box_union
%93 = load i64, i64* %43, align 8, !dbg !89, !tbaa !152
%94 = call %jl_value_t addrspace(10)* @jl_box_int64(i64 signext %93), !dbg !89
br label %post_box_union14, !dbg !89
box_union15: ; preds = %post_box_union
%91 = call noalias nonnull %jl_value_t addrspace(10)* @julia.gc_alloc_obj(i8* %46, i64 16, %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140079435221984 to %jl_value_t*) to %jl_value_t addrspace(10)*)) #4, !dbg !89
%92 = bitcast %jl_value_t addrspace(10)* %91 to i8 addrspace(10)*, !dbg !89
call void @llvm.memcpy.p10i8.p0i8.i64(i8 addrspace(10)* align 8 %92, i8* align 8 %47, i64 16, i1 false), !dbg !89, !tbaa !152
br label %post_box_union14, !dbg !89
post_box_union14: ; preds = %box_union16, %box_union15
%84 = phi %jl_value_t addrspace(10)* [ %91, %box_union15 ], [ %94, %box_union16 ], !dbg !89
%85 = call cc37 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32)* @jl_f_tuple to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* null to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* %79, %jl_value_t addrspace(10)* %84), !dbg !89
%86 = call cc36 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)**, i32)* @jl_apply_generic to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140079546316784 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* nonnull %85), !dbg !101
%87 = call cc37 nonnull %jl_value_t addrspace(10)* bitcast (%jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32)* @jsys1_println_10491 to %jl_value_t addrspace(10)* (%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*)*)(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140079543255456 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140079433257136 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* nonnull %86), !dbg !101
%88 = load i64, i64* %75, align 8, !dbg !153, !tbaa !84
%89 = icmp eq i64 %value_phi10, %88, !dbg !153
%90 = add i64 %value_phi10, 1, !dbg !157
br i1 %89, label %L166.loopexit, label %L140, !dbg !101
; Exit blocks
L166.loopexit: ; preds = %post_box_union14
store i64 %63, i64* %.sroa.0.sroa.032.0..sroa.0.0..sroa_cast27.sroa_idx, align 8, !dbg !95, !tbaa !84
store i64 %68, i64* %.sroa.0.sroa.233.0..sroa.0.0..sroa_cast27.sroa_idx34, align 8, !dbg !95, !tbaa !84
store i64 %70, i64* %.sroa.0.sroa.0.0..sroa.0.0..sroa_cast21.sroa_idx, align 8, !dbg !95, !tbaa !84
store i64 %73, i64* %.sroa.0.sroa.2.0..sroa.0.0..sroa_cast21.sroa_idx25, align 8, !dbg !95, !tbaa !84
br label %L166, !dbg !101
regenerate with:
$ JULIA_LLVM_ARGS='-print-before=loop-simplify -print-after=licm -print-module-scope' ../julia -O2 -L testhelpers/OffsetArrays.jl -e 'using .Main.OffsetArrays; A = OffsetArray(rand(4,4), (-3,5))' -e 'function reverse1(A::AbstractArray, d)
nd = ndims(A)
inds = axes(A)
indsd = inds[d]
ax = axes(A)
for i in indsd
I1 = map(Base.Slice, ax)
I1i = Base.setindex(I1, i, d)
@show I1i
end
end' -e 'reverse1(A, 1)' &> alllicm.ll
trigger with:
$ opt -debug -pass-remarks=licm -debug-only=licm -tbaa -licm preloop.ll -S -o -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment