[llvm-commits] [llvm] r86603 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp

Chris Lattner sabre at nondot.org
Mon Nov 9 21:09:25 PST 2009


On Nov 9, 2009, at 6:49 PM, Duncan Sands wrote:

> Hi Chris,
>
>> +  // This only adjusts blocks with PHI nodes.
>> +  if (!isa<PHINode>(BB->begin()))
>> +    return;
>
> don't you still want to do BB->removePredecessor in this case?

it's a noop in this case too.

> Anyway, if the BB doesn't start with a phi, the following code does  
> essentially
> nothing anyway, so the test doesn't buy you much.

Most blocks don't have phis, so it's a small optimization.

>
>> +  //BB->removePredecessor(Pred, true);
>> +  BB->removePredecessor(Pred, true);
>
> One of these shouldn't be there :)

Already gone.

>
> Also, this seems like a generally useful transform - does it really  
> belong
> in JumpThreading?

No, but I will refactor it in time, no worries :)

-Chris



More information about the llvm-commits mailing list