[llvm-bugs] [Bug 45753] New: '# pragma clang loop vectorize (disable) 'doesn't work when -fopenmp is added to compilation options

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 30 03:08:51 PDT 2020


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

            Bug ID: 45753
           Summary: '# pragma clang loop vectorize (disable) 'doesn't work
                    when -fopenmp is added to compilation options
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fj8765ah at aa.jp.fujitsu.com
                CC: llvm-bugs at lists.llvm.org

Some programs have both '# pragma clang loop vectorize (disable)' and '# pragma
omp parallel for' written.
Adding -fopenmp when compiling this program will run 'vectorized loop'.
I thought that 'vectorized loop' should not work with -fopenmp.

What do you think?


$ clang -O2 -Rpass=loop-vectorize a.c -S
openmp.c:9:3: remark: interleaved loop (interleaved count: 2)
[-Rpass=loop-vectorize]
  for (i=0;i<n;++i) {
  ^
$ clang -O2 -Rpass=loop-vectorize a.c -S -fopenmp
openmp.c:7:1: remark: vectorized loop (vectorization width: 4, interleaved
count: 2) [-Rpass=loop-vectorize] #pragma omp parallel for ^


- a.c
void sub(float * restrict a,
         float * restrict b,
         float * restrict c,
         int n) {
  int i;

#pragma omp parallel for
#pragma clang loop vectorize(disable)
  for (i=0;i<n;++i) {
    c[i] = a[i] + b[i];
  }
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200430/d01ddf91/attachment.html>


More information about the llvm-bugs mailing list