fix OP_PHI usage in try_to_simplify_bb() only when non-bogus
commitd79853389f55e3645e4a094f091915ea63546d09
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Fri, 16 Jun 2017 09:37:36 +0000 (16 11:37 +0200)
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Wed, 21 Jun 2017 09:28:40 +0000 (21 11:28 +0200)
tree3cf0001fc97f8fbaf699a2c5b705fddf7b5cc1cb
parent57d04233adb124caf4df759b8f3cdc582f985262
fix OP_PHI usage in try_to_simplify_bb() only when non-bogus

Currently, sparse method of conversion to SSA form, doesn't
place phi-nodes at the dominance frontier but often place them
'lower' where the corresponding 'value' is needed.
This, in itself create all sort of problems. One of these
problems is that it is then quite common for an OP_PHI
to contains less 'sources' than it has parents. This is wrong
has phi-nodes represent the 'join' a value can have from each
of the incoming paths/parents.

This situation can't be given a sensible semantic and any
attempt to try some optimization involving the phi-nodes and
their sources are bound to fail.

Temporary workaround this in try_to_simplify_bb() by simply
checking if the number of parents and the number of phi-sources
match and avoid to make this simplification if they don't.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
flow.c