This is an archive of the discontinued LLVM Phabricator instance.

[CaptureTracking][NFCI] Expose capture tracking logic
ClosedPublic

Authored by jdoerfert on Mar 8 2022, 9:55 PM.

Details

Summary

The logic exposed by this patch via llvm::DetermineUseCaptureKind was
part of llvm::PointerMayBeCaptured. In the Attributor we want to keep
track of the work list items but still reuse the logic if a use might
capture a value. A follow up for the Attributor removes ~100 lines of
code and complexity while making future handling of simplified values
possible.

Diff Detail

Event Timeline

jdoerfert created this revision.Mar 8 2022, 9:55 PM
Herald added a project: Restricted Project. · View Herald Transcript
jdoerfert requested review of this revision.Mar 8 2022, 9:55 PM
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
nikic accepted this revision.Mar 9 2022, 12:26 AM

LGTM

llvm/include/llvm/Analysis/CaptureTracking.h
119

"the user" -> "the transitive uses"? We're inspecting the user either way.

This revision is now accepted and ready to land.Mar 9 2022, 12:26 AM
This revision was landed with ongoing or failed builds.Mar 11 2022, 8:56 PM
This revision was automatically updated to reflect the committed changes.
sidorovd added inline comments.
llvm/include/llvm/Analysis/CaptureTracking.h
113

Hi, while PASSTHROUGH seems to be a good name for the enum value, it so happened, that it is also a macro defined in wingdi.h (which is included in windows.h). Can we consider renaming it or we should guard/undef the macro in the downstream?

jdoerfert added inline comments.Mar 14 2022, 2:58 PM
llvm/include/llvm/Analysis/CaptureTracking.h
113

Rename it here and in all use sites. I guess we could add UCK_ ad prefix, or make it something like USER_MAY_CAPTURE.