[Beignet] [PATCH 03/19] GBE: don't use call->getCalledFunction() to decide the materialize function.

Yang Rong rong.r.yang at intel.com
Mon Nov 28 11:32:29 UTC 2016


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.yang at 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



More information about the Beignet mailing list