This includes a couple of changes:
- Moves the code that changes the root node out of the TryToReduce lambda and out of the traversal loop.
- Since that code moved, there isn't much left in TryToReduce so the code was inlined.
- The phi node variable P was also being used as a flag that turns on/off the exploration of operands as new seeds. This patch uses a new variable TryOperandsAsNewSeeds for this.
- Simplifies the code executed when vectorization fails.
The logic of the code should be identical to the original, but I may be missing something not caught by tests.