https://llvm.org/bugs/show_bug.cgi?id=25793
Bug ID: 25793 Summary: [polly] The order of the loop is reversed while not necessary Product: tools Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: opt Assignee: unassignedb...@nondot.org Reporter: lawre...@codeaurora.org CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 15426 --> https://llvm.org/bugs/attachment.cgi?id=15426&action=edit reduced testcase Polly schedule changed the order of the loop unnecessaryly. Here is the original order of the loop in c: void foo (int * restrict A, int * restrict B, int * restrict C, int n) { for(int i = 0; i < n; i++) A[i] += 1; for(int i = 0; i < n; i++) B[i] += 1; for(int i = 0; i < n; i++) C[i] += 1; } Polly schedule reorder the loops to: void foo (int * restrict A, int * restrict B, int * restrict C, int n) { for(int i = 0; i < n; i++) C[i] += 1; for(int i = 0; i < n; i++) A[i] += 1; for(int i = 0; i < n; i++) B[i] += 1; } Here is the isl ast for attached IR { #pragma simd #pragma known-parallel for (int c0 = 0; c0 < n; c0 += 1) Stmt_for_body16(c0); #pragma simd #pragma known-parallel for (int c0 = 0; c0 < n; c0 += 1) Stmt_for_body(c0); #pragma simd #pragma known-parallel for (int c0 = 0; c0 < n; c0 += 1) Stmt_for_body5(c0); } Even though it is logically correct, however it is not necessary, and afffect readability. Use opt -debug -polly -polly-detect -polly-opt-isl -polly-codegen -polly-vectorizer=polly -polly-ignore-aliasing -S <t.ll >log.log 2>&1 to reproduce it -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs