[NFC][SLP] Cleanup: Simplify traversal loop in SLPVectorizerPass::vectorizeHorReduction().
This includes a couple of changes: 1. Moves the code that changes the root node out of the `TryToReduce` lambda and out of the traversal loop. 2. Since that code moved, there isn't much left in `TryToReduce` so the code was inlined. 3. 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. 4. 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. Differential Revision: https://reviews.llvm.org/D149627
Loading
Please sign in to comment