[LLVMdev] What may I assume about MachineFunctions.

Jeff Kunkel
Thu, 02 Sep 2010 17:00:58 -0000

For the record, the if-else series works as a series of BasicBlocks. See
the http://llvm.org/docs/tutorial/LangImpl6.html page for a more
detailed explanation. But, the simple answer is yes, the allocator does have
to worry about load/stores across blocks.

Thanks,
Jeff Kunkel


On Mon, Aug 30, 2010 at 7:37 AM, Jeff Kunkel <jdkunk3 at gmail.com> wrote:

> Upon writing my register allocation algorithm, I am concerned that a load
> may be skipped due to a branch.
>
> For instance consider the psudocode
>
> int x = 1
> ...
> if( false )
>   load x
>   y = 3*x
> else
>   y = 4*x
> ...
>
> 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.
>
> Do I need to be concerned about cases like this?
>
> Thanks,
> Jeff Kunkel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20100902/a1c88b65/attachment.html>