When removing a store to an alloca that has only one
use, check also for the case where it has two uses,
the other being a llvm.dbg.declare. This is needed so
debug info doesn't affect codegen.
llvm-svn: 65970
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 5f9a8b5..2887bdc 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -540,8 +540,7 @@
if (I != I->getParent()->begin()) {
BasicBlock::iterator BBI = I; --BBI;
if (DbgStopPointInst *DSPI = dyn_cast<DbgStopPointInst>(BBI)) {
- DbgStopPointInst *newDSPI =
- reinterpret_cast<DbgStopPointInst*>(DSPI->clone());
+ CallInst *newDSPI = DSPI->clone();
newDSPI->insertBefore(InsertPos);
}
}