This patch makes MemoryUse/MemoryDef of MemorySSA print OptimizedAccessType if they're set.
Any comments are welcome.
Differential D47860
Print OptimizedAccessType in MemorySSA if it is set aqjune on Jun 6 2018, 5:52 PM. Authored by
Details This patch makes MemoryUse/MemoryDef of MemorySSA print OptimizedAccessType if they're set. Any comments are welcome.
Diff Detail Event TimelineComment Actions Hi, and thanks for this patch! I'm unsure if we want to print this out for Defs without adding a bit more information to MemoryDef::print. This is because MemoryUses and MemoryDefs both print out their defining accesses, and getOptimizedAccessType() returns information about the optimized access of a Use or Def. For Uses, the optimized access *is* the defining access, so I think this is a great addition. For Defs, we don't really print whether or not it's optimized at all right now; it seems a bit awkward to say "the optimized Access type is MayAlias, but we're not going to tell you what the optimized access is". So, please either back out the change to MemoryDef::print, or have MemoryDef::print print out where the Def is optimized to, if it's been optimized. I'm happy with either of these. :)
Comment Actions
Comment Actions This LGTM after one last ultra-small nitpick is addressed. I don't see you in the commit logs, so will you need me to commit this for you?
Comment Actions (Sorry for the double-post; one more bit that I noticed scrolling up)
Comment Actions
TIL phab will complain about this. To save any code archaeologists some time, this LGTM. Committed as noted by Phab. Thanks again! |
Hm. Does it break anything to make this function a raw_ostream &operator<<(raw_ostream &, AliasResult) that we stick into lib/Analysis/AliasAnalysis.cpp (with a declaration in include/llvm/Analysis/AliasAnalysis.cpp)?
I ask because this seems useful to just about anyone who wants to print an AliasResult. :)