This is an archive of the discontinued LLVM Phabricator instance.

[MemorySSA] Always perform MemoryUses liveOnEntry optimization on MSSA construction
ClosedPublic

Authored by aeubanks on Jun 13 2023, 2:38 PM.

Details

Summary

Fixes invariant memory regressions in future DSE patches.

Also add a flag to print<memoryssa> to not ensure optimized uses to test this.

Noticeable compile time regression [1], but a future DSE change that depends on this more than makes up for it.

[1] https://llvm-compile-time-tracker.com/compare.php?from=9d5466849a770eeab222d5a5890376d3596e8ad6&to=95682dbe11d76a3342870437377216e96b167504&stat=instructions:u

Diff Detail

Event Timeline

aeubanks created this revision.Jun 13 2023, 2:38 PM
aeubanks requested review of this revision.Jun 13 2023, 2:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2023, 2:38 PM
asbirlea added inline comments.Jun 14 2023, 12:31 PM
llvm/lib/Analysis/MemorySSA.cpp
368

Can you check if the the callsite in optimizeUses can be removed with this change?
I think the one in getClobbering needs to stay.

llvm/lib/Passes/PassBuilder.cpp
1058

nit: Simpify the test option to "no-optimized-uses".

aeubanks updated this revision to Diff 531479.Jun 14 2023, 1:21 PM
aeubanks marked an inline comment as done.

address comments
change MemorySSAPrinterPass option to not be negative

llvm/lib/Analysis/MemorySSA.cpp
368

removed, and yeah the one in getClobbering needs to stay when you invalidate an optimized access of a MemoryUse and then try and optimize it again

llvm/lib/Passes/PassBuilder.cpp
1058

that's can be misleading because if memoryssa was already optimized previously then it'll still be optimized

nikic added inline comments.Jun 14 2023, 1:23 PM
llvm/include/llvm/Analysis/MemorySSA.h
953

Mismatch in names

aeubanks updated this revision to Diff 531482.Jun 14 2023, 1:25 PM

fix mismatched names

This revision is now accepted and ready to land.Jun 14 2023, 1:36 PM
aeubanks edited the summary of this revision. (Show Details)Jun 14 2023, 2:21 PM
This revision was landed with ongoing or failed builds.Jul 6 2023, 2:10 PM
This revision was automatically updated to reflect the committed changes.