[PATCH] D18986: [ThinLTO] Prevent importing of "llvm.used" values

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 12:13:06 PDT 2016


tejohnson created this revision.
tejohnson added a reviewer: joker.eph.
tejohnson added subscribers: llvm-commits, pcc.
Herald added a subscriber: joker.eph.

This patch prevents importing from (and therefore exporting from) any
module with a "llvm.used" local value. Local values need to be promoted
and renamed when importing, and their presense on the llvm.used variable
indicates that there are opaque uses that won't see the rename. One such
example is a use in inline assembly.

See also the discussion at:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098047.html

As part of this, move collectUsedGlobalVariables out of Transforms/Utils
and into IR/Module so that it can be used more widely. There are several
other places in LLVM that used copies of this code that can be cleaned
up as a follow on NFC patch.

http://reviews.llvm.org/D18986

Files:
  include/llvm/IR/Module.h
  include/llvm/Transforms/Utils/ModuleUtils.h
  lib/Analysis/ModuleSummaryAnalysis.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/IR/Module.cpp
  lib/Transforms/IPO/GlobalOpt.cpp
  lib/Transforms/IPO/Internalize.cpp
  lib/Transforms/Utils/FunctionImportUtils.cpp
  lib/Transforms/Utils/ModuleUtils.cpp
  test/Transforms/FunctionImport/Inputs/inlineasm.ll
  test/Transforms/FunctionImport/inlineasm.ll
  tools/gold/gold-plugin.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18986.53303.patch
Type: text/x-patch
Size: 10076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160411/e7cddfc5/attachment.bin>


More information about the llvm-commits mailing list