[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-09 Thread Peixin Qiao via Phabricator via cfe-commits
peixin abandoned this revision. peixin added a comment. Abandon this PR since this is not right fix. Continuing discussion will be on openmp-dev mail list. This bug should be fixed if `ordered simd` is processed correctly in frontend and vectorization pass. Repository: rG LLVM Github

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-08 Thread Peixin Qiao via Phabricator via cfe-commits
peixin added a comment. In D109321#2987783 , @jdoerfert wrote: > As noted before, this is not the right fix. Not inlining should not cause a > semantic difference here, the problem is something else. @jdoerfert Yes, I agree that this is not the right

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D109321#2986678 , @peixin wrote: > $ clang++ -fopenmp simd.cpp -O1 -Xclang -disable-llvm-passes && ./a.out > 0 1 2 3 4 5 6 7 8 9 > $ clang++ -fopenmp simd.cpp -O2 && ./a.out > 0 1 2 3 4 5 6 7 8 9 > $

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-07 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert requested changes to this revision. jdoerfert added a comment. As noted before, this is not the right fix. Not inlining should not cause a semantic difference here, the problem is something else. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-07 Thread Peixin Qiao via Phabricator via cfe-commits
peixin added a comment. $ clang++ -fopenmp simd.cpp -O1 -Xclang -disable-llvm-passes && ./a.out 0 1 2 3 4 5 6 7 8 9 $ clang++ -fopenmp simd.cpp -O2 && ./a.out 0 1 2 3 4 5 6 7 8 9 $ clang++ -fopenmp simd.cpp -O3 && ./a.out 0 1 2 3 4 5 6 7 8 9 This bug is not in

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-06 Thread Peixin Qiao via Phabricator via cfe-commits
peixin added a comment. In D109321#2985284 , @jhuber6 wrote: > In D109321#2985281 , @lebedev.ri > wrote: > >> Aha. But i don't think this is the right fix, >> the fact that the inlining manifests the miscompile

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D109321#2985281 , @lebedev.ri wrote: > Aha. But i don't think this is the right fix, > the fact that the inlining manifests the miscompile is a symptom. Preventing the outlined region from being inlined would also hurt

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-06 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Aha. But i don't think this is the right fix, the fact that the inlining manifests the miscompile is a symptom. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109321/new/ https://reviews.llvm.org/D109321

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-06 Thread Peixin Qiao via Phabricator via cfe-commits
peixin added a comment. `for (i = 0; i < N; i++)` --> `for (i = 1; i < N; i++)` #include 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 = 1; i < N; i++) { #pragma omp ordered

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-06 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri requested changes to this revision. lebedev.ri added a comment. This revision now requires changes to proceed. In D109321#2985244 , @peixin wrote: > The following test case fails after >

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-06 Thread Peixin Qiao via Phabricator via cfe-commits
peixin added a comment. The following test case fails after https://reviews.llvm.org/rGaf000197c4214926bd7d0862d86f89aed5f20da6. #include 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

[PATCH] D109321: [clang][OpenMP] Fix the bug in codegen for ordered directive

2021-09-06 Thread Peixin Qiao via Phabricator via cfe-commits
peixin created this revision. peixin added reviewers: jhuber6, jdoerfert, kiranchandramohan, Meinersbur, clementval, kiranktp, Leporacanthicus, bryanpkc, arnamoy10, Chuanfeng. peixin added projects: LLVM, clang. Herald added subscribers: guansong, yaxunl. peixin requested review of this revision.