Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 3940160

Browse files
committed
LTO: Include live bit in ThinLTO cache key.
As of r323633, this bit started controlling whether symbol definitions appear in object files, and it also became sensitive to the prevailing bit, so it needs to be included in the key. Differential Revision: https://reviews.llvm.org/D43109 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324711 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c37c34b commit 3940160

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

lib/LTO/LTO.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ static void computeCacheKey(
177177

178178
auto AddUsedThings = [&](GlobalValueSummary *GS) {
179179
if (!GS) return;
180+
AddUnsigned(GS->isLive());
180181
for (const ValueInfo &VI : GS->refs()) {
181182
AddUnsigned(VI.isDSOLocal());
182183
AddUsedCfiGlobal(VI.getGUID());
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; Tests whether the cache is sensitive to the prevailing bit.
2+
; RUN: rm -rf %t.cache
3+
; RUN: opt -module-hash -module-summary -o %t.bc %s
4+
; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache \
5+
; RUN: -r %t.bc,foo,p -r %t.bc,bar,px
6+
; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache \
7+
; RUN: -r %t.bc,foo, -r %t.bc,bar,px
8+
; RUN: ls %t.cache | count 2
9+
10+
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
11+
target triple = "x86_64-pc-windows-msvc19.11.0"
12+
13+
@foo = linkonce_odr constant i32 1, comdat
14+
$foo = comdat any
15+
16+
define i32* @bar() {
17+
ret i32* @foo
18+
}

0 commit comments

Comments
 (0)