https://llvm.org/bugs/show_bug.cgi?id=26082

            Bug ID: 26082
           Summary: Invariant store should sink to loop exit
           Product: tools
           Version: 3.7
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: opt
          Assignee: unassignedb...@nondot.org
          Reporter: mar...@synopsys.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

The store in the inner loop should be moved to the loop exit block. The test
case is arbitrary. The idiom is common to many DSP kernels.

void test(const int * restrict p_a, const int * restrict p_b, int * restrict
p_z) {
 #pragma clang loop unroll(disable)
 for (int i = 0; i < 10; i++) {
  *p_z = 0;
  #pragma clang loop unroll(disable)
  for (int f=0;f<10;f++)
    *p_z  += *p_a++ * *p_b++ ; //HERE
  p_z++;
 }
}

-- 
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

Reply via email to