[PATCH] D54507: [ThinLTO] Handle chains of aliases

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 18:18:58 PST 2018


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

At -O0, globalopt is not run during the compile step, and we can have a
chain of an alias having an immediate aliasee of another alias. We were
not correctly summarizing this (we always got the base object when
recording the aliasee), and also not handling it properly in ThinLTO
dead stripping, which would only mark the base object as live. This
could result in the intermediate alias incorrectly being marked dead and
dropped to a declaration.

Fix by correctly representing an alias to another alias in the summary.
Also change the dead stripping computation so that it marks all aliases
in the chain as live.

This required adding a version of stripInBoundsOffsets() that doesn't
follow aliases (this is the interface called by getBaseObject, and we
want to be able to strip in bounds offsets from the immediate aliasee).


Repository:
  rL LLVM

https://reviews.llvm.org/D54507

Files:
  include/llvm/IR/ModuleSummaryIndex.h
  include/llvm/IR/Value.h
  lib/Analysis/ModuleSummaryAnalysis.cpp
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/IR/Value.cpp
  lib/Transforms/IPO/FunctionImport.cpp
  test/ThinLTO/X86/alias_to_alias.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54507.173973.patch
Type: text/x-patch
Size: 11473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181114/b7a52834/attachment.bin>


More information about the llvm-commits mailing list