Skip to content

Instantly share code, notes, and snippets.

@saulshanabrook
Created September 11, 2018 17:30
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 saulshanabrook/bf4c1e73550c29839a661fb28cb9a323 to your computer and use it in GitHub Desktop.
Save saulshanabrook/bf4c1e73550c29839a661fb28cb9a323 to your computer and use it in GitHub Desktop.
; ModuleID = 'nrt'
source_filename = "<string>"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin17.7.0"
@.const.picklebuf.4556225032 = internal constant { i8*, i32 } { i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.const.pickledata.4556225032, i32 0, i32 0), i32 101 }
@.const.pickledata.4556225032 = internal constant [101 x i8] c"\80\04\95Z\00\00\00\00\00\00\00\8C\08builtins\94\8C\0CRuntimeError\94\93\94\8C6numba jitted function aborted due to unresolved symbol\94\85\94\86\94."
; Function Attrs: norecurse nounwind
define i64 @nrt_atomic_add(i64* nocapture %.1) local_unnamed_addr #0 {
.3:
%.4 = atomicrmw add i64* %.1, i64 1 monotonic
%.5 = add i64 %.4, 1
ret i64 %.5
}
; Function Attrs: norecurse nounwind
define i64 @nrt_atomic_sub(i64* nocapture %.1) local_unnamed_addr #0 {
.3:
%.4 = atomicrmw sub i64* %.1, i64 1 monotonic
%.5 = add i64 %.4, -1
ret i64 %.5
}
; Function Attrs: norecurse nounwind
define i32 @nrt_atomic_cas(i64* nocapture %.1, i64 %.2, i64 %.3, i64* nocapture %.4) local_unnamed_addr #0 {
.6:
%.7 = cmpxchg i64* %.1, i64 %.2, i64 %.3 monotonic monotonic
%.8 = extractvalue { i64, i1 } %.7, 0
%.9 = extractvalue { i64, i1 } %.7, 1
store i64 %.8, i64* %.4, align 8
%.11 = zext i1 %.9 to i32
ret i32 %.11
}
; Function Attrs: norecurse nounwind readonly
define i8* @NRT_MemInfo_data_fast(i8* nocapture readonly %.1) local_unnamed_addr #1 {
.3:
%.5 = getelementptr i8, i8* %.1, i64 24
%0 = bitcast i8* %.5 to i8**
%.6 = load i8*, i8** %0, align 8
ret i8* %.6
}
; Function Attrs: noinline norecurse nounwind
define void @NRT_incref(i8* %.1) local_unnamed_addr #2 {
.3:
%.4 = icmp eq i8* %.1, null
br i1 %.4, label %.3.if, label %.3.endif, !prof !0
.3.if: ; preds = %.3
ret void
.3.endif: ; preds = %.3
%.7 = bitcast i8* %.1 to i64*
%.4.i = atomicrmw add i64* %.7, i64 1 monotonic
ret void
}
; Function Attrs: noinline
define void @NRT_decref(i8* %.1) local_unnamed_addr #3 {
.3:
%.4 = icmp eq i8* %.1, null
br i1 %.4, label %.3.if, label %.3.endif, !prof !0
.3.if: ; preds = %.3.endif.if, %.3.endif, %.3
ret void
.3.endif: ; preds = %.3
fence release
%.8 = bitcast i8* %.1 to i64*
%.4.i = atomicrmw sub i64* %.8, i64 1 monotonic
%.10 = icmp eq i64 %.4.i, 1
br i1 %.10, label %.3.endif.if, label %.3.if, !prof !0
.3.endif.if: ; preds = %.3.endif
fence acquire
tail call void @NRT_MemInfo_call_dtor(i8* nonnull %.1)
br label %.3.if
}
declare void @NRT_MemInfo_call_dtor(i8*) local_unnamed_addr
; Function Attrs: norecurse nounwind
define i32 @nrt_unresolved_abort(i8** nocapture readnone %.1, { i8*, i32 }** nocapture %.2) local_unnamed_addr #0 {
.4:
store { i8*, i32 }* @.const.picklebuf.4556225032, { i8*, i32 }** %.2, align 8
ret i32 1
}
attributes #0 = { norecurse nounwind }
attributes #1 = { norecurse nounwind readonly }
attributes #2 = { noinline norecurse nounwind }
attributes #3 = { noinline }
!0 = !{!"branch_weights", i32 1, i32 99}
mi %".24" = call i8* @"NRT_MemInfo_alloc_safe"(i64 %".23")
calculated %".28" = getelementptr i8, i8* %".24", i32 40
BEFORE!
; ModuleID = 'something$1'
source_filename = "<string>"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin17.7.0"
@"_ZN08NumbaEnv8__main__13something$241E" = common global i8* null
define i32 @"_ZN8__main__13something$241E"(i32* noalias nocapture %retptr, { i8*, i32 }** noalias nocapture %excinfo) {
entry:
%.24 = call i8* @NRT_MemInfo_alloc_safe(i64 24)
call void @print_pointer(i8* %.24)
%.26 = call i8* @NRT_MemInfo_data_fast(i8* %.24)
call void @print_pointer(i8* %.26)
%.28 = getelementptr i8, i8* %.24, i32 40
call void @print_pointer(i8* %.28)
call void @NRT_decref(i8* inttoptr (i64 -40 to i8*))
%.40 = getelementptr inbounds i8, i8* %.28, i32 -40
call void @NRT_incref(i8* %.40)
call void @NRT_decref(i8* inttoptr (i64 -40 to i8*))
call void @NRT_decref(i8* %.40)
call void @NRT_incref(i8* %.40)
call void @NRT_decref(i8* inttoptr (i64 -40 to i8*))
%.70 = call i32* @get_ndt_context_t_err(i8* %.28)
store i32 0, i32* %.70
call void @NRT_decref(i8* %.40)
call void @NRT_incref(i8* %.40)
call void @NRT_decref(i8* inttoptr (i64 -40 to i8*))
call void @NRT_decref(i8* %.40)
%.103 = call i32* @get_ndt_context_t_err(i8* %.28)
%.104 = load i32, i32* %.103
call void @NRT_decref(i8* %.40)
store i32 %.104, i32* %retptr
ret i32 0
}
declare noalias i8* @NRT_MemInfo_alloc_safe(i64)
declare void @print_pointer(i8*)
declare i8* @NRT_MemInfo_data_fast(i8*)
declare void @NRT_decref(i8* noalias nocapture)
declare void @NRT_incref(i8* noalias nocapture)
declare i32* @get_ndt_context_t_err(i8*)
AFTER
; ModuleID = 'something$1'
source_filename = "<string>"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin17.7.0"
@"_ZN08NumbaEnv8__main__13something$241E" = common global i8* null
define i32 @"_ZN8__main__13something$241E"(i32* noalias nocapture %retptr, { i8*, i32 }** noalias nocapture %excinfo) {
entry:
%.24 = call i8* @NRT_MemInfo_alloc_safe(i64 24)
call void @print_pointer(i8* %.24)
%.26 = call i8* @NRT_MemInfo_data_fast(i8* %.24)
call void @print_pointer(i8* %.26)
%.28 = getelementptr i8, i8* %.24, i32 40
call void @print_pointer(i8* %.28)
%.40 = getelementptr inbounds i8, i8* %.28, i32 -40
%.70 = call i32* @get_ndt_context_t_err(i8* %.28)
store i32 0, i32* %.70
%.103 = call i32* @get_ndt_context_t_err(i8* %.28)
%.104 = load i32, i32* %.103
call void @NRT_decref(i8* inttoptr (i64 -40 to i8*))
call void @NRT_decref(i8* inttoptr (i64 -40 to i8*))
call void @NRT_decref(i8* inttoptr (i64 -40 to i8*))
call void @NRT_decref(i8* inttoptr (i64 -40 to i8*))
call void @NRT_decref(i8* %.40)
store i32 %.104, i32* %retptr
ret i32 0
}
declare noalias i8* @NRT_MemInfo_alloc_safe(i64)
declare void @print_pointer(i8*)
declare i8* @NRT_MemInfo_data_fast(i8*)
declare void @NRT_decref(i8* noalias nocapture)
declare void @NRT_incref(i8* noalias nocapture)
declare i32* @get_ndt_context_t_err(i8*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment