Don't forget to transfer implicit uses of return instruction.
[oota-llvm.git] / lib / Transforms / InstCombine / InstCombineCasts.cpp
index 46e4acde7b53ecace7fa5099eb14f751515d30c5..49a498ff5f3003aef32bf658a7ce04b28fce3724 100644 (file)
@@ -1160,6 +1160,9 @@ static Value *LookThroughFPExtensions(Value *V) {
   if (ConstantFP *CFP = dyn_cast<ConstantFP>(V)) {
     if (CFP->getType() == Type::getPPC_FP128Ty(V->getContext()))
       return V;  // No constant folding of this.
+    // See if the value can be truncated to half and then reextended.
+    if (Value *V = FitsInFPType(CFP, APFloat::IEEEhalf))
+      return V;
     // See if the value can be truncated to float and then reextended.
     if (Value *V = FitsInFPType(CFP, APFloat::IEEEsingle))
       return V;