[analyzer] Summary IPA thoughts +code

Hello Gabor,

We still use a file-by-file approach so we don't build a full AST but merging ASTs of analyzed callees only where possible. We build a mapping showing what file contains required functions. Then, we analyze a project file-by-file. During analysis, we import this definition to our TU if we meet a call with a callee definition in another file, and continue analysis as usually.

This approach seems to work. It should get much better performance after implementation of summary serialization due to summary inter-TU reusage. We don't build a full project AST but this is not a memory bottleneck: a real bottleneck currently is function summaries.

Currently we're working on upstreaming our ASTImporter work. This work is slow enough because it requires massive test writing (ASTImporter lacks tests now). But we hope, it will become available for all clang users who needs it.

Hi Aleksei,

Hello David,

You can find a mail archive page discussing this topic here:

If you have any questions, feel free to ask.

02.03.2016 17:25, David Come пишет:

Yes, you’re right. We made some benchmarks on Android source code and found it slower than we expected. I/O may be a reason because we use AST dumps that require some disk I/O. But it works. And yes, it is independent from IPA method. We didn’t do any I/O optimization yet, because we want to make it stable first. That’s possible, in theory. But in practice, we don’t import too many declarations before node limit is reached :slight_smile: