This is an archive of the discontinued LLVM Phabricator instance.

[DSE] Revisit pointers that may no longer escape after removing another store
ClosedPublic

Authored by aeubanks on Apr 13 2022, 9:39 AM.

Details

Summary

In dependent-capture, previously we'd see that %tmp4 is captured due to
the first store. We'd cache this info in CapturedBeforeReturn and
InvisibleToCallerAfterRet. Then the first store is then removed, causing
the cached values to be wrong.

We also need to revisit everything because normally we work backwards
when removing stores at the end of the function, but in this case
removing an earlier store causes a later store to be removable.

No compile time impact:
https://llvm-compile-time-tracker.com/compare.php?from=32f3633171aa9d7352e9507c12d219efb48899a0&to=f1dc620e55635a69250d011c1a9950c45a364264&stat=instructions

Diff Detail

Event Timeline

aeubanks created this revision.Apr 13 2022, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 9:39 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
aeubanks requested review of this revision.Apr 13 2022, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 9:39 AM
asbirlea accepted this revision.Jun 21 2022, 2:42 PM

LGTM.

This revision is now accepted and ready to land.Jun 21 2022, 2:42 PM

I am surprised that this doesn't have a noticeable compile-time impact on CTMark, but then it also doesn't cause any binary changes, so the test binaries there probably won't cause too many additional iterations. IIUC we should be able to at least safe 1 unnecessary extra iteration if we would check if an underlying object got removed from CapturedBeforeReturn?

aeubanks updated this revision to Diff 445058.Jul 15 2022, 10:49 AM

only rerun if we remove something from CapturedBeforeReturn

This revision was landed with ongoing or failed builds.Jul 19 2022, 9:31 AM
This revision was automatically updated to reflect the committed changes.
wenlei added a subscriber: wenlei.Jul 20 2022, 2:22 PM