This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Run always inliner early in opt
ClosedPublic

Authored by rampitec on Mar 15 2017, 5:12 PM.

Details

Summary

We can mark functions to always inline early in the opt. Since we do not have
call support this early inlining creates opportunities for inter-procedural
optimizations which would not occur otherwise.

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Mar 15 2017, 5:12 PM
vpykhtin accepted this revision.Mar 16 2017, 3:45 AM

LGTM.

This revision is now accepted and ready to land.Mar 16 2017, 3:45 AM
This revision was automatically updated to reflect the committed changes.

I'm not sure we should immediately inline. Some level of simplification should occur on the individual functions first. Otherwise the code size is growing and increasing compile time everywhere. AlwaysInline doesn't immediately inline the function though. When after is the inliner actually run?

I'm not sure we should immediately inline. Some level of simplification should occur on the individual functions first. Otherwise the code size is growing and increasing compile time everywhere. AlwaysInline doesn't immediately inline the function though. When after is the inliner actually run?

Right, we do not immediately inline, we just immediately mark all functions for inlining. The inliner pass runs in its regular place in opt. Also module passes work after function passes, so function simplifications happen.