[llvm-commits] [llvm] r161171 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
Nuno Lopes
nunoplopes at sapo.pt
Thu Aug 2 05:09:33 PDT 2012
Author: nlopes
Date: Thu Aug 2 07:09:32 2012
New Revision: 161171
URL: http://llvm.org/viewvc/llvm-project?rev=161171&view=rev
Log:
JIT::runFunction(): add a fast path for functions with a single argument that is a pointer.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=161171&r1=161170&r2=161171&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Aug 2 07:09:32 2012
@@ -433,13 +433,18 @@
}
break;
case 1:
- if (FTy->getNumParams() == 1 &&
- FTy->getParamType(0)->isIntegerTy(32)) {
+ if (FTy->getParamType(0)->isIntegerTy(32)) {
GenericValue rv;
int (*PF)(int) = (int(*)(int))(intptr_t)FPtr;
rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue()));
return rv;
}
+ if (FTy->getParamType(0)->isPointerTy()) {
+ GenericValue rv;
+ int (*PF)(char *) = (int(*)(char *))(intptr_t)FPtr;
+ rv.IntVal = APInt(32, PF((char*)GVTOP(ArgValues[0])));
+ return rv;
+ }
break;
}
}
More information about the llvm-commits
mailing list