Simplify analysis in funcitonalize_cond by splitting CondState.
* Split CondState into CondState (which corresponds to scope previously) and
AncestorState (which tracks which switch/merge nodes are an ancestor of a
ndoe). Previously CondState tracked both but that resulted in difficult to
follow meet rules. Instead by splitting these out the meet for merge and
non-merge are straight forward set operations. The ancestor relation is
similarly easy to compute along with CondState computation.
* Enhance the redundant switch checking: previously we only considered the
predicates but
%s=switch(val=%P, pred=switch(%P_1, %P):then)
is also redundant as if %P is true then %s:else is dead.
* Enhance in-edge testing to insert a switch if a value from an outer context
is consumed inside an inner context.
* Rename CondStateMap to StateMap to match new usage.
PiperOrigin-RevId: 211622021
Loading
Please sign in to comment