This is an archive of the discontinued LLVM Phabricator instance.

[IRSim][IROutliner] Adding a cost model, and debug option to turn the model off.
ClosedPublic

Authored by AndrewLitteken on Sep 8 2020, 10:17 AM.

Details

Summary

This adds a cost model that takes into account the total number of machine instructions to be removed from each region, the number of instructions added by adding a new function with a set of instructions, and the instructions added by handling arguments.

Tests not adding flags:

  • llvm/test/Transforms/IROutliner/outlining-cost-model.ll

Diff Detail

Event Timeline

AndrewLitteken created this revision.Sep 8 2020, 10:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2020, 10:17 AM
AndrewLitteken requested review of this revision.Sep 8 2020, 10:17 AM
jroelofs added inline comments.
llvm/lib/Transforms/IPO/IROutliner.cpp
1588

What's the benefit from having this member variable as opposed to just reading the option directly where needed?

llvm/lib/Transforms/IPO/IROutliner.cpp
1588

It seems like something that might need to be referenced in either the interface file at some point, or somewhere that is not the main file. Since the command line option is static, it can't be accessed if it's not in the class.

jroelofs accepted this revision.Sep 14 2020, 12:51 PM

LGTM

llvm/lib/Transforms/IPO/IROutliner.cpp
1588

sounds reasonable then.

This revision is now accepted and ready to land.Sep 14 2020, 12:51 PM

Fixing an extra addition that fell out of refactoring causing overestimates in the number of instructions outlined.