Restructure code from r224097. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224133 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Steven Wu 2014-12-12 17:21:54 +00:00
parent 5dc8ac87f1
commit 00b3170e70

View File

@ -1269,7 +1269,9 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) {
// type of OpI doesn't enter into things at all. We simply evaluate
// in whichever source type is larger, then convert to the
// destination type.
if (SrcWidth != OpWidth) {
if (SrcWidth == OpWidth) {
break;
}
if (LHSWidth < SrcWidth)
LHSOrig = Builder->CreateFPExt(LHSOrig, RHSOrig->getType());
else if (RHSWidth <= SrcWidth)
@ -1281,8 +1283,6 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) {
return CastInst::CreateFPCast(ExactResult, CI.getType());
}
}
break;
}
// (fptrunc (fneg x)) -> (fneg (fptrunc x))
if (BinaryOperator::isFNeg(OpI)) {