Hi, This patch fixes PR87022. The root cause is the original code checks the first bit in dist vector for zero and we still do that after enabling loop nest distribution. For the test case, the first bit is for outer loop while the dependence happens in the inner loop, as a result, the direction of dependence is not correctly reverted. This patch fixes the issue by checking all bits in dist vector.
Bootstrap and test on x86_64, is it OK? Thanks, bin 2018-10-14 Bin Cheng <bin.ch...@linux.alibaba.com> PR tree-optimization/87022 * tree-loop-distribution.c (pg_add_dependence_edges): Check all bits in dist vector rather than the first one. 2018-10-14 Bin Cheng <bin.ch...@linux.alibaba.com> PR tree-optimization/87022 * gcc.dg/tree-ssa/pr87022.c: New test.
pr87022.txt
Description: Binary data