diff options
| author | Steven Wu <stevenwu@apple.com> | 2014-12-12 17:21:54 +0000 |
|---|---|---|
| committer | Steven Wu <stevenwu@apple.com> | 2014-12-12 17:21:54 +0000 |
| commit | 1f7402a14ef90c5dad38483fad33a13fa2218937 (patch) | |
| tree | b7c0aa162717a1e220ef72d4560e5ee30d368e56 /llvm/lib/Transforms | |
| parent | 37c3ad6c20c77f23445832e1c1753248e269d483 (diff) | |
| download | bcm5719-llvm-1f7402a14ef90c5dad38483fad33a13fa2218937.tar.gz bcm5719-llvm-1f7402a14ef90c5dad38483fad33a13fa2218937.zip | |
Restructure code from r224097. NFC
llvm-svn: 224133
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp index 357bf24ebe2..48f5ce8a295 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -1269,19 +1269,19 @@ 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 (LHSWidth < SrcWidth) - LHSOrig = Builder->CreateFPExt(LHSOrig, RHSOrig->getType()); - else if (RHSWidth <= SrcWidth) - RHSOrig = Builder->CreateFPExt(RHSOrig, LHSOrig->getType()); - if (LHSOrig != OpI->getOperand(0) || RHSOrig != OpI->getOperand(1)) { - Value *ExactResult = Builder->CreateFRem(LHSOrig, RHSOrig); - if (Instruction *RI = dyn_cast<Instruction>(ExactResult)) - RI->copyFastMathFlags(OpI); - return CastInst::CreateFPCast(ExactResult, CI.getType()); - } + if (SrcWidth == OpWidth) { + break; + } + if (LHSWidth < SrcWidth) + LHSOrig = Builder->CreateFPExt(LHSOrig, RHSOrig->getType()); + else if (RHSWidth <= SrcWidth) + RHSOrig = Builder->CreateFPExt(RHSOrig, LHSOrig->getType()); + if (LHSOrig != OpI->getOperand(0) || RHSOrig != OpI->getOperand(1)) { + Value *ExactResult = Builder->CreateFRem(LHSOrig, RHSOrig); + if (Instruction *RI = dyn_cast<Instruction>(ExactResult)) + RI->copyFastMathFlags(OpI); + return CastInst::CreateFPCast(ExactResult, CI.getType()); } - break; } // (fptrunc (fneg x)) -> (fneg (fptrunc x)) |

