This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Simplify forgetSymbolicName() (NFCI)
ClosedPublic

Authored by nikic on Nov 19 2021, 10:01 AM.

Details

Summary

With the recently introduced tracking as well as D113349, we can greatly simplify forgetSymbolicName(). In fact, we can simply replace it with forgetMemoizedResults().

What forgetSymbolicName() used to do is to walk the IR use-def chain to find all SCEVs that mention the SymbolicName. However, thanks to use tracking, we can now determine the relevant SCEVs in a more direct way. D113349 is needed to also clear out the actual IR to SCEV mapping in ValueExprMap.

Diff Detail

Event Timeline

nikic created this revision.Nov 19 2021, 10:01 AM
nikic requested review of this revision.Nov 19 2021, 10:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2021, 10:01 AM
mkazantsev accepted this revision.Nov 21 2021, 8:16 PM
This revision is now accepted and ready to land.Nov 21 2021, 8:16 PM
This revision was automatically updated to reflect the committed changes.
Unknown Object (User) added a subscriber: Unknown Object (User).Oct 19 2022, 6:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 6:46 PM
Unknown Object (User) added a comment.Oct 19 2022, 6:47 PM

Thanks for the information! It's quite beneficial to me!
happy wheels game

tsaela added a subscriber: tsaela.EditedJul 10 2023, 8:08 PM

Hi Backrooms Game
Your help is much appreciated.

const SCEV *StartVal = getSCEV(StartValueV);

if (Start == StartVal) { 
  // Okay, for the entire analysis of this edge we assumed the PHI
  // to be symbolic.  We now need to go back and purge all of the
  // entries for the scalars that use the symbolic expression.
  forgetMemoizedResults(SymbolicName);
  insertValueToMap(PN, Shifted);