<br><br><div class="gmail_quote">On Tue, Apr 5, 2011 at 1:44 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi Arushi,<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
  %tmp63 = call %struct.TypHeader* (...)* bitcast (%struct.TypHeader*<br>
(%struct.TypHeader*, i64, i64)* @Cyclotomic to %struct.TypHeader*<br>
(...)*)(%struct.TypHeader* %tmp62, i64 %tmp24, i32 1) nounwind, !dbg !907 ;<br>
<%struct.TypHeader*> [#uses=1]<br>
<br>
the 3rd parameter is now used in an srem statement. How do we know what value is<br>
used? Does this use decide whether the value is sign extended or zero extended?<br>
</blockquote>
<br></div>
inside the called function the 3rd value will contain rubbish.  That's because<br>
the function takes an i64 parameter but via the bitcast you pretend it takes an<br>
i32 parameter, which is wrong.  This is not the correct way to pass an i32 to a<br>
function that takes an i64.  Where did you get this IR from?<br></blockquote><div><br>This is unoptimized IR, generated for a SPEC example.<br><br>The optimized IR, converts this call to  <br><br> %tmp63 = call%struct.TypHeader*<br>


(%struct.TypHeader*, i64, i64)* @Cyclotomic (%struct.TypHeader* %tmp62, i64 %tmp24, i64 1) nounwind<br>
<%struct.TypHeader*> [#uses=1] <br><br>I was just wondering what the logic was to infer when such conversions could be made.<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<br>
Ciao, Duncan.<br>
<br>
PS: It may not contain rubbish in practice, in particular probably the lower 32<br>
bits will have the "right" value, but nothing guarantees that.<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
<br>
Arushi<br>
<br>
On Tue, Apr 5, 2011 at 1:35 AM, Duncan Sands <<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a><br></div><div class="im">
<mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>>> wrote:<br>
<br>
    Hi Arushi,<br>
<br>
     > For a call like this,<br>
     ><br>
     > %tmp6 = call i32 (...)* bitcast (i32 (i8*, i8, i8**)* @ssplit to i32<br>
    (...)*)(i8*<br>
     > %tmp599, i32 46, i8** %domainv3) nounwind ; <i32><br>
     ><br>
     > does the 2nd argument get zero extended or sign extended?<br>
<br>
    neither since it does not have the zext or sext attribute.<br>
<br>
    Ciao, Duncan.<br>
    _______________________________________________<br>
    LLVM Developers mailing list<br></div>
    <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <mailto:<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><div class="im">

<br>
    <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br>