This noticeably increases compile times [1], but is necessary for not regressing a follow-up change to DSE that saves much more compile time.
Also update some places that assumed that all loads have a corresponding MemoryUse.
|  Differential  D152743  
[AliasAnalysis] Return NoModRef for loads from constant memory Authored by aeubanks on Jun 12 2023, 12:24 PM. 
Details This noticeably increases compile times [1], but is necessary for not regressing a follow-up change to DSE that saves much more compile time. Also update some places that assumed that all loads have a corresponding MemoryUse. 
Diff Detail 
 
Unit Tests 
 Event TimelineComment Actions I'm concerned that this will cause us problems in the future, e.g. if we want to do MemorySSA-based GVN, because we will no longer have MemoryUses for these loads at all, even though we may want to do load CSE on them. 
 
 Comment Actions why is having a MemoryUse necessary for load CSE? can't you CSE loads of the same pointer that don't have a MemoryUse? 
 Comment Actions I think the issue is we can no longer determine when a true read happens. 
 
 Comment Actions I think it's mostly a question of allowing uniform handling: Once you work on MSSA it is convenient if all your loads/stores are represented as memory accesses. Not having MemoryUses for invariant loads doesn't fundamentally prevent doing load CSE for them, but probably makes it a good bit more awkward. (It's something of a speculative concern though, as I don't think we really have an accepted approach on how MSSA should be introduced in GVN...) 
 I think I'd prefer this approach. 
 
 
 
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Should probably use Loc rather than MemoryLocation::get(L) here, just like all the other methods?