The patch templatize PriorityInlinerOrder so that it can accept any type priority metric.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/IPO/Inliner.cpp | ||
---|---|---|
873–877 | How about packaging the type int, isMoraDesirable, and evaluate into one class? class Priority { public: static bool isMoreDesirable(const Priority &S1, const Priority &S2) { return S1.size < S2.size; } static Priority evaluate(CallBase *CB) { ... } int size; }; This way, we don't have to pass individual components to PriorityInlineOrder. Once you do this, you should be able to your original definition of cmp more or less restore like so: static bool cmp(const T &P1, const T &P2) { return Priority::isMoreDesirable(P2.second, P1.second); } |
This comment was removed by taolq.
How about packaging the type int, isMoraDesirable, and evaluate into one class?
This way, we don't have to pass individual components to PriorityInlineOrder.
Once you do this, you should be able to your original definition of cmp more or less restore like so: