{"push_id":786574864,"size":2,"distinct_size":2,"ref":"refs/heads/master","head":"b3183697e968168e97739c857a362d80d2d74629","before":"0f155431c6ef11c38866981e6a021be1855d306e","commits":[{"sha":"01d814f37c07d5f65945b9ac72564078d2eb6b07","author":{"email":"420c9fb3407b8e11ac322a0e7703f7b1f526df04@gmail.com","name":"Chandler Carruth"},"message":"[PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible\nwith the new pass manager, and no longer relying on analysis groups.\n\nThis builds essentially a ground-up new AA infrastructure stack for\nLLVM. The core ideas are the same that are used throughout the new pass\nmanager: type erased polymorphism and direct composition. The design is\nas follows:\n\n- FunctionAAResults is a type-erasing alias analysis results aggregation\n  interface to walk a single query across a range of results from\n  different alias analyses. Currently this is function-specific as we\n  always assume that aliasing queries are *within* a function.\n\n- AAResultBase is a CRTP utility providing stub implementations of\n  various parts of the alias analysis result concept, notably in several\n  cases in terms of other more general parts of the interface. This can\n  be used to implement only a narrow part of the interface rather than\n  the entire interface. This isn't really ideal, this logic should be\n  hoisted into FunctionAAResults as currently it will cause\n  a significant amount of redundant work, but it faithfully models the\n  behavior of the prior infrastructure.\n\n- All the alias analysis passes are ported to be wrapper passes for the\n  legacy PM and new-style analysis passes for the new PM with a shared\n  result object. In some cases (most notably CFL), this is an extremely\n  naive approach that we should revisit when we can specialize for the\n  new pass manager.\n\n- BasicAA has been restructured to reflect that it is much more\n  fundamentally a function analysis because it uses dominator trees and\n  loop info that need to be constructed for each function.\n\nAll of the references to getting alias analysis results have been\nupdated to use the new aggregation interface. All the preservation and\nother pass management code has been updated accordingly.\n\nThe way the FunctionAAResultsWrapperPass works is to detect the\navailable alias analyses when run, and add them to the results object.\nThis means that we should be able to continue to respect when various\npasses are added to the pipeline, for example adding CFL or adding TBAA\npasses should just cause their results to be available and to get folded\ninto this. The exception to this rule is BasicAA which really needs to\nbe a function pass due to using dominator trees and loop info. As\na consequence, the FunctionAAResultsWrapperPass directly depends on\nBasicAA and always includes it in the aggregation.\n\nThis has significant implications for preserving analyses. Generally,\nmost passes shouldn't bother preserving FunctionAAResultsWrapperPass\nbecause rebuilding the results just updates the set of known AA passes.\nThe exception to this rule are LoopPass instances which need to preserve\nall the function analyses that the loop pass manager will end up\nneeding. This means preserving both BasicAAWrapperPass and the\naggregating FunctionAAResultsWrapperPass.\n\nNow, when preserving an alias analysis, you do so by directly preserving\nthat analysis. This is only necessary for non-immutable-pass-provided\nalias analyses though, and there are only three of interest: BasicAA,\nGlobalsAA (formerly GlobalsModRef), and SCEVAA. Usually BasicAA is\npreserved when needed because it (like DominatorTree and LoopInfo) is\nmarked as a CFG-only pass. I've expanded GlobalsAA into the preserved\nset everywhere we previously were preserving all of AliasAnalysis, and\nI've added SCEVAA in the intersection of that with where we preserve\nSCEV itself.\n\nOne significant challenge to all of this is that the CGSCC passes were\nactually using the alias analysis implementations by taking advantage of\na pretty amazing set of loop holes in the old pass manager's analysis\nmanagement code which allowed analysis groups to slide through in many\ncases. Moving away from analysis groups makes this problem much more\nobvious. To fix it, I've leveraged the flexibility the design of the new\nPM components provides to just directly construct the relevant alias\nanalyses for the relevant functions in the IPO passes that need them.\nThis is a bit hacky, but should go away with the new pass manager, and\nis already in many ways cleaner than the prior state.\n\nAnother significant challenge is that various facilities of the old\nalias analysis infrastructure just don't fit any more. The most\nsignificant of these is the alias analysis 'counter' pass. That pass\nrelied on the ability to snoop on AA queries at different points in the\nanalysis group chain. Instead, I'm planning to build printing\nfunctionality directly into the aggregation layer. I've not included\nthat in this patch merely to keep it smaller.\n\nNote that all of this needs a nearly complete rewrite of the AA\ndocumentation. I'm planning to do that, but I'd like to make sure the\nnew design settles, and to flesh out a bit more of what it looks like in\nthe new pass manager first.\n\nDifferential Revision: http://reviews.llvm.org/D12080","distinct":true,"url":"https://api.github.com/repos/llvm-project/llvm-project-submodule/commits/01d814f37c07d5f65945b9ac72564078d2eb6b07"},{"sha":"b3183697e968168e97739c857a362d80d2d74629","author":{"email":"7f3b563762cedf85ff9ce23cb18b85fca5cd6be1@google.com","name":"Rui Ueyama"},"message":"ELF2: Reduce nesting by returning early. NFC.","distinct":true,"url":"https://api.github.com/repos/llvm-project/llvm-project-submodule/commits/b3183697e968168e97739c857a362d80d2d74629"}]}