This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget] Replace Value RAII with default value
ClosedPublic

Authored by jhuber6 on Feb 7 2022, 1:44 PM.

Details

Summary

This patch replaces the ValueRAII pointer with a default 'nullptr'
value. Previously this was initialized as a reference to an existing
variable. The use of this variable caused overhead as the compiler could
not look through the uses and determine that it was unused if 'Active'
was not set. Because of this accesses to the variable would be left in
the runtime once compiled.

Fixes #53641

Diff Detail

Event Timeline

jhuber6 requested review of this revision.Feb 7 2022, 1:44 PM
jhuber6 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2022, 1:44 PM
jdoerfert accepted this revision.Feb 7 2022, 1:47 PM

LG

openmp/libomptarget/DeviceRTL/include/State.h
142

Val is not used anymore, delete it.

This revision is now accepted and ready to land.Feb 7 2022, 1:47 PM
jdoerfert added inline comments.Feb 7 2022, 1:48 PM
openmp/libomptarget/DeviceRTL/include/State.h
142

My bad, it is used.

jhuber6 edited the summary of this revision. (Show Details)Feb 7 2022, 2:11 PM
This revision was automatically updated to reflect the committed changes.