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
This commit is contained in:
Dale Johannesen
2009-03-03 21:26:39 +00:00
parent 27ed6f6766
commit 77456b7ab4
3 changed files with 157 additions and 12 deletions

View File

@@ -540,8 +540,7 @@ void llvm::CopyPrecedingStopPoint(Instruction *I,
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);
}
}