[PATCH] D57470: [ThinLTO] Restructor AliasSummary to contain ValueInfo of Aliasee

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 13:43:20 PST 2019


tejohnson created this revision.
tejohnson added reviewers: pcc, mehdi_amini.
Herald added subscribers: arphaman, dexonsmith, steven_wu, eraman, inglorion.

The AliasSummary previously contained the AliaseeGUID, which was only
populated when reading the summary from bitcode. This patch changes it
to instead hold the ValueInfo of the aliasee, and always populates it.
This enables more efficient access to the ValueInfo (specifically in the
recent patch r352438 which needed to perform an index hash table lookup
using the aliasee GUID).

As noted in the comments in AliasSummary, we no longer technically need
to keep a pointer to the corresponding aliasee summary, since it could
be obtained by walking the list of summaries on the ValueInfo looking
for the summary in the same module. However, I am concerned that this
would be inefficient when walking through the index during the thin
link for various analyses. That can be reevaluated in the future.

By always populating this new field, we can remove the guard and special
handling for a 0 aliasee GUID when dumping the dot graph of the summary.

An additional improvement in this patch is when reading the summaries
from LLVM assembly we now set the AliaseeSummary field to the aliasee
summary in that same module, which makes it consistent with the behavior
when reading the summary from bitcode.


Repository:
  rL LLVM

https://reviews.llvm.org/D57470

Files:
  include/llvm/IR/ModuleSummaryIndex.h
  lib/Analysis/ModuleSummaryAnalysis.cpp
  lib/AsmParser/LLParser.cpp
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/IR/ModuleSummaryIndex.cpp
  lib/Transforms/IPO/FunctionImport.cpp
  test/ThinLTO/X86/dot-dumper.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57470.184359.patch
Type: text/x-patch
Size: 11601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190130/2d9397b2/attachment.bin>


More information about the llvm-commits mailing list