Only create ispc-callable functions for bitcode functions that start with "__"

Don't create ispc-callable symbols for other functions that we find in the LLVM
bitcode files that are loaded up and linked into the module so that they can be 
called from ispc stdlib functions.  This fixes an issue where we had a clash
between the declared versions of double sin(double) and the corresponding
ispc stdlib routines for uniform doubles, which in turn led to bogus code
being generated for calls to those ispc stdlib functions.
This commit is contained in:
Matt Pharr
2011-07-18 13:03:50 +01:00
parent 6b0a6c0124
commit 65a29ec316

View File

@@ -151,6 +151,9 @@ lCreateISPCSymbol(llvm::Function *func, SymbolTable *symbolTable) {
const llvm::FunctionType *ftype = func->getFunctionType();
std::string name = func->getName();
if (name.size() < 3 || name[0] != '_' || name[1] != '_')
return false;
// An unfortunate hack: we want this builtin function to have the
// signature "int __sext_varying_bool(bool)", but the ispc function
// symbol creation code below assumes that any LLVM vector of i32s is a