This is an archive of the discontinued LLVM Phabricator instance.

ELF: Add cache pruning support.
ClosedPublic

Authored by pcc on Mar 15 2017, 7:58 PM.

Details

Summary

This patch causes us to use pruneCache() to prune the ThinLTO cache after
completing LTO. A new flag --thinlto-cache-policy allows users to configure
the policy.

Depends on D31020

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Mar 15 2017, 7:58 PM
mehdi_amini added inline comments.Mar 15 2017, 8:08 PM
lld/ELF/LTO.cpp
167 ↗(On Diff #91969)

Not interested in adding a CachePolicy on the config and having this at the end of the LTO process?

pcc added inline comments.Mar 15 2017, 8:12 PM
lld/ELF/LTO.cpp
167 ↗(On Diff #91969)

I thought about doing something like that, but I couldn't see a clean way to do it, as the LTO implementation is supposed to be independent of the type of cache being used.

mehdi_amini added inline comments.Mar 15 2017, 8:14 PM
lld/ELF/LTO.cpp
167 ↗(On Diff #91969)

Fair!

ruiu accepted this revision.Mar 16 2017, 7:21 PM

LGTM

lld/ELF/Config.h
165 ↗(On Diff #91969)

Should be moved to line 76.

lld/ELF/Driver.cpp
590 ↗(On Diff #91969)

"-thinlto-cache-policy: invalid cache policy"

This revision is now accepted and ready to land.Mar 16 2017, 7:21 PM
This revision was automatically updated to reflect the committed changes.