mirror of
https://github.com/RPCSX/llvm.git
synced 2025-05-13 19:06:05 +00:00
JIT::runFunction(): add a fast path for functions with a single argument that is a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161171 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
31ce7bf6be
commit
847a32b78f
@ -433,13 +433,18 @@ GenericValue JIT::runFunction(Function *F,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (FTy->getNumParams() == 1 &&
|
if (FTy->getParamType(0)->isIntegerTy(32)) {
|
||||||
FTy->getParamType(0)->isIntegerTy(32)) {
|
|
||||||
GenericValue rv;
|
GenericValue rv;
|
||||||
int (*PF)(int) = (int(*)(int))(intptr_t)FPtr;
|
int (*PF)(int) = (int(*)(int))(intptr_t)FPtr;
|
||||||
rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue()));
|
rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue()));
|
||||||
return rv;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user