Displaying 3 results from an estimated 3 matches for "r84103".
2009 Oct 14
0
[LLVMdev] Moving dependent code into conditional statements
...nstcombine does this in simple cases (see "See if we can trivially
sink this instruction to a successor basic block.") but it misses this
case because the if gets folded into a select early. It was also not
handling the "phi use" case very aggressively, which I fixed in
r84103. We now sink the divide and add in this 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
{
bar();
x = y; // Body...
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
2009 Oct 14
2
[LLVMdev] Moving dependent code into conditional statements
...llvm.org/~vadve
> (see "See if we can trivially sink this instruction to a successor
> basic block.") but it misses this case because the if gets folded
> into a select early. It was also not handling the "phi use" case
> very aggressively, which I fixed in r84103. We now sink the divide
> and add in this 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
>...