This is an archive of the discontinued LLVM Phabricator instance.

[docs][NewPM] Add more info on why accessing mutable outer analyses is disallowed
ClosedPublic

Authored by aeubanks on Jun 22 2022, 12:41 PM.

Diff Detail

Event Timeline

aeubanks created this revision.Jun 22 2022, 12:41 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: awarzynski. · View Herald Transcript
aeubanks requested review of this revision.Jun 22 2022, 12:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2022, 12:41 PM
rnk accepted this revision.Jun 22 2022, 1:53 PM

lgtm

Thanks for expanding our docs!

llvm/docs/NewPassManager.rst
329–330

I would skip the second alternative. Leaving pointers to freed data as cache keys is unsafe at any speed. The only two solutions that work are to not use the inner analysis, or to clear the results for a function before it is deleted.

Personally, I like to call this problem "the ABA problem", but Wikipedia says that has to do with concurrency, not cache keys.

This revision is now accepted and ready to land.Jun 22 2022, 1:53 PM
asbirlea accepted this revision.Jun 22 2022, 11:15 PM

Thank you for adding this information!!

aeubanks marked an inline comment as done.Jun 23 2022, 10:05 AM
This revision was landed with ongoing or failed builds.Jun 23 2022, 10:06 AM
This revision was automatically updated to reflect the committed changes.