<div dir="ltr"><div>The fact two IR values are defined the same way doesn't necessarily imply they are actually the same value.<br></div><div><div>e.g.</div><div><br></div><div>%a = load volatile i32, i32* %p</div><div>%b = load volatile i32, i32* %p</div></div><div><br></div><div>As Sanjoy said, though, it should always be legal to optimize all uses of different "freeze(%x)" values to use the same def - this is equivalent to choosing the same value for all freezes. It's just not necessary to do so.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 1:58 PM, Krzysztof Parzyszek via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In both of these cases, the expression tree in the IR is going to look like<br>
== (freeze(%x), freeze(%x))<br>
<br>
The %a and %b are just labels on values, which are defined in the exact same way. How do you differentiate these two?<br>
<br>
If %a = freeze(%x), is %a+1 == %a+1?<br>
<br>
-Krzysztof<span class="im HOEnZb"><br>
<br>
<br>
<br>
On 10/20/2016 3:36 PM, Sanjoy Das wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Krzysztof,<br>
<br>
Krzysztof Parzyszek wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/18/2016 4:29 PM, Nuno Lopes wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Even %a and %b might not be the same in "%a = freeze(%x), %b =<br>
freeze(%x)" (each freeze returns an arbitrary, but fixed, value).<br>
</blockquote>
<br>
Assume that %x is known to be a poison value and have:<br>
%a = freeze(%x)<br>
%b = freeze(%x)<br>
<br>
Is %a == %a true?<br>
</blockquote>
<br>
Yes, %a is always == %a. It is a normal SSA value with some unspecific<br>
content.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is %a == %b true?<br>
</blockquote>
<br>
Not necessarily; but the compiler can make it true by (consistently)<br>
choosing equal values for %a and %b.<br>
<br>
By consistently I mean it can't fold one instance of %a == %b to true<br>
and fold another instance of %a == %b to false.<br>
<br>
-- Sanjoy<br>
</blockquote>
<br></span><span class="im HOEnZb">
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br></span><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>