This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer.
ClosedPublic

Authored by ABataev on Oct 17 2016, 5:55 AM.

Details

Summary

After successfull horizontal reduction vectorization attempt for PHI node vectorizer tries to update root binary op by combining vectorized tree and the ReductionPHI node. But during vectorization this ReductionPHI can be vectorized itself and replaced by the undef value, while the instruction itself is marked for deletion. This 'marked for deletion' PHI node then can be used in new binary operation, causing "Use still stuck around after Def is destroyed" crash upon PHI node deletion.

Also the test is fixed to make it perform actual testing.

Diff Detail

Event Timeline

ABataev updated this revision to Diff 74832.Oct 17 2016, 5:55 AM
ABataev retitled this revision from to [SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer..
ABataev updated this object.
ABataev added reviewers: mkuper, hfinkel, mzolotukhin.
ABataev set the repository for this revision to rL LLVM.
ABataev added subscribers: RKSimon, spatel, llvm-commits.
ABataev updated this revision to Diff 74980.Oct 18 2016, 4:18 AM
ABataev removed rL LLVM as the repository for this revision.

Fixed a test that was not vectorized

hfinkel accepted this revision.Oct 26 2016, 3:03 PM
hfinkel edited edge metadata.

LGTM

lib/Transforms/Vectorize/SLPVectorizer.cpp
4065

Please add a comment here (i.e. from this patch description), explaining why this is a WeakVH.

This revision is now accepted and ready to land.Oct 26 2016, 3:03 PM
This revision was automatically updated to reflect the committed changes.