This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix PR35542: Correct adjusting of private reduction variable
ClosedPublic

Authored by Hahnfeld on Dec 6 2017, 10:59 AM.

Details

Summary

The adjustment is calculated with CreatePtrDiff() which returns
the difference in (base) elements. This is passed to CreateGEP()
so make sure that the GEP base has the correct pointer type:
It needs to be a pointer to the base type, not a pointer to a
constant sized array.

Diff Detail

Repository
rC Clang

Event Timeline

Hahnfeld created this revision.Dec 6 2017, 10:59 AM
ABataev added inline comments.Dec 6 2017, 11:02 AM
lib/CodeGen/CGOpenMPRuntime.cpp
1110

Better to use SharedAddresses[N].first.getAddress().getType()

Hahnfeld added inline comments.Dec 6 2017, 11:06 AM
lib/CodeGen/CGOpenMPRuntime.cpp
1110

Ok, was copied from below call to castToBase(). Should I adjust it there as well?

ABataev added inline comments.Dec 6 2017, 11:07 AM
lib/CodeGen/CGOpenMPRuntime.cpp
1110

Yes, please

Hahnfeld updated this revision to Diff 125768.Dec 6 2017, 11:12 AM
Hahnfeld marked 3 inline comments as done.

Get type from Address.

This revision is now accepted and ready to land.Dec 6 2017, 11:13 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.