scalarizePHI only looks for phis that have exactly two users - the "latch" use, and an extract. Unfortunately, we can not assume such extracts have been CSEd, since InstCombine itself may create an extract which is a duplicate of an existing one. This extends it to handle several extracts from the same index.
This hopefully fixes the performance regression in PR27988.