At first I'll try the simplest strategy: put the instruction in the machine BB corresponding to the LLVM BB where it comes from. <br><br>To implement this, I plan to add an operand to non-passive node which points to the BasicBlockSDNode which the node belongs to.  <br>
<br>Another idea is to use a side map to map each node to its block. But I guess it's difficult to keep the map consistent when transforming the DAG.<br><br><div class="gmail_quote">On Wed, Jun 9, 2010 at 1:39 AM, Dan Gohman <span dir="ltr"><<a href="mailto:gohman@apple.com">gohman@apple.com</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;">The first question is code placement.  How is the compiler going to decide which block (or blocks) to emit an instruction in?  The answer to that will help determine how control relationships should be represented.<br>
<font color="#888888">
<br>
Dan</font><div class="im"><br>
<br>
On Jun 7, 2010, at 11:56 PM, Zhongxing Xu <<a href="mailto:xuzhongxing@gmail.com" target="_blank">xuzhongxing@gmail.com</a>> wrote:<br>
<br>
</div><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">
I am trying to build a DAG for a whole function. The first problem I met is to assign a user for the last instruction of each basic block, be it BRCOND or other node. There is no natural user for such nodes. Without user, it will be removed in later phases. My idea is to use it as chain for nodes in the next basic block. Is this reasonable?<br>

<br>
-Zhongxing Xu<br></div><div class="im">
_______________________________________________<br>
LLVM Developers mailing list<br>
<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><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></blockquote>
</blockquote></div><br>