| 1962 | } |
| 1963 | |
| 1964 | static llvm::Function* GetLenOptimizedHashFn( |
| 1965 | LlvmCodeGen* codegen, IRFunction::Type f, int len) { |
| 1966 | llvm::Function* fn = codegen->GetFunction(f, false); |
| 1967 | DCHECK(fn != NULL); |
| 1968 | if (len != -1) { |
| 1969 | // Clone this function since we're going to modify it by replacing the |
| 1970 | // length with num_bytes. |
| 1971 | fn = codegen->CloneFunction(fn); |
| 1972 | llvm::Value* len_arg = codegen->GetArgument(fn, 1); |
| 1973 | len_arg->replaceAllUsesWith(codegen->GetI32Constant(len)); |
| 1974 | } |
| 1975 | return codegen->FinalizeFunction(fn); |
| 1976 | } |
| 1977 | |
| 1978 | llvm::Function* LlvmCodeGen::GetMurmurHashFunction(int len) { |
| 1979 | return GetLenOptimizedHashFn(this, IRFunction::HASH_MURMUR, len); |
no test coverage detected