mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-27 15:57:13 +00:00
eliminate redundant conditions from the signless types conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40927 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a099b6c7bb
commit
79e038a16d
@ -107,11 +107,10 @@ GenericValue JIT::runFunction(Function *F,
|
|||||||
|
|
||||||
// Handle some common cases first. These cases correspond to common `main'
|
// Handle some common cases first. These cases correspond to common `main'
|
||||||
// prototypes.
|
// prototypes.
|
||||||
if (RetTy == Type::Int32Ty || RetTy == Type::Int32Ty || RetTy == Type::VoidTy) {
|
if (RetTy == Type::Int32Ty || RetTy == Type::VoidTy) {
|
||||||
switch (ArgValues.size()) {
|
switch (ArgValues.size()) {
|
||||||
case 3:
|
case 3:
|
||||||
if ((FTy->getParamType(0) == Type::Int32Ty ||
|
if (FTy->getParamType(0) == Type::Int32Ty &&
|
||||||
FTy->getParamType(0) == Type::Int32Ty) &&
|
|
||||||
isa<PointerType>(FTy->getParamType(1)) &&
|
isa<PointerType>(FTy->getParamType(1)) &&
|
||||||
isa<PointerType>(FTy->getParamType(2))) {
|
isa<PointerType>(FTy->getParamType(2))) {
|
||||||
int (*PF)(int, char **, const char **) =
|
int (*PF)(int, char **, const char **) =
|
||||||
@ -126,8 +125,7 @@ GenericValue JIT::runFunction(Function *F,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if ((FTy->getParamType(0) == Type::Int32Ty ||
|
if (FTy->getParamType(0) == Type::Int32Ty &&
|
||||||
FTy->getParamType(0) == Type::Int32Ty) &&
|
|
||||||
isa<PointerType>(FTy->getParamType(1))) {
|
isa<PointerType>(FTy->getParamType(1))) {
|
||||||
int (*PF)(int, char **) = (int(*)(int, char **))(intptr_t)FPtr;
|
int (*PF)(int, char **) = (int(*)(int, char **))(intptr_t)FPtr;
|
||||||
|
|
||||||
@ -140,8 +138,7 @@ GenericValue JIT::runFunction(Function *F,
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (FTy->getNumParams() == 1 &&
|
if (FTy->getNumParams() == 1 &&
|
||||||
(FTy->getParamType(0) == Type::Int32Ty ||
|
FTy->getParamType(0) == Type::Int32Ty) {
|
||||||
FTy->getParamType(0) == Type::Int32Ty)) {
|
|
||||||
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()));
|
||||||
|
Loading…
Reference in New Issue
Block a user