This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Add TreeEntry into PostponedGathers if it depends on another previously postponed TreeEntry
AbandonedPublic

Authored by ebrevnov on Apr 27 2023, 5:40 AM.

Details

Reviewers
ABataev
Summary

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.

Diff Detail

Unit TestsFailed