[Polly][Unroll] Fix unroll_double test.
authorMichael Kruse <llvm-project@meinersbur.de>
Tue, 16 Mar 2021 13:50:37 +0000 (08:50 -0500)
committerMichael Kruse <llvm-project@meinersbur.de>
Tue, 16 Mar 2021 14:00:42 +0000 (09:00 -0500)
commitf51427afb5333e5dd2eb04ea4630037667c64553
tree7b29b1f15b7642ab663495121b69a2421470ceee
parenta6f9cb6adc591d19a6c43234245de1e2048ed373
[Polly][Unroll] Fix unroll_double test.

We enumerated the cross product Domain x Scatter, but sorted only be the
scatter key. In case there are are multiple statement instances per
scatter value, the order between statement instances of the same loop
iteration was undefined.

Propertly enumerate and sort only by the scatter value, and group the
domains using the scatter dimension again.

Thanks to Leonard Chan for the report.
polly/lib/Transform/ScheduleTreeTransform.cpp
polly/test/ScheduleOptimizer/ManualOptimization/unroll_double.ll