This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Allow reduction on pointer dereference
AbandonedPublic

Authored by Hahnfeld on Mar 18 2016, 1:04 PM.

Details

Summary

Pointer dereference is equal to access of first array element which is already allowed for the reduction clause.

While at it also add test for CodeGen of reduction on array element which seemed to be missing.

Diff Detail

Event Timeline

Hahnfeld updated this revision to Diff 51062.Mar 18 2016, 1:04 PM
Hahnfeld retitled this revision from to [OpenMP] Allow reduction on pointer dereference.
Hahnfeld updated this object.
Hahnfeld added a subscriber: cfe-commits.
ABataev added inline comments.Mar 20 2016, 9:10 PM
lib/CodeGen/CGStmtOpenMP.cpp
913–929

This is not allowed by OpenMP standard. I added support for array subscripts because they are very similar to array sections, but unary operations are definitely not allowed

Hahnfeld abandoned this revision.Mar 21 2016, 12:44 AM
Hahnfeld added inline comments.
lib/CodeGen/CGStmtOpenMP.cpp
913–929

Ok, I'm fine with that and will close this revision.

(for me *arr is the same as arr[0] so I expected it to work as well)