[llvm-commits] [llvm] r67194 - in /llvm/trunk/lib/Transforms: Scalar/ScalarReplAggregates.cpp Utils/Local.cpp
Zhou Sheng
zhousheng00 at gmail.com
Wed Mar 18 04:20:04 PDT 2009
Hi,
2009/3/18 Duncan Sands <baldrick at free.fr>
> Hi,
>
> > else if (Instruction *I = dyn_cast<Instruction>(U)) {
> > SmallVector<DbgInfoIntrinsic *, 2> DbgInUses;
> > - if (OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
> > + if (!I->use_empty() && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses))
> {
> > // Safe to remove debug info uses.
> > while (!DbgInUses.empty()) {
> > DbgInfoIntrinsic *DI = DbgInUses.back(); DbgInUses.pop_back();
>
> why is it safe to delete the instruction itself (done just below)?
> Does being used by debug intrinsics imply that the instruction cannot
> write memory?
I'm not sure if an instruction only used by debug info will write memory.
But in this case, as the instruction "I" is just an allocaInst, so, I think
it is safe to delete.
>
>
> Ciao,
>
> Duncan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090318/9d726b8f/attachment.html>
More information about the llvm-commits
mailing list