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 ikelarev on Apr 4 2023, 12:38 PM.

Details

Reviewers
ABataev
vdmitrie
Summary

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

Event Timeline

ikelarev created this revision.Apr 4 2023, 12:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2023, 12:38 PM
ikelarev requested review of this revision.Apr 4 2023, 12:38 PM
  1. Include full diff context.
  2. Need to add a test.

This issue affects us as well. To make progress I've duplicated this into D149338 with full context and test case reproducing the issue. If @ikelarev is still interested in this he can add his test anytime.

This issue affects us as well. To make progress I've duplicated this into D149338 with full context and test case reproducing the issue. If @ikelarev is still interested in this he can add his test anytime.

Thanks Evgeniy for providing the test!

ikelarev abandoned this revision.Apr 27 2023, 6:56 AM