Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/IPO/ModuleInliner.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | PreservedAnalyses ModuleInlinerPass::run(Module &M, | ||||
// the entire Module. With this module inliner, the inline order is not | // the entire Module. With this module inliner, the inline order is not | ||||
// limited to bottom-up order. More globally scope inline order is enabled. | // limited to bottom-up order. More globally scope inline order is enabled. | ||||
// Also, the inline deferral logic become unnecessary in this module inliner. | // Also, the inline deferral logic become unnecessary in this module inliner. | ||||
// It is possible to use other priority heuristics, e.g. profile-based | // It is possible to use other priority heuristics, e.g. profile-based | ||||
// heuristic. | // heuristic. | ||||
// | // | ||||
// TODO: Here is a huge amount duplicate code between the module inliner and | // TODO: Here is a huge amount duplicate code between the module inliner and | ||||
// the SCC inliner, which need some refactoring. | // the SCC inliner, which need some refactoring. | ||||
auto Calls = getInlineOrder(FAM, Params); | auto Calls = getInlineOrder(FAM, Params, MAM, M); | ||||
assert(Calls != nullptr && "Expected an initialized InlineOrder"); | assert(Calls != nullptr && "Expected an initialized InlineOrder"); | ||||
// Populate the initial list of calls in this module. | // Populate the initial list of calls in this module. | ||||
for (Function &F : M) { | for (Function &F : M) { | ||||
auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(F); | auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(F); | ||||
// We want to generally process call sites top-down in order for | // We want to generally process call sites top-down in order for | ||||
// simplifications stemming from replacing the call with the returned value | // simplifications stemming from replacing the call with the returned value | ||||
// after inlining to be visible to subsequent inlining decisions. | // after inlining to be visible to subsequent inlining decisions. | ||||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |