PartiallyInlineLibCalls: Check sqrt result type before transforming it.
[oota-llvm.git] / lib / Transforms / Scalar / PartiallyInlineLibCalls.cpp
index 7cce89e0627e6301ded31fef9da3bf146f546ee9..5c8bed585b640c54904850d8e13f7f026daa0722 100644 (file)
@@ -108,6 +108,10 @@ bool PartiallyInlineLibCalls::optimizeSQRT(CallInst *Call,
   if (Call->onlyReadsMemory())
     return false;
 
+  // The call must have the expected result type.
+  if (!Call->getType()->isFloatingPointTy())
+    return false;
+
   // Do the following transformation:
   //
   // (before)