[PATCH] D12142: [PM/AA] Flesh out statistics to cover all the primary use cases of the old AliasAnalysisCounter pass.

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 19:17:51 PDT 2015


hfinkel added a comment.

In http://reviews.llvm.org/D12142#234840, @llvm-commits wrote:

> I'm OK working on doing that (I actually started there), but it looked like
>  I'd need to do a fair amount of work and it will slow me down...


The statistics are important, let's think this through. We need a few things (bikeshedding aside):

  struct AAStats {
    Statistic NumAliasQueries;
    Statistic NumNoAliasResults;
    ...
  
    // Statistics need a const char* description with a matching lifetime.
    std::string NumAliasQueriesName;
    std::string NumNoAliasResultsName;
    ...
  
    AAStats(const std::string &PassName) {
      NumAliasQueriesName = PassName + " 'alias' queries";
      NumNoAliasResultsName = PassName + " 'alias' queries resulting in 'NoAlias'";
      ...
  
      NumAliasQueries.construct(DEBUG_TYPE, NumAliasQueriesName.c_str());
      NumNoAliasResults.construct(DEBUG_TYPE, NumNoAliasResultsName.c_str());
      ...
    }
  };

Then we need some map inside the aggregator, from pass name to these structs, or just keep an array of them in the same order as the AA chain. Regardless, it seems like AAResults::Concept needs a getName() function, or if we keep them in an array (probably better), then addAAResult might need to take a name parameter. Regardless, then we can put all of the stats updating into the AAResults methods.

Are there some tricky lifetime issues regarding the statistics objects relative to AAResults? Do these really need to live in the wrapper pass for the legacy pass manager and in AAManager for the new one?

> How badly

>  do you want this now, and how much do you want to put it on my critical

>  path to moving forward? I don't have strong opinions here, I'm jsut looking

>  for the fastest way to make forward progress.

> 

> - F791528: msg-9822-68.txt <http://reviews.llvm.org/F791528>



http://reviews.llvm.org/D12142





More information about the llvm-commits mailing list