For the record, the if-else series works as a series of BasicBlocks. See the <a href="http://llvm.org/docs/tutorial/LangImpl6.html">http://llvm.org/docs/tutorial/LangImpl6.html</a> page for a more detailed explanation. But, the simple answer is yes, the allocator does have to worry about load/stores across blocks.<div>
<br></div><div>Thanks,</div><div>Jeff Kunkel<br><div><div><br></div><div><div><br><div class="gmail_quote">On Mon, Aug 30, 2010 at 7:37 AM, Jeff Kunkel <span dir="ltr"><<a href="mailto:jdkunk3@gmail.com">jdkunk3@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Upon writing my register allocation algorithm, I am concerned that a load may be skipped due to a branch. <div><br></div>
<div>For instance consider the psudocode<div><br></div><div>int x = 1</div><div>...</div><div>if( false )</div>
<div>  load x</div><div>  y = 3*x</div><div>else</div><div>  y = 4*x</div><div>...</div></div><div><br></div><div>The load happens in the false block because this is when the variable is first seen. The load is not preformed in the else block because the register allocator may see it loaded already.</div>

<div><br></div><div>Do I need to be concerned about cases like this?</div><div><br></div><div>Thanks,<br><font color="#888888">Jeff Kunkel</font></div>
</blockquote></div><br></div></div></div></div>