1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[InstCombine] simplify code for FP to integer casts; NFCI

FoldIToFPtoI() returns immediately if the operand is not
an opposite cast instruction, so the extra checks in the
callers are redundant.
This commit is contained in:
Sanjay Patel 2020-05-08 09:05:41 -04:00
parent bacdfe4019
commit b78314f414

View File

@ -1784,10 +1784,6 @@ Instruction *InstCombiner::FoldItoFPtoI(Instruction &FI) {
}
Instruction *InstCombiner::visitFPToUI(FPToUIInst &FI) {
Instruction *OpI = dyn_cast<Instruction>(FI.getOperand(0));
if (!OpI)
return commonCastTransforms(FI);
if (Instruction *I = FoldItoFPtoI(FI))
return I;
@ -1795,10 +1791,6 @@ Instruction *InstCombiner::visitFPToUI(FPToUIInst &FI) {
}
Instruction *InstCombiner::visitFPToSI(FPToSIInst &FI) {
Instruction *OpI = dyn_cast<Instruction>(FI.getOperand(0));
if (!OpI)
return commonCastTransforms(FI);
if (Instruction *I = FoldItoFPtoI(FI))
return I;