Situations can arise when you have a function called that returns a 'void', but
is bitcast to return a floating point value. The result of the instruction may
not be used by the program afterwards, and LLVM will happily remove all
instructions except the call. But, on some platforms, if a value is returned as
a floating point, it may need to be removed from the stack (like x87). Thus, we
can't get rid of the bitcast even if there isn't a use of the value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51134 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 0662055..bb4b701 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -8940,7 +8940,7 @@
// Check to see if we are changing the return type...
if (OldRetTy != FT->getReturnType()) {
- if (Callee->isDeclaration() && !Caller->use_empty() &&
+ if (Callee->isDeclaration() &&
// Conversion is ok if changing from pointer to int of same size.
!(isa<PointerType>(FT->getReturnType()) &&
TD->getIntPtrType() == OldRetTy))
@@ -11516,7 +11516,7 @@
// Iterate while there is work to do.
unsigned Iteration = 0;
- while (DoOneIteration(F, Iteration++))
+ while (DoOneIteration(F, Iteration++))
EverMadeChange = true;
return EverMadeChange;
}