If the call inst is a bitcast value, call->getCalledFunction() will return NULL. Use the call->getCalledValue()->stripPointerCasts()->getName() to check.
Signed-off-by: Yang Rong <rong.r.y...@intel.com> --- backend/src/llvm/llvm_bitcode_link.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/llvm/llvm_bitcode_link.cpp b/backend/src/llvm/llvm_bitcode_link.cpp index a3f9886..0b01929 100644 --- a/backend/src/llvm/llvm_bitcode_link.cpp +++ b/backend/src/llvm/llvm_bitcode_link.cpp @@ -86,11 +86,11 @@ namespace gbe } llvm::Function * callFunc = call->getCalledFunction(); - if(!callFunc) { - continue; - } + //if(!callFunc) { + // continue; + //} - if (callFunc->getIntrinsicID() != 0) + if (callFunc && callFunc->getIntrinsicID() != 0) continue; std::string fnName = call->getCalledValue()->stripPointerCasts()->getName(); -- 2.1.4 _______________________________________________ Beignet mailing list Beignet@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/beignet