This is an archive of the discontinued LLVM Phabricator instance.

[Assignment Tracking] Give -fexperimental-assignment-tracking flag 3 options
ClosedPublic

Authored by Orlando on Mar 22 2023, 2:56 AM.

Details

Summary

Without this patch assignment tracking is enabled with -fexperimental-assignment-tracking and disabled with -fno-experimental-assignment-tracking (default). This patch removes the -fno- version and changes -fexperimental-assignment-tracking to take 3 values: enabled, disabled (default), and forced.

clang -Xclang -fexperimental-assignment-tracking=enabled enables the feature if some other conditions are met and =forced enables it without any further checks.

If enabled is specified the feature will remain disabled if any of the following are true: it's an LTO or ThinLTO build, optimisations are not enabled, or lldb debugger tuning has been specified. See this short RFC for more info.

Diff Detail

Event Timeline

Orlando created this revision.Mar 22 2023, 2:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 2:56 AM
Herald added a subscriber: ormris. · View Herald Transcript
Orlando requested review of this revision.Mar 22 2023, 2:56 AM
jryans added inline comments.Mar 28 2023, 6:05 AM
clang/lib/CodeGen/BackendUtil.cpp
855

Do we know any details on the connection between assignment tracking and that LLDB issue...? The LLDB issue as written at the moment seems quite general and appears to pre-date assignment tracking...

Ah, I suppose it's this bit from your earlier RFC:

LLDB doesn’t appear to interpret variable locations made up of DW_OP_piece (generated in expressions using DW_OP_LLVM_fragment) correctly if parts of the variable have no location.

Hmm, I guess to me it feels like we're being a bit too conservative by disabling assignment tracking for this LLDB issue, but I'm not sure what LLDB people would say about it.

If we do proceed with disabling assignment tracking when LLDB tuning is used, it would be good to at least update the LLDB issue with more details about this and to highlight there's now an entire new analysis that's waiting on this issue to be fixed.

Orlando added inline comments.Mar 28 2023, 6:21 AM
clang/lib/CodeGen/BackendUtil.cpp
855

If we do proceed with disabling assignment tracking when LLDB tuning is used, it would be good to at least update the LLDB issue with more details about this and to highlight there's now an entire new analysis that's waiting on this issue to be fixed.

That sounds reasonable to me - I have pinged the issue with this information! Thanks for raising this point.

jmorse accepted this revision.Mar 28 2023, 7:56 AM

I agree with @jryans analysis, otherwise LGTM, you might want to wait a bit for input from @probinson who enjoys looking at clang-switch tests.

clang/test/CodeGen/assignment-tracking/flag.cpp
59–63

NB: the "DISABLE" prefix should check for something, at least "-cc1", to ensure that empty inputs aren't vacuously accepted.

This revision is now accepted and ready to land.Mar 28 2023, 7:56 AM
This revision was landed with ongoing or failed builds.Mar 29 2023, 4:50 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2023, 4:50 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Orlando marked an inline comment as done.Mar 29 2023, 4:51 AM