[PATCH] D21475: [CFLAA] Summarize interprocedural aliasing information instead of recomputing it at callsite

Jia Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 10:02:30 PDT 2016


grievejia created this revision.
grievejia added reviewers: george.burgess.iv, hfinkel.
grievejia added a subscriber: llvm-commits.

The primary goal of this patch is to put parameters/return value aliasing info of each function to its summary. Those info used to get computed at each callsite where the function gets invoked. If the said function gets invoked many times, we may end up with lots of redundant computations.

This patch is almost functionality-preserving, except that I've changed the criteria of marking a function f external from "f->hasLocalLinkage()" to "f->isInterposable()". I think the former is overly conservative since it only handles functions with internal or private linkage type, yet all we want for non-external functions is that they can't be overwritten while linking. If my thought turns out to be wrong, I'm happy to switch it back. 

I've also made struct type CFLAAResult::FunctionInfo public. The reason is that I want a static free-function buildFunctionInfo() as well as GetEdgeVisitor::tryInterproceduralAnalysis() to access the FunctionInfo struct. I acknowledge that this is not neat, and I'm happy to be told a cleaner solution.

Finally, various test cases on interprocedural analysis were added. Unfortunately, some of them showed that our current handling of function calls/returns is very buggy. For now I've marked those tests as XFAIL, and subsequent patches will primarily focus on removing the XFAILs gradually.

http://reviews.llvm.org/D21475

Files:
  include/llvm/Analysis/CFLAliasAnalysis.h
  lib/Analysis/CFLAliasAnalysis.cpp
  test/Analysis/CFLAliasAnalysis/basic-interproc-ret.ll
  test/Analysis/CFLAliasAnalysis/basic-interproc.ll
  test/Analysis/CFLAliasAnalysis/interproc-ret-arg.ll
  test/Analysis/CFLAliasAnalysis/interproc-ret-deref-arg-multilevel.ll
  test/Analysis/CFLAliasAnalysis/interproc-ret-deref-arg.ll
  test/Analysis/CFLAliasAnalysis/interproc-ret-ref-arg-multilevel.ll
  test/Analysis/CFLAliasAnalysis/interproc-ret-ref-arg.ll
  test/Analysis/CFLAliasAnalysis/interproc-ret-unknown.ll
  test/Analysis/CFLAliasAnalysis/interproc-store-arg-multilevel.ll
  test/Analysis/CFLAliasAnalysis/interproc-store-arg-unknown.ll
  test/Analysis/CFLAliasAnalysis/interproc-store-arg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21475.61106.patch
Type: text/x-patch
Size: 30956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160617/17661afb/attachment.bin>


More information about the llvm-commits mailing list