This is an archive of the discontinued LLVM Phabricator instance.

Support: Add a cache pruning policy parser.
ClosedPublic

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

Details

Summary

The idea is that the policy string fully specifies the policy and is portable
between clients.

Event Timeline

pcc created this revision.Mar 15 2017, 7:57 PM
mehdi_amini accepted this revision.Mar 15 2017, 8:03 PM

Neat! LGTM.

llvm/include/llvm/LTO/Caching.h
23

Do all the clients of this header need this declaration? I found strange that nothing changes in the header but this is needed.

llvm/include/llvm/Support/CachePruning.h
47

Could you add an example syntax here?

llvm/lib/Support/CachePruning.cpp
37

Why "Interval"? It seems that you're parsing a "time" or a "duration"?

98

StringSwitch? I guess it does not play well with the error to return...

This revision is now accepted and ready to land.Mar 15 2017, 8:03 PM
pcc marked an inline comment as done.Mar 15 2017, 8:54 PM
pcc added inline comments.
llvm/include/llvm/LTO/Caching.h
23

This was an unintentional change, I've reverted it.

llvm/lib/Support/CachePruning.cpp
37

They're synonyms for the most part, but it looks like "duration" is the term used by the stdlib and distinguishes from the pruning interval, so I've switched to it.

98

Right, I guess I'd have to go through contortions in this code that would outweigh the value of StringSwitch IMHO.

This revision was automatically updated to reflect the committed changes.
mehdi_amini added inline comments.Mar 15 2017, 9:04 PM
llvm/lib/Support/CachePruning.cpp
37

OK.
(maybe because I'm not a native speaker, I thought about "interval" as being synonym to "range", so rather having a begin and an end)