[PATCH] D35081: [ThinLTO] Allow multiple summary entries.

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 13 09:09:55 PDT 2017


tejohnson added a comment.

In https://reviews.llvm.org/D35081#808124, @mehdi_amini wrote:

> Teresa: can you describe a bit more how we end up importing two summaries for the same GUID? I would expect that after importing one, we don't even come to try to import another since we already have one.


Because of this:
http://llvm-cs.pcc.me.uk/lib/Transforms/IPO/FunctionImport.cpp#261

  /// Since the traversal of the call graph is DFS, we can revisit a function
  /// a second time with a higher threshold. In this case, it is added back to
  /// the worklist with the new threshold.

The goal is that if we revisit with a higher threshold (which we do in the test case), that we want to reconsider downstream callees again. E.g. if we have foo() calls bar() calls baz(), and we first decided to import bar() into foo's module, but the threshold was not high enough to import baz, if we later encounter this call from foo->bar again with a higher threshold (because we hit it on a path that was either hotter or shorter), we want to reconsider whether to import baz().

The issue here is that when we reconsider "foo" we pick a different copy (earlier in the list, but skipped initially due to having an instruction count above the first (lower) threshold).


https://reviews.llvm.org/D35081





More information about the cfe-commits mailing list