This is an archive of the discontinued LLVM Phabricator instance.

[AlwaysInliner] Call mergeAttributesForInlining after inlining
ClosedPublic

Authored by Carrot on Nov 13 2020, 10:51 AM.

Details

Summary

Like inlineCallIfPossible and InlinerPass, after inlining mergeAttributesForInlining should be called to merge callee's attributes to caller. But it is not called in AlwaysInliner, causes caller's attributes inconsistent with inlined code.

Attached test case demonstrates that attribute "min-legal-vector-width"="512" is not merged into caller without this patch, and it causes failure in SelectionDAG when lowering the inlined AVX512 intrinsic.

Diff Detail

Event Timeline

Carrot created this revision.Nov 13 2020, 10:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 13 2020, 10:51 AM
Carrot requested review of this revision.Nov 13 2020, 10:51 AM
echristo accepted this revision.Nov 13 2020, 11:12 AM
echristo added a subscriber: echristo.

I'd just seen that too. Thanks!

-eric

This revision is now accepted and ready to land.Nov 13 2020, 11:12 AM
aeubanks added a subscriber: aeubanks.

mtrofin proposed reusing much of InlinerPass for AlwaysInlinerPass in https://reviews.llvm.org/D86988 which would probably make this sort of bug much less likely.

Also probably a good idea :)

This revision was landed with ongoing or failed builds.Nov 13 2020, 12:02 PM
This revision was automatically updated to reflect the committed changes.