Make better use of simplification pass
authorSteven Perron <stevenperron@google.com>
Thu, 15 Feb 2018 17:14:39 +0000 (12:14 -0500)
committerSteven Perron <stevenperron@google.com>
Sat, 17 Feb 2018 01:46:49 +0000 (20:46 -0500)
commit04cd63e5b9c81b39906692cc635acfa2f4e1729f
tree975f90fc2da5c621ea509ecb41adbeba14b5a744
parent105441360043248e91ec1c8b981f9541dab11083
Make better use of simplification pass

The simplification pass works better after all of the dead branches are
removed.  So swapping them around in the legalization passes.  Also
adding the simplification pass to performance passes right after dead
branch elimination.

Added CCP to the legalization passes so we can propagate the constants
into the branchs, and remove as many branches a possible.  CCP is
designed to still get opportunities even if the branches are dead, so it
is a good place for it.

Fixes #1118
source/opt/optimizer.cpp