This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Use Undef instead of null as pointer for inactive lanes
ClosedPublic

Authored by jdoerfert on Jul 19 2022, 12:37 PM.

Details

Summary

Our conditional writes in the runtime look like this:

if (active)
  *ptr = value;

In the RAII we need to assign ptr which comes from a lookup call.
If a thread that is not the main thread calls lookup with the intention
to write the pointer, we'll create a new thread state. As such, we need
to avoid calling lookup for inactive threads. We used to use nullptr
as their ptr value but that can cause pessimistic reasoning. We now
use undef instead.

Diff Detail

Event Timeline

jdoerfert created this revision.Jul 19 2022, 12:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2022, 12:37 PM
jdoerfert requested review of this revision.Jul 19 2022, 12:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2022, 12:37 PM
Herald added a subscriber: sstefan1. · View Herald Transcript
This revision is now accepted and ready to land.Jul 21 2022, 10:35 AM