[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive
Peixin Qiao via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 6 06:31:05 PDT 2021
peixin added a comment.
The following test case fails after https://reviews.llvm.org/rGaf000197c4214926bd7d0862d86f89aed5f20da6.
#include <iostream>
using namespace std;
int main() {
float a[10];
int i, N = 10;
for (i = 0; i < N; i++)
a[i] = 0;
#pragma omp simd
for (i = 0; i < N; i++) {
#pragma omp ordered simd
a[i] = a[i-1] + 1.0;
}
for (i = 0; i < N; i++)
cout << a[i] << " ";
cout << endl;
}
$ clang++ -fopenmp simd.cpp && ./a.out
1 2 3 4 5 6 7 8 9 10
$ clang++ -fopenmp -O1 simd.cpp && ./a.out
1 1 1 1 2 1 1 1 2 3
It is fixed by this patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109321/new/
https://reviews.llvm.org/D109321
More information about the cfe-commits
mailing list