<div dir="ltr"><div>Dear Sanjoy Das,</div><div><br></div><div>I can see the point.</div><div>Thanks a lot for the instructive example.</div><div><br></div><div>Best,</div><div>Chung-Kil Hur</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 17, 2015 at 4:29 AM, Sanjoy Das <span dir="ltr"><<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A trap representation prevents hoisting operations over control flow.<br>
For instance, if we defined reading uninitialized memory to trap, then<br>
we could not transform<br>
<br>
  %t = alloca<br>
  call void @escape(%t)<br>
  loop n times {<br>
    %m = load %t<br>
    use(%m)<br>
  }<br>
<br>
to<br>
<br>
  %t = alloca<br>
  call void @escape(%t)<br>
  %m = load %t<br>
  loop n times {<br>
   use(%m)<br>
  }<br>
<br>
since if n was 0 and @escape did not initialize %t, we would have<br>
introduced a trap that was not present in the original program.<br>
<div><div class="h5"><br>
On Mon, Mar 16, 2015 at 8:49 AM, Chung-Kil Hur <<a href="mailto:gil.hur@sf.snu.ac.kr">gil.hur@sf.snu.ac.kr</a>> wrote:<br>
> Dear LLVMdev,<br>
><br>
> We have a question regarding the semantics of the undefined value in LLVM<br>
> IR.<br>
><br>
> As far as we understand, in order to give a semantics to the undefined<br>
> value, the semantics of LLVM IR is generalized to a rather unusual set-based<br>
> semantics. More specifically, the notion of value in LLVM IR is generalized<br>
> to a set of values, rather than a single value. Then the undefined value is<br>
> simply defined as the set of all values.<br>
><br>
> Our question is simply why LLVM does not use the notion of trap<br>
> representation of C11 standard to represent the undefined value, rather than<br>
> using the set-based semantics.<br>
><br>
> We'd like to understand the motivation of the set-based semantics over the<br>
> trap representation.<br>
><br>
> Thanks.<br>
> Chung-Kil Hur, Steve Zdancewic & Viktor Vafeiadis.<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
</blockquote></div><br></div>