This is an archive of the discontinued LLVM Phabricator instance.

[AFDO] Merge function attributes after inlining
ClosedPublic

Authored by kazu on Jul 9 2021, 1:33 PM.

Details

Summary

This patch teaches the sample profile loader to merge function
attributes after inlining functions.

Without this patch, the compiler could inline a function requiring the
512-bit vector width into its caller without merging function
attributes, triggering a failure during instruction selection.

Diff Detail

Event Timeline

kazu created this revision.Jul 9 2021, 1:33 PM
kazu requested review of this revision.Jul 9 2021, 1:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2021, 1:33 PM
wmi accepted this revision.Jul 9 2021, 1:46 PM

LGTM.

This revision is now accepted and ready to land.Jul 9 2021, 1:46 PM
wenlei added a comment.Jul 9 2021, 2:02 PM

I'm wondering whether it would be more future proof if AttributeFuncs::mergeAttributesForInlining is moved inside InlineFunction? Currently it's called right after InlineFunction for always inline, scc inline, and with this change sample loader inline too.

kazu added a comment.Jul 9 2021, 2:28 PM

I'm wondering whether it would be more future proof if AttributeFuncs::mergeAttributesForInlining is moved inside InlineFunction? Currently it's called right after InlineFunction for always inline, scc inline, and with this change sample loader inline too.

Great idea! Let me post a follow-up patch.

This revision was automatically updated to reflect the committed changes.