Restructure code from r224097. NFC
authorSteven Wu <stevenwu@apple.com>
Fri, 12 Dec 2014 17:21:54 +0000 (17:21 +0000)
committerSteven Wu <stevenwu@apple.com>
Fri, 12 Dec 2014 17:21:54 +0000 (17:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224133 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineCasts.cpp

index 357bf24ebe2ee4443916065ac37a318be601039e..48f5ce8a295d5a6eddda0c95ce83bd9e2cbcc046 100644 (file)
@@ -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))