The sequence of events during optimization as I understand is something
like:
a. compute ud, in_edges,
edoms etc.
b. call opt_blk on each
block. This computes value numbers for the block, does local optimizations
on the blocks and sets up values for the branch optimizer.
c. We call opt_j on all
edges starting from the lowest level. opt_j folds edges on detecting redundant
predicate evaluations if there is no use conflict.
My doubt is the following:
When folding an edge at, say the i'th level we will be examining the value
numbers for a node at a lower level, say j. But due to previous folding
of edges(during the same iteration) the value number of the node at level
j might have changed, but we will not have updated the value numbers. The
"ud" could also get changed due to previous folding of edges or even because
of local optimizations that we performed on the blocks. Could this potentially
lead to errors ? Please enlighten.
The optimizer also computes
closure for all the nodes. But I couldnt see it being used anywhere. I looked
at revision 1.72 of optimize.c on the tcpdump CVS.
thanks in advance.
Maneesh
