This is an archive of the discontinued LLVM Phabricator instance.

[polly] Fix non-deterministic output due to iteration of unordered ScopArrayInfo
ClosedPublic

Authored by mgrang on Aug 31 2017, 12:39 PM.

Details

Summary

This fixes the following failures in the reverse iteration builder:
http://lab.llvm.org:8011/builders/reverse-iteration/builds/25

Polly :: MaximalStaticExpansion/working_deps_between_inners.ll
Polly :: MaximalStaticExpansion/working_expansion_multiple_dependences_per_statement.ll
Polly :: MaximalStaticExpansion/working_expansion_multiple_instruction_per_statement.ll
Polly :: MaximalStaticExpansion/working_phi_expansion.ll

Diff Detail

Event Timeline

mgrang created this revision.Aug 31 2017, 12:39 PM
grosser added inline comments.Aug 31 2017, 12:43 PM
lib/Transform/MaximalStaticExpansion.cpp
504

Why do you need to sort the arrays. The original data structure is a SetVector and should consequently be deterministic. Should we just change the SmallPtrSet into a SmallVector? Would this be sufficient?

mgrang updated this revision to Diff 113456.Aug 31 2017, 1:08 PM
grosser accepted this revision.Aug 31 2017, 1:09 PM
This revision is now accepted and ready to land.Aug 31 2017, 1:09 PM
mgrang marked an inline comment as done.Aug 31 2017, 1:09 PM
mgrang added inline comments.
lib/Transform/MaximalStaticExpansion.cpp
504

Yes, we actually do not need to sort as S.arrays() is a SetVector. Consequently, the unit tests do not need to be fixed either. Thanks!

This revision was automatically updated to reflect the committed changes.
mgrang marked an inline comment as done.