<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hello,<br><br>I am a bit confused about the nature of LLVM's SSA and IR in general.<br>Questions:<br>
1) Is it possible to get LLVM to generate code as in /*2*/ (bellow)?<br>
2) if not, how can I tell if an o<a title="Send (Ctrl+Enter)" href="javascript:;" id="SendMessage"><span class="Label"></span></a>perand has been previously defined?<br>
<br>Here is why:<br>I thought (wrongly) that all operands of an instruction must have been <br>previously defined or some constants.<br>I see that the 'bitcast' instruction is certainly standalone in certain cases, such as<br>    %[65]"alloca point" = bitcast i32 [34]0 to i32; <i32> [#uses=0]<br><br>However the following instruction has a 'bitcast' inserted as an operand, <br>rather then the result of a previous bitcast:<br>/*1*/<br>    (void)store i32 (...)* bitcast (i32 ()* @pf to i32 (...)*), i32 (...)** @[2]pf0, align 8<br><br>In this case, the bitcast is a constant, but it does DEFINE a new value <br>and that value is the operand. I would have thought that the above code <br>should have been "pure IR/SSA":<br>/*2*/<br>    %TMP = bitcast (i32 ()* @pf to i32 (...)*)<br>
    (void)store i32 (...)* %TMP, i32 (...)** @[2]pf0, align 8<br>
or something like that...<br><br>Thank you,<br>Dan<br><br>                                          <br /><hr />Hotmail: Trusted email with powerful SPAM protection. <a href='http://clk.atdmt.com/GBL/go/177141665/direct/01/' target='_new'>Sign up now.</a></body>
</html>