This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO]Expose cache entry expiration time option in llvm-lto and fix a test
ClosedPublic

Authored by jhenderson on Sep 12 2018, 9:06 AM.

Details

Summary

Whilst working in the area, I noticed that two cases in a ThinLTO test were passing for the wrong reasons, since rL340374. The tests were supposed to be testing that files were being pruned due to the cache size, but they were in fact being pruned because they were older than the default expiration period of 1 week.

This change fixes the tests by explicitly setting the expiration time to the maximum value. This required the option to be exposed in llvm-lto.

Assigning all files in the cache a similar time, it is possible to see that the newest files are still being kept, and that we aren't passing for the wrong reason again. In the event that the entry expiration were to expire for them, then the test would start failing, because these files would be removed too.

Diff Detail

Repository
rL LLVM

Event Timeline

jhenderson created this revision.Sep 12 2018, 9:06 AM

Thanks! For the case where you don't want the files to expire, can you instead set the expiration age to 0? That should stop the pruner from removing them.

Thanks! For the case where you don't want the files to expire, can you instead set the expiration age to 0? That should stop the pruner from removing them.

Unfortunately, it's not possible to disable expiration age explicitly using llvm-lto. The interface it uses ignores attempts to set any of the cache options to 0, thus making it impossible to disable them completely if they are already set (and the expiration age is set by default). I don't know why the interface is this way, but it was a deliberate decision made some time ago.

rnk accepted this revision.Oct 2 2018, 9:16 AM

lgtm. llvm-lto is a testing tool, so it makes sense to expose whatever options the underlying LTO interface exposes.

This revision is now accepted and ready to land.Oct 2 2018, 9:16 AM
This revision was automatically updated to reflect the committed changes.