[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:23:10 PDT 2009


2009/3/18 Zhou Sheng <zhousheng00 at gmail.com>

> 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.
>

Sorry, please forget my previous comments. I'm just got confused.

>
>
>
>>
>>
>> Ciao,
>>
>> Duncan.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090318/84e38899/attachment.html>


More information about the llvm-commits mailing list