This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Don't constrain callees with inlinehint from inlining on MaxBB check to prevent link failure
ClosedPublic

Authored by vpykhtin on Jun 14 2019, 8:54 AM.

Details

Summary

Function bodies marked inline in an opencl source are eliminated but MaxBB check may prevent inlining them leaving undefined references.

Event Timeline

vpykhtin created this revision.Jun 14 2019, 8:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2019, 8:54 AM
arsenm added inline comments.Jun 14 2019, 9:04 AM
llvm/lib/Target/AMDGPU/AMDGPUInline.cpp
221–222

inlinehint shouldn't be impacting correctness

The undefined references in the linker are OK. The user has to provide an external definition, or link against one. I don't think there is anything to do about this in LLVM.

vpykhtin updated this revision to Diff 204783.Jun 14 2019, 9:13 AM

updated description

rampitec accepted this revision.Jun 14 2019, 9:19 AM

LGTM. Not for a correctness, but for the sake of performance. We have been here before, if we restrict inlinehint functions for the compilation speed we are losing too much.
That said, it is also a reasonable w/a for specific issue, although we still need to contact ISV to fix their code.

This revision is now accepted and ready to land.Jun 14 2019, 9:19 AM
This revision was automatically updated to reflect the committed changes.