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

Submitted by Yang, Rong R on Nov. 28, 2016, 11:32 a.m.

Details

Message ID 1480332765-3271-3-git-send-email-rong.r.yang@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 2 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Yang, Rong R Nov. 28, 2016, 11:32 a.m.
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@intel.com>
---
 backend/src/llvm/llvm_bitcode_link.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

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();