This is an archive of the discontinued LLVM Phabricator instance.

[LiveDebugValues] Remove PendingInLocs (NFCI)
ClosedPublic

Authored by nikic on May 30 2020, 7:28 AM.

Details

Summary

While trying to understand this code, I was confused about what the purpose of PendingInLocs is. As far as I can see, it ends up having the same result as InLocs, just computed in a more roundabout way. Am I missing something here?

With PendingInLocs gone, the computation of the Diff and Removed sets also seems unnecessary, and we can just compare if the old and the new set are the same.

Diff Detail

Event Timeline

nikic created this revision.May 30 2020, 7:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2020, 7:28 AM
jmorse accepted this revision.Jun 1 2020, 8:23 AM

Hrrrmmmm. I think you're right -- IIRC, I originally added the "Pending" stuff, because I'd noticed that LiveDebugValues would need to delete locations as well as add them, to be correct (see rG0ae549814693eb2), and the "Pending" flags got that done without affecting the rest of the pass. However, the main InLocs has since taken responsibility of that problem, so the Pending stuff is redundant. This patch would trip live-debug-values-remove-range.ll if that wasn't true. I built stage2 clang with rGdace8224f38a3, with and without this patch, and got identical binaries.

Please leave this ~24h in case there are more comments.

I've uploaded my view of what LiveDebugValues is doing in D80929 in case that's helpful; I think it accurately summarises the discussion in D67500.

This revision is now accepted and ready to land.Jun 1 2020, 8:23 AM
vsk accepted this revision.Jun 1 2020, 9:30 AM

@nikic Thanks!

djtodoro accepted this revision.Jun 1 2020, 11:08 PM
This revision was automatically updated to reflect the committed changes.