Disclamer: This is a duplicate of D147562 with regression test added.
https://reviews.llvm.org/D144958 change introduced PostponedGathers into SLP Vectorizer. As far as I understand it allows to generate temporary fake loads instead of real instructions and update later postponed entries at the end of vectorization. But during this update can be generated an instruction which uses a fake load which was already replaced. That leads to an incorrect dependency and assertion "trying to erase instruction with users" failure in BoUpSLP destructor.
This change helps to avoid such a scenario by adding into PostponedGathers every node which depends on the node already added into PostponedGathers.