Lunderberg commented on code in PR #14879: URL: https://github.com/apache/tvm/pull/14879#discussion_r1197972863
########## src/target/llvm/codegen_cpu.cc: ########## @@ -466,13 +466,14 @@ llvm::Value* CodeGenCPU::CreateCallExtern(Type ret_type, String global_symbol, llvm::FunctionType* ftype = llvm::FunctionType::get(GetLLVMType(ret_type), arg_types, false); // Check if it is available in global function table as injected function. + llvm::Function* f = module_->getFunction(MakeStringRef(global_symbol)); Review Comment: Or, alternatively, I think we could simplify it by returning `builder_->CreateCall(ftype, callee, arg_values);`. This method is available as far back as 3.7.0 ([commit link](https://github.com/llvm/llvm-project/commit/3a6a69c535066c7cadc434d693eeeb5e5886abb1)), and since TVM requires LLVM 4.0 or higher, we would avoid needing the `#if` directive altogether. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
