<br><br><div class="gmail_quote">2009/3/18 Zhou Sheng <span dir="ltr"><<a href="mailto:zhousheng00@gmail.com">zhousheng00@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote">2009/3/18 Zhou Sheng <span dir="ltr"><<a href="mailto:zhousheng00@gmail.com" target="_blank">zhousheng00@gmail.com</a>></span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

HiŁ¬<br><br><div class="gmail_quote">2009/3/18 Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span><div><div></div><div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


Hi,<br>
<br>
>      else if (Instruction *I = dyn_cast<Instruction>(U)) {<br>
>        SmallVector<DbgInfoIntrinsic *, 2> DbgInUses;<br>
> -      if (OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {<br>
> +      if (!I->use_empty() && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {<br>
>          // Safe to remove debug info uses.<br>
>          while (!DbgInUses.empty()) {<br>
>            DbgInfoIntrinsic *DI = DbgInUses.back(); DbgInUses.pop_back();<br>
<br>
why is it safe to delete the instruction itself (done just below)?<br>
Does being used by debug intrinsics imply that the instruction cannot<br>
write memory?</blockquote></div></div><div>I'm not sure if an instruction only used by debug info will write memory. <br>But in this case, as the instruction "I" is just an allocaInst, so, I think it is safe to delete.<br>


</div></div></blockquote></div></div><div><br>Sorry, please forget my previous comments. I'm just got confused. </div></div></blockquote><div><br>The safety is checked by previous code of scalarrepl (function isSafeUseOfAllocation),  the instruction "I" can be only load, store, bitcast or getelementptr, so, here it is save to delete if it only used by debug info.<br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="gmail_quote"><div><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Ciao,<br>
<font color="#888888"><br>
Duncan.<br>
</font></blockquote></div><br>
</blockquote></div><br>
</blockquote></div><br>