Displaying 2 results from an estimated 2 matches for "0fa4adbb".
2009 Oct 14
0
[LLVMdev] Moving dependent code into conditional statements
On Oct 14, 2009, at 12:21 AM, Nicolas Capens wrote:
> Hi all,
>
> Is there any existing optimization pass that will move as much code
> into the body of a forward branch as possible? Consider the
> following example:
Hi Nicolas,
Instcombine does this in simple cases (see "See if we can trivially
sink this instruction to a successor basic block.") but it misses
2009 Oct 14
3
[LLVMdev] Moving dependent code into conditional statements
Hi all,
Is there any existing optimization pass that will move as much code into the
body of a forward branch as possible? Consider the following example:
int foo(int x)
{
for(int i = 0; i < 1000000; i++)
{
int y = (x + 1) / x; // Expensive calculation! Result written to
memory.
if(x == 0) // Forward branch
{
x = y; // Body