This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Minor SSA cleanups




>   > > And yes, you can do some indexing into the various tables we've got lying
>   > > around, but why bother.  If we record the edge, then no indexing into the
>   > > tables is needed when we go to insert the copies when we eliminate the
>   > > phi nodes.
>   > Well, like I said, for anything more than simple following phi node
>   > edges, it's worthless.
>   > I'm not sure which optimization you are doing, but in SSA CCP, GVN,
>   > and PRE, it just wasn't enough.
> Huh?  All the embedded block # gets used for is the conversion from SSA back
> to normal form.  It's affect on SSA-CPP is nil as I would expect its effect
> on any other SSA optimizer to be.
I'll happily agree to disagree about whether df.[ch] is
overkill/approriate. We just seem to have a difference of opinion.

However, the above statement would be incorrect.
Think about what happens now when I want to replace part of a phi node,
like SSA GVN can, and often does, do.

Removing phi nodes altogether is easy, of course.
However, updating them is annoying.
By keeping the block number there, you *force* SSA-GVN to keep track of
where each register is def'd.  Without it, I could do a simple replacement
of register with register.
Now, I have to have df.[ch], or *something*, to give me a table of where
each register is def'd, so that when i replace part of a phi node, I can
update the stupid basic block pointer.
It's actually worse than this in some cases.
If you move a register def, you need to hunt down all the phi nodes using
that register, and replace the block number/pointer.
You don't need to change the register number in them, because it's still
right. However, now the basic block pointer is wrong.
In effect, you've forced other  optimizations to do more work than they
should need to.
The more SSA optimization passes you add, the more wasted time and space
you will have diddling something that could be easily calculated by the
conversion out of SSA, just once.

--Dan
 >
> jeff
>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]