OSDN Git Service

[ThinLTO] Ensure anonymous globals renamed even at -O0
authorTeresa Johnson <tejohnson@google.com>
Sat, 17 Sep 2016 20:40:16 +0000 (20:40 +0000)
committerTeresa Johnson <tejohnson@google.com>
Sat, 17 Sep 2016 20:40:16 +0000 (20:40 +0000)
commitb6d6773710e3e9664a2fb809e3af80c2ce67a6db
tree7005c622a1c41f7b1091d79b9d26ffd8e979d405
parent1982c8eed73cb8ff43d2f3fce5f6fe4b516e53e9
[ThinLTO] Ensure anonymous globals renamed even at -O0

Summary:
This fixes an issue when files are compiled with -flto=thin
at default -O0. We need to rename anonymous globals before attempting
to write the module summary because all values need names for
the summary. This was happening at -O1 and above, but not before
the early exit when constructing the pipeline for -O0.

Also add an internal -prepare-for-thinlto option to enable this
to be tested via opt.

Fixes PR30419.

Reviewers: mehdi_amini

Subscribers: probinson, llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D24701

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281840 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/PassManagerBuilder.cpp
test/Transforms/NameAnonGlobals/rename.ll