[llvm] r268393 - Provide some default values for the ThinLTO Cache pruning
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Tue May 3 08:17:50 PDT 2016
Author: mehdi_amini
Date: Tue May 3 10:17:50 2016
New Revision: 268393
URL: http://llvm.org/viewvc/llvm-project?rev=268393&view=rev
Log:
Provide some default values for the ThinLTO Cache pruning
This control how the cache is pruned. The cache still has to
be explicitely enabled/disabled by providing a path.
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/include/llvm-c/lto.h
llvm/trunk/include/llvm/LTO/ThinLTOCodeGenerator.h
Modified: llvm/trunk/include/llvm-c/lto.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/lto.h?rev=268393&r1=268392&r2=268393&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/lto.h (original)
+++ llvm/trunk/include/llvm-c/lto.h Tue May 3 10:17:50 2016
@@ -659,6 +659,7 @@ extern lto_bool_t thinlto_codegen_set_pi
/**
* Sets the path to a directory to use as a cache storage for incremental build.
+ * Setting this activates caching.
*
* \since LTO_API_VERSION=18
*/
@@ -667,7 +668,7 @@ extern void thinlto_codegen_set_cache_di
/**
* Sets the cache pruning interval (in seconds). A negative value disable the
- * pruning (default).
+ * pruning. An unspecified default value will be applied.
*
* \since LTO_API_VERSION=18
*/
@@ -678,7 +679,8 @@ extern void thinlto_codegen_set_cache_pr
* Sets the maximum cache size that can be persistent across build, in terms of
* percentage of the available space on the the disk. Set to 100 to indicate
* no limit, 50 to indicate that the cache size will not be left over half the
- * available space. A value over 100 will be reduced to 100.
+ * available space. A value over 100 will be reduced to 100. An unspecified
+ * default value will be applied.
*
* The formula looks like:
* AvailableSpace = FreeSpace + ExistingCacheSize
@@ -690,7 +692,8 @@ extern void thinlto_codegen_set_final_ca
thinlto_code_gen_t cg, unsigned percentage);
/**
- * Sets the expiration (in seconds) for an entry in the cache.
+ * Sets the expiration (in seconds) for an entry in the cache. An unspecified
+ * default value will be applied.
*
* \since LTO_API_VERSION=18
*/
Modified: llvm/trunk/include/llvm/LTO/ThinLTOCodeGenerator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/ThinLTOCodeGenerator.h?rev=268393&r1=268392&r2=268393&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/ThinLTOCodeGenerator.h (original)
+++ llvm/trunk/include/llvm/LTO/ThinLTOCodeGenerator.h Tue May 3 10:17:50 2016
@@ -108,10 +108,10 @@ public:
*/
struct CachingOptions {
- std::string Path;
- int PruningInterval = -1; // seconds, -1 to disable pruning
- unsigned int Expiration = 0; // seconds.
- unsigned MaxPercentageOfAvailableSpace = 0; // percentage.
+ std::string Path; // Path to the cache, empty to disable.
+ int PruningInterval = 1200; // seconds, -1 to disable pruning.
+ unsigned int Expiration = 7 * 24 * 3600; // seconds (1w default).
+ unsigned MaxPercentageOfAvailableSpace = 75; // percentage.
};
/// Provide a path to a directory where to store the cached files for
More information about the llvm-commits
mailing list