This is an archive of the discontinued LLVM Phabricator instance.

[InlineCost] make InlineCost assignable
ClosedPublic

Authored by fedor.sergeev on Jun 26 2019, 7:34 AM.

Details

Summary

Current InlineCost is not assignable because of const members Cost and Threshold.
I dont see practical benefits from having them const (access to these members is
private and internal interactions are rather simple). On other hand that makes
it hard to use as a member in some other data structure where assignability is necessary.

I'm going to use InlineCost in a downstream inliner that maintains a complex queue
of candidate call-sites and thus keeping and recalculating InlineCost is necessary.

This patch just removes 'const' from both members, making InlineCost assignable.

Diff Detail

Repository
rL LLVM

Event Timeline

fedor.sergeev created this revision.Jun 26 2019, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2019, 7:34 AM
Herald added a subscriber: haicheng. · View Herald Transcript
apilipenko accepted this revision.Jun 27 2019, 1:53 PM

Even though it's motivated by downstream code, looks harmless to change upstream.

This revision is now accepted and ready to land.Jun 27 2019, 1:53 PM
This revision was automatically updated to reflect the committed changes.