Go to file
Fangrui Song 7bafaf8ffe Reland "Change the timestamp of llvmcache-foo file to meet the thinLTO prune policy"
Summary:
It is difficult to touch a file with a relative mtime across different OSes as POSIX touch -d is rigid. While we may construct relative timestamps with `date`, POSIX date is inadequate to do so as various OSes' date do not agree on a common format (OpenBSD uses `date -r seconds`, FreeBSD uses `date -v-2M` while GNU accepts `-d '-2 min'`)

Just use python os.utime()

Original description:

    The case may randomly fail if we test it with command "
     while llvm-lit tools/lld/test/ELF/lto/cache.ll; do true; done". It is because the llvmcache-foo file is younger than llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6. But due to timestamp precision reason their timestamp is the same. Given the same timestamp, the file prune policy is to remove bigger size file first, so mostly foo file is removed for its bigger size. And the files size is under threshold after deleting foo file. That's what test case expect.

    However sometimes, the precision is enough to measure that timestamp of llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are smaller than foo, so llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are deleted first. Since the files size is still above the file size threshold after deleting the 2 files, the foo file is also deleted. And then the test case fails, because it expect only one file should be deleted instead of 3.

    The fix is to change the timestamp of llvmcache-foo file to meet the thinLTO prune policy.
    The same fix is applied to llvm code at https://reviews.llvm.org/D52452.

    Patch by Luo Yuanke.

Reviewers: ruiu, craig.topper, smaslov, Jianping, espindola, LuoYuanke, tejohnson

Reviewed By: tejohnson

Subscribers: sbc100, krytarowski, aheejin, llvm-commits, dexonsmith, steven_wu, arichardson, inglorion, emaste, bjope, rupprecht

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

llvm-svn: 346006
2018-11-02 17:44:30 +00:00
clang [CodeGen] Fix a crash when updating a designated initializer 2018-11-02 17:36:58 +00:00
clang-tools-extra [fix][clang-tidy] fix for r345961 that introduced a test failure on Windows builds 2018-11-02 16:36:21 +00:00
compiler-rt [NFC] Refactor initialisation of Darwin malloc zone fields into separate function called `InitMallocZoneFields()` which is now called from `ReplaceSystemMalloc()`. 2018-11-02 15:28:11 +00:00
debuginfo-tests Revert "(Retry) Add a basic integration test for C++ smart pointers" 2018-08-20 19:53:33 +00:00
libclc configure: Rework support for gfx9+ devices that were added post LLVM 3.9 2018-09-15 22:02:01 +00:00
libcxx Fix test assumption that Linux implies glibc. 2018-11-01 22:35:51 +00:00
libcxxabi Use C++11 fallthrough attribute syntax when available and add a break 2018-11-01 18:24:03 +00:00
libunwind [CMake] Link to compiler-rt if LIBUNWIND_USE_COMPILER_RT is ON. 2018-10-08 18:35:00 +00:00
lld Reland "Change the timestamp of llvmcache-foo file to meet the thinLTO prune policy" 2018-11-02 17:44:30 +00:00
lldb [FileSystem] Remove `SetFileSystem` method. 2018-11-02 17:34:17 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [ProfileSummary] Add options to override hot and cold count thresholds. 2018-11-02 17:39:31 +00:00
openmp [OPENMP][OFFLOADING]Change the lambda capturing flags. 2018-11-02 15:24:47 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly Fix clang -Wimplicit-fallthrough warnings across llvm, NFC 2018-11-01 19:54:45 +00:00
README.md Update the project name in README.md 2018-10-19 00:03:01 +00:00

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.