<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><div dir="ltr"><div class="gmail_default" style>On Fri, Dec 28, 2012 at 12:35 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">>> Oh, I was reading "precedes/following" as having static (dominance)<br>
>> meaning. That is, in the above example you could not delete the store<br>
>> since it is not true that<br>
>> llvm.lifetime.end dominates it.<br>
>><br>
>> Nick, is this what you had in mind? If not, then we must delete a<br>
>> matching llvm.lifetime.end, but it is not clear how we define<br>
>> "matching". In the following code some executions will hit the first<br>
>> llvm.lifetime.end and others will hit the second one.<br>
><br>
><br>
> Yes, I meant at runtime.<br>
><br>
<br>
</div>OK, thanks. What is the meaning in the case of aliases? Should this work:<br>
<br>
llvm.lifetime.start(%x)<br>
<br>
...<br>
<br>
llvm.lifetime.end(%y which alias %x sometimes)<br></blockquote><div><br></div><div style>I'm not sure if "sometimes" actually happens in the wild.</div><div style>In recent patches to lifetime handling in ASan</div>
<div style>I assumed that argument in llvm.lifetime intrinsic</div><div style>can come from bitcasts or phi nodes, but all its possible values should</div><div style>originate from the same alloca instruction.</div><div style>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If so, I guess that in order to delete a llvm.lifetime.start we have<br>
to delete all llvm.lifetime.end that are "directly" reachable from it<br>
and take an argument that may alias the one passed to<br>
llvm.lifetime.start. Is that it? What about calling<br>
llvm.lifetime.start in one function and llvm.lifetime.end in another?<br></blockquote><div><br></div><div style>I don't see how this can happen, assuming that arguments of llvm.lifetime</div><div style>can only come from allocas.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It seems that deleting llvm.lifetime.start is impossible in general,<br>
but it is safe to add one if at least one already exists, is that the<br>
case?<br>
<br>
On the other hand, removing llvm.lifetime.end should always be safe, right?<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div></div>