[lld] r306126 - Add a ThinLTO cache policy for controlling the maximum cache size in bytes.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 10:05:04 PDT 2017


Author: pcc
Date: Fri Jun 23 12:05:03 2017
New Revision: 306126

URL: http://llvm.org/viewvc/llvm-project?rev=306126&view=rev
Log:
Add a ThinLTO cache policy for controlling the maximum cache size in bytes.

This is useful when an upper limit on the cache size needs to be
controlled independently of the amount of the amount of free space.

One use case is a machine with a large number of cache directories
(e.g. a buildbot slave hosting a large number of independent build
jobs). By imposing an upper size limit on each cache directory,
users can more easily estimate the server's capacity.

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

Modified:
    lld/trunk/test/ELF/lto/cache.ll

Modified: lld/trunk/test/ELF/lto/cache.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/cache.ll?rev=306126&r1=306125&r2=306126&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/cache.ll (original)
+++ lld/trunk/test/ELF/lto/cache.ll Fri Jun 23 12:05:03 2017
@@ -12,6 +12,17 @@
 ; Two cached objects, plus a timestamp file and "foo", minus the file we removed.
 ; RUN: ls %t.cache | count 4
 
+; Create a file of size 64KB.
+; RUN: %python -c "print ' ' * 65536" > %t.cache/llvmcache-foo
+
+; This should leave the file in place.
+; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k -o %t3 %t2.o %t.o
+; RUN: ls %t.cache | count 5
+
+; This should remove it.
+; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=32k -o %t3 %t2.o %t.o
+; RUN: ls %t.cache | count 4
+
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 




More information about the llvm-commits mailing list