Skip to content

Instantly share code, notes, and snippets.

@riccardomurri
Last active December 24, 2015 07:19
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 riccardomurri/6763235 to your computer and use it in GitHub Desktop.
Save riccardomurri/6763235 to your computer and use it in GitHub Desktop.
Full error trace leading up to Numba's "NotImplementedError: Unable to cast from { i64, i8* }* to { i64, i8* }"
DEBUG -- translate:361:translate
; ModuleID = 'tmp.module.fatghol.simplematrix.__new__.25311b8'
@PyArray_API = linkonce_odr global i8** inttoptr (i64 46912560938432 to i8**)
define { i64, i8* }* @__numba_specialized_0_fatghol_2E_simplematrix_2E___new__({ i64, i8* }* %cls, i32 %rows, i32 %columns) {
entry:
%objtemp3 = alloca { i64, i8* }*
store { i64, i8* }* null, { i64, i8* }** %objtemp3, !tbaa !2
%objtemp2 = alloca { i64, i8* }*
store { i64, i8* }* null, { i64, i8* }** %objtemp2, !tbaa !2
%objtemp = alloca { i64, i8* }*
store { i64, i8* }* null, { i64, i8* }** %objtemp, !tbaa !2
%cls1 = alloca { i64, i8* }*
store { i64, i8* }* %cls, { i64, i8* }** %cls1
call void @Py_INCREF({ i64, i8* }* %cls)
%return_value = alloca { i64, i8* }*
%0 = call { i64, i8* }* (i64, ...)* @PyTuple_Pack(i64 1, { i64, i8* }* %cls)
store { i64, i8* }* %0, { i64, i8* }** %objtemp2, !tbaa !2
%1 = ptrtoint { i64, i8* }* %0 to i64
%2 = icmp eq i64 %1, 0
br i1 %2, label %error_label, label %"no_error_12:24"
cleanup_label: ; preds = %"no_error_12:244", %error_label
%3 = load { i64, i8* }** %objtemp2, !tbaa !2
call void @Py_XDECREF({ i64, i8* }* %3)
%4 = load { i64, i8* }** %objtemp3, !tbaa !2
call void @Py_XDECREF({ i64, i8* }* %4)
%5 = load { i64, i8* }** %objtemp, !tbaa !2
call void @Py_XDECREF({ i64, i8* }* %5)
%6 = load { i64, i8* }** %cls1, !tbaa !2
call void @Py_XDECREF({ i64, i8* }* %6)
%7 = load { i64, i8* }** %return_value
ret { i64, i8* }* %7
error_label: ; preds = %"no_error_12:11", %"no_error_12:24", %entry
store { i64, i8* }* null, { i64, i8* }** %return_value
%8 = load { i64, i8* }** %return_value, !tbaa !2
call void @Py_XINCREF({ i64, i8* }* %8)
br label %cleanup_label
"no_error_12:24": ; preds = %entry
%9 = load { i64, i8* }** %objtemp2, !tbaa !2
%10 = call { i64, i8* }* @PyObject_GetAttrString({ i64, i8* }* inttoptr (i64 7838848 to { i64, i8* }*), i8* getelementptr inbounds ([8 x i8]* @__STR_0, i32 0, i32 0))
store { i64, i8* }* %10, { i64, i8* }** %objtemp3, !tbaa !2
%11 = ptrtoint { i64, i8* }* %10 to i64
%12 = icmp eq i64 %11, 0
br i1 %12, label %error_label, label %"no_error_12:11"
"no_error_12:11": ; preds = %"no_error_12:24"
%13 = load { i64, i8* }** %objtemp3, !tbaa !2
%14 = call { i64, i8* }* @PyObject_Call({ i64, i8* }* %13, { i64, i8* }* %9, { i64, i8* }* null)
store { i64, i8* }* %14, { i64, i8* }** %objtemp, !tbaa !2
%15 = ptrtoint { i64, i8* }* %14 to i64
%16 = icmp eq i64 %15, 0
br i1 %16, label %error_label, label %"no_error_12:244"
"no_error_12:244": ; preds = %"no_error_12:11"
%17 = load { i64, i8* }** %objtemp, !tbaa !2
store { i64, i8* }* %17, { i64, i8* }** %return_value
%18 = load { i64, i8* }** %return_value, !tbaa !2
call void @Py_XINCREF({ i64, i8* }* %18)
br label %cleanup_label
}
declare { i64, i8* }* @PyObject_GetAttrString({ i64, i8* }*, i8*)
declare { i64, i8* }* @PyTuple_Pack(i64, ...)
declare { i64, i8* }* @Py_BuildValue(i8*, ...)
declare i32 @PyArg_ParseTuple({ i64, i8* }*, i8*, ...)
declare void @PyErr_Clear()
declare void @Py_INCREF({ i64, i8* }*)
declare void @Py_XINCREF({ i64, i8* }*)
declare void @Py_XDECREF({ i64, i8* }*)
declare { i64, i8* }* @PyObject_Call({ i64, i8* }*, { i64, i8* }*, { i64, i8* }*)
!tbaa = !{!0, !1, !2}
!0 = metadata !{metadata !"root"}
!1 = metadata !{metadata !"char *", metadata !0}
!2 = metadata !{metadata !"object", metadata !1}
DEBUG -- translate:361:translate
; ModuleID = 'numba_executable_module'
@PyArray_API = linkonce_odr global i8** inttoptr (i64 46912560938432 to i8**)
define void @Py_INCREF({ i64, i8* }* %obj) {
decl:
%obj1 = alloca { i64, i8* }*
store { i64, i8* }* %obj, { i64, i8* }** %obj1
%0 = bitcast { i64, i8* }* %obj to i64*
%1 = load i64* %0
%2 = add i64 %1, 1
store i64 %2, i64* %0
ret void
}
define void @Py_DECREF({ i64, i8* }* %obj) {
decl:
%obj1 = alloca { i64, i8* }*
store { i64, i8* }* %obj, { i64, i8* }** %obj1
%0 = bitcast { i64, i8* }* %obj to i64*
%1 = load i64* %0
%2 = icmp sgt i64 %1, 1
br i1 %2, label %if.then, label %if.else
if.then: ; preds = %decl
%3 = bitcast { i64, i8* }* %obj to i64*
%4 = add i64 %1, -1
store i64 %4, i64* %3
br label %if.end
if.else: ; preds = %decl
call void @Py_DecRef({ i64, i8* }* %obj)
br label %if.end
if.end: ; preds = %if.else, %if.then
ret void
}
declare void @Py_DecRef({ i64, i8* }*)
define void @Py_XINCREF({ i64, i8* }* %obj) {
decl:
%obj1 = alloca { i64, i8* }*
store { i64, i8* }* %obj, { i64, i8* }** %obj1
%0 = ptrtoint { i64, i8* }* %obj to i64
%1 = icmp ne i64 %0, 0
br i1 %1, label %if.then, label %if.end
if.then: ; preds = %decl
%2 = bitcast { i64, i8* }* %obj to i64*
%3 = load i64* %2
%4 = add i64 %3, 1
store i64 %4, i64* %2
br label %if.end
if.end: ; preds = %if.then, %decl
ret void
}
define void @Py_XDECREF({ i64, i8* }* %obj) {
decl:
%obj1 = alloca { i64, i8* }*
store { i64, i8* }* %obj, { i64, i8* }** %obj1
%0 = ptrtoint { i64, i8* }* %obj to i64
%1 = icmp ne i64 %0, 0
br i1 %1, label %if.then, label %if.end
if.then: ; preds = %decl
call void @Py_DECREF({ i64, i8* }* %obj)
br label %if.end
if.end: ; preds = %if.then, %decl
ret void
}
define i8* @IndexAxis(i8* %data, i64* %in_shape, i64* %in_strides, i64 %src_dim, i64 %index) {
decl:
%data1 = alloca i8*
%in_shape2 = alloca i64*
%in_strides3 = alloca i64*
%src_dim4 = alloca i64
%index5 = alloca i64
%result = alloca i8*
store i8* %data, i8** %data1
store i64* %in_shape, i64** %in_shape2
store i64* %in_strides, i64** %in_strides3
store i64 %src_dim, i64* %src_dim4
store i64 %index, i64* %index5
%0 = load i64** %in_strides3
%1 = load i64* %src_dim4
%2 = getelementptr inbounds i64* %0, i64 %1
%3 = load i64* %2
%4 = mul i64 %3, %index
%5 = load i8** %data1
%6 = getelementptr inbounds i8* %5, i64 %4
store i8* %6, i8** %result
ret i8* %6
}
define void @NewAxis(i64* %out_shape, i64* %out_strides, i32 %dst_dim) {
decl:
%out_shape1 = alloca i64*
%out_strides2 = alloca i64*
%dst_dim3 = alloca i32
store i64* %out_shape, i64** %out_shape1
store i64* %out_strides, i64** %out_strides2
store i32 %dst_dim, i32* %dst_dim3
%0 = load i64** %out_shape1
%1 = getelementptr inbounds i64* %0, i32 %dst_dim
store i64 1, i64* %1
%2 = load i64** %out_strides2
%3 = load i32* %dst_dim3
%4 = getelementptr inbounds i64* %2, i32 %3
store i64 0, i64* %4
ret void
}
define i32 @Broadcast(i64* %dst_shape, i64* %src_shape, i64* %src_strides, i32 %max_ndim, i32 %ndim) {
decl:
%dst_shape1 = alloca i64*
%src_shape2 = alloca i64*
%src_strides3 = alloca i64*
%max_ndim4 = alloca i32
%ndim5 = alloca i32
%0 = alloca i32
store i64* %dst_shape, i64** %dst_shape1
store i64* %src_shape, i64** %src_shape2
store i64* %src_strides, i64** %src_strides3
store i32 %max_ndim, i32* %max_ndim4
store i32 %ndim, i32* %ndim5
%1 = load i32* %max_ndim4
%2 = sub i32 %1, %ndim
store i32 0, i32* %0
br label %loop.cond
loop.cond: ; preds = %if.end11, %decl
%3 = load i32* %0
%4 = load i32* %ndim5
%5 = icmp slt i32 %3, %4
br i1 %5, label %loop.body, label %loop.end
loop.body: ; preds = %loop.cond
%6 = load i64** %src_shape2
%7 = getelementptr inbounds i64* %6, i32 %3
%8 = add i32 %3, %2
%9 = load i64** %dst_shape1
%10 = getelementptr inbounds i64* %9, i32 %8
%11 = load i64* %7
%12 = icmp eq i64 %11, 1
br i1 %12, label %if.then, label %if.else
loop.end: ; preds = %if.else7, %loop.cond
%merge = phi i32 [ 1, %loop.cond ], [ 0, %if.else7 ]
ret i32 %merge
if.then: ; preds = %loop.body
%13 = load i64** %src_strides3
%14 = getelementptr inbounds i64* %13, i32 %3
store i64 0, i64* %14
br label %if.end11
if.else: ; preds = %loop.body
%15 = load i64* %10
%16 = icmp eq i64 %15, 1
br i1 %16, label %if.then6, label %if.else7
if.then6: ; preds = %if.else
store i64 %11, i64* %10
br label %if.end11
if.else7: ; preds = %if.else
%17 = icmp ne i64 %11, %15
br i1 %17, label %loop.end, label %if.end11
if.end11: ; preds = %if.else7, %if.then6, %if.then
%18 = load i32* %0
%19 = add i32 %18, 1
store i32 %19, i32* %0
br label %loop.cond
}
define { i64, i8* }* @__numba_specialized_0_fatghol_2E_simplematrix_2E___new__({ i64, i8* }* %cls, i32 %rows, i32 %columns) {
entry:
tail call void @Py_INCREF({ i64, i8* }* %cls)
%0 = tail call { i64, i8* }* (i64, ...)* @PyTuple_Pack(i64 1, { i64, i8* }* %cls)
%1 = icmp eq { i64, i8* }* %0, null
br i1 %1, label %error_label, label %"no_error_12:24"
cleanup_label: ; preds = %"no_error_12:244", %error_label
%objtemp3.0.load711 = phi { i64, i8* }* [ %2, %"no_error_12:244" ], [ %objtemp3.0.load712, %error_label ]
%objtemp.0.load59 = phi { i64, i8* }* [ %4, %"no_error_12:244" ], [ null, %error_label ]
tail call void @Py_XDECREF({ i64, i8* }* %0)
tail call void @Py_XDECREF({ i64, i8* }* %objtemp3.0.load711)
tail call void @Py_XDECREF({ i64, i8* }* %objtemp.0.load59)
tail call void @Py_XDECREF({ i64, i8* }* %cls)
ret { i64, i8* }* %objtemp.0.load59
error_label: ; preds = %"no_error_12:11", %"no_error_12:24", %entry
%objtemp3.0.load712 = phi { i64, i8* }* [ %2, %"no_error_12:11" ], [ null, %"no_error_12:24" ], [ null, %entry ]
tail call void @Py_XINCREF({ i64, i8* }* null)
br label %cleanup_label
"no_error_12:24": ; preds = %entry
%2 = tail call { i64, i8* }* @PyObject_GetAttrString({ i64, i8* }* inttoptr (i64 7838848 to { i64, i8* }*), i8* getelementptr inbounds ([8 x i8]* @__STR_0, i64 0, i64 0))
%3 = icmp eq { i64, i8* }* %2, null
br i1 %3, label %error_label, label %"no_error_12:11"
"no_error_12:11": ; preds = %"no_error_12:24"
%4 = tail call { i64, i8* }* @PyObject_Call({ i64, i8* }* %2, { i64, i8* }* %0, { i64, i8* }* null)
%5 = icmp eq { i64, i8* }* %4, null
br i1 %5, label %error_label, label %"no_error_12:244"
"no_error_12:244": ; preds = %"no_error_12:11"
tail call void @Py_XINCREF({ i64, i8* }* %4)
br label %cleanup_label
}
declare { i64, i8* }* @PyObject_GetAttrString({ i64, i8* }*, i8*)
declare { i64, i8* }* @PyTuple_Pack(i64, ...)
declare { i64, i8* }* @PyObject_Call({ i64, i8* }*, { i64, i8* }*, { i64, i8* }*)
define { i64, i8* }* @__numba_specialized_1_numba_2E_codegen_2E_llvmwrapper_2E___numba_wrapper___new__(i8* %self, { i64, i8* }* %args) {
entry:
%objtemp = alloca { i64, i8* }*
store { i64, i8* }* null, { i64, i8* }** %objtemp, !tbaa !2
%0 = alloca { i64, i8* }*
%1 = alloca { i64, i8* }*
%2 = alloca { i64, i8* }*
%return_value = alloca { i64, i8* }*
%3 = call i32 ({ i64, i8* }*, i8*, ...)* @PyArg_ParseTuple({ i64, i8* }* %args, i8* getelementptr inbounds ([4 x i8]* @__STR_1, i32 0, i32 0), { i64, i8* }** %2, { i64, i8* }** %1, { i64, i8* }** %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %cleanup.if.true, label %cleanup.if.end
cleanup_label: ; preds = %no_error, %error_label
%5 = load { i64, i8* }** %objtemp, !tbaa !2
call void @Py_XDECREF({ i64, i8* }* %5)
%6 = load { i64, i8* }** %return_value
ret { i64, i8* }* %6
error_label: ; preds = %empty4, %empty5, %empty2, %cleanup.if.true
store { i64, i8* }* null, { i64, i8* }** %return_value
%7 = load { i64, i8* }** %return_value, !tbaa !2
call void @Py_XINCREF({ i64, i8* }* %7)
br label %cleanup_label
cleanup.if.true: ; preds = %entry
br label %error_label
cleanup.if.end: ; preds = %entry
%8 = load { i64, i8* }** %2
%9 = load { i64, i8* }** %1
%10 = load { i64, i8* }** %0
%11 = call i32 inttoptr (i64 46912635326649 to i32 ({ i64, i8* }*)*)({ i64, i8* }* %9)
br label %empty
empty: ; preds = %cleanup.if.end
%12 = call i8* @PyErr_Occurred()
%13 = ptrtoint i8* %12 to i64
%14 = icmp ne i64 %13, 0
br i1 %14, label %empty2, label %empty1
empty1: ; preds = %empty
%15 = call i32 inttoptr (i64 46912635326649 to i32 ({ i64, i8* }*)*)({ i64, i8* }* %10)
br label %empty3
empty2: ; preds = %empty
br label %error_label
empty3: ; preds = %empty1
%16 = call i8* @PyErr_Occurred()
%17 = ptrtoint i8* %16 to i64
%18 = icmp ne i64 %17, 0
br i1 %18, label %empty5, label %empty4
empty4: ; preds = %empty3
%19 = call { i64, i8* }* @__numba_specialized_0_fatghol_2E_simplematrix_2E___new__({ i64, i8* }* %8, i32 %11, i32 %15)
store { i64, i8* }* %19, { i64, i8* }** %objtemp, !tbaa !2
%20 = ptrtoint { i64, i8* }* %19 to i64
%21 = icmp eq i64 %20, 0
br i1 %21, label %error_label, label %no_error
empty5: ; preds = %empty3
br label %error_label
no_error: ; preds = %empty4
%22 = load { i64, i8* }** %objtemp, !tbaa !2
store { i64, i8* }* %22, { i64, i8* }** %return_value
%23 = load { i64, i8* }** %return_value, !tbaa !2
call void @Py_XINCREF({ i64, i8* }* %23)
br label %cleanup_label
}
declare i8* @PyErr_Occurred()
declare { i64, i8* }* @Py_BuildValue(i8*, ...)
declare i32 @PyArg_ParseTuple({ i64, i8* }*, i8*, ...)
declare void @PyErr_Clear()
!tbaa = !{!0, !1, !2, !0, !1, !2}
!0 = metadata !{metadata !"root"}
!1 = metadata !{metadata !"char *", metadata !0}
!2 = metadata !{metadata !"object", metadata !1}
--------------------- Numba Encountered Errors or Warnings ---------------------
def __new__(cls, rows, columns):
-----------------^
Warning 11:17: Unused argument 'rows'
def __new__(cls, rows, columns):
-----------------------^
Warning 11:23: Unused argument 'columns'
--------------------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user/rmurri/euroscipy2013/fatghol.numba/fatghol/mgn.py", line 57, in <module>
from fatghol.graph_homology import FatgraphComplex, NumberedFatgraphPool
File "/home/user/rmurri/euroscipy2013/fatghol.numba/fatghol/graph_homology.py", line 48, in <module>
from fatghol.homology import (
File "/home/user/rmurri/euroscipy2013/fatghol.numba/fatghol/homology.py", line 44, in <module>
NullMatrix = SimpleMatrix(0,0)
File "numbawrapper.pyx", line 288, in numba.numbawrapper.BoundSpecializingWrapper.__call__ (numba/numbawrapper.c:5041)
File "numbawrapper.pyx", line 190, in numba.numbawrapper._NumbaSpecializingWrapper.__call__ (numba/numbawrapper.c:3726)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/wrapping/compiler.py", line 69, in compile_from_args
return self.compile(signature)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/wrapping/compiler.py", line 88, in compile
compiled_function = dec(self.py_func)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/decorators.py", line 224, in _jit_decorator
nopython=nopython, func_ast=func_ast, **kwargs)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/decorators.py", line 133, in compile_function
func_env = pipeline.compile2(env, func, restype, argtypes, func_ast=func_ast, **kwds)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/pipeline.py", line 144, in compile2
post_ast = pipeline(func_ast, env)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/pipeline.py", line 191, in __call__
ast = self.transform(ast, env)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/pipeline.py", line 656, in transform
ast = stage(ast, env)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/pipeline.py", line 641, in _stage
return _check_stage_object(stage_obj)(ast, env)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/pipeline.py", line 194, in __call__
ast = self.transform(ast, env)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/pipeline.py", line 553, in transform
func_env.translator.translate()
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/codegen/translate.py", line 342, in translate
self.visit(node)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/codegen/translate.py", line 152, in visit
result = fn(node)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/codegen/translate.py", line 590, in visit_Assign
decref=decref, incref=incref)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/codegen/translate.py", line 603, in generate_assign_stack
lvalue = self.caster.cast(lvalue, ltarget.type.pointee)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/llvm_types.py", line 91, in cast
return self.build_cast(self.builder, lvalue, dst_ltype, *args, **kws)
File "/home/user/rmurri/sw/src/numba-numba-a1f09db/lib/python2.7/site-packages/numba/llvm_types.py", line 191, in build_cast
(str(lty1), str(lty2)))
NotImplementedError: Unable to cast from { i64, i8* }* to { i64, i8* }.
Command exited with non-zero status 1
USED: wctime=30.24 cputime.usr=0.61 cputime.sys=5.86 maxmem=218736kB cs.involuntary=54 cs.voluntary=147926 majflt=0 minflt=20358
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment