Skip to content

Commit 37ecd43

Browse files
committed
[ExecutionEngine] Remove handling for removed ConstantExprs (NFCI)
These constant expressions no longer exist, so don't handle them.
1 parent 23427b8 commit 37ecd43

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

llvm/lib/ExecutionEngine/Interpreter/Execution.cpp

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,22 +2019,6 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
20192019
switch (CE->getOpcode()) {
20202020
case Instruction::Trunc:
20212021
return executeTruncInst(CE->getOperand(0), CE->getType(), SF);
2022-
case Instruction::ZExt:
2023-
return executeZExtInst(CE->getOperand(0), CE->getType(), SF);
2024-
case Instruction::SExt:
2025-
return executeSExtInst(CE->getOperand(0), CE->getType(), SF);
2026-
case Instruction::FPTrunc:
2027-
return executeFPTruncInst(CE->getOperand(0), CE->getType(), SF);
2028-
case Instruction::FPExt:
2029-
return executeFPExtInst(CE->getOperand(0), CE->getType(), SF);
2030-
case Instruction::UIToFP:
2031-
return executeUIToFPInst(CE->getOperand(0), CE->getType(), SF);
2032-
case Instruction::SIToFP:
2033-
return executeSIToFPInst(CE->getOperand(0), CE->getType(), SF);
2034-
case Instruction::FPToUI:
2035-
return executeFPToUIInst(CE->getOperand(0), CE->getType(), SF);
2036-
case Instruction::FPToSI:
2037-
return executeFPToSIInst(CE->getOperand(0), CE->getType(), SF);
20382022
case Instruction::PtrToInt:
20392023
return executePtrToIntInst(CE->getOperand(0), CE->getType(), SF);
20402024
case Instruction::IntToPtr:
@@ -2050,12 +2034,7 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
20502034
getOperandValue(CE->getOperand(0), SF),
20512035
getOperandValue(CE->getOperand(1), SF),
20522036
CE->getOperand(0)->getType());
2053-
case Instruction::Select:
2054-
return executeSelectInst(getOperandValue(CE->getOperand(0), SF),
2055-
getOperandValue(CE->getOperand(1), SF),
2056-
getOperandValue(CE->getOperand(2), SF),
2057-
CE->getOperand(0)->getType());
2058-
default :
2037+
default:
20592038
break;
20602039
}
20612040

@@ -2064,32 +2043,14 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
20642043
GenericValue Op0 = getOperandValue(CE->getOperand(0), SF);
20652044
GenericValue Op1 = getOperandValue(CE->getOperand(1), SF);
20662045
GenericValue Dest;
2067-
Type * Ty = CE->getOperand(0)->getType();
20682046
switch (CE->getOpcode()) {
20692047
case Instruction::Add: Dest.IntVal = Op0.IntVal + Op1.IntVal; break;
20702048
case Instruction::Sub: Dest.IntVal = Op0.IntVal - Op1.IntVal; break;
20712049
case Instruction::Mul: Dest.IntVal = Op0.IntVal * Op1.IntVal; break;
2072-
case Instruction::FAdd: executeFAddInst(Dest, Op0, Op1, Ty); break;
2073-
case Instruction::FSub: executeFSubInst(Dest, Op0, Op1, Ty); break;
2074-
case Instruction::FMul: executeFMulInst(Dest, Op0, Op1, Ty); break;
2075-
case Instruction::FDiv: executeFDivInst(Dest, Op0, Op1, Ty); break;
2076-
case Instruction::FRem: executeFRemInst(Dest, Op0, Op1, Ty); break;
2077-
case Instruction::SDiv: Dest.IntVal = Op0.IntVal.sdiv(Op1.IntVal); break;
2078-
case Instruction::UDiv: Dest.IntVal = Op0.IntVal.udiv(Op1.IntVal); break;
2079-
case Instruction::URem: Dest.IntVal = Op0.IntVal.urem(Op1.IntVal); break;
2080-
case Instruction::SRem: Dest.IntVal = Op0.IntVal.srem(Op1.IntVal); break;
2081-
case Instruction::And: Dest.IntVal = Op0.IntVal & Op1.IntVal; break;
2082-
case Instruction::Or: Dest.IntVal = Op0.IntVal | Op1.IntVal; break;
20832050
case Instruction::Xor: Dest.IntVal = Op0.IntVal ^ Op1.IntVal; break;
20842051
case Instruction::Shl:
20852052
Dest.IntVal = Op0.IntVal.shl(Op1.IntVal.getZExtValue());
20862053
break;
2087-
case Instruction::LShr:
2088-
Dest.IntVal = Op0.IntVal.lshr(Op1.IntVal.getZExtValue());
2089-
break;
2090-
case Instruction::AShr:
2091-
Dest.IntVal = Op0.IntVal.ashr(Op1.IntVal.getZExtValue());
2092-
break;
20932054
default:
20942055
dbgs() << "Unhandled ConstantExpr: " << *CE << "\n";
20952056
llvm_unreachable("Unhandled ConstantExpr");

0 commit comments

Comments
 (0)