This is an archive of the discontinued LLVM Phabricator instance.

[Transforms] Merge function attributes within InlineFunction (NFC)
ClosedPublic

Authored by kazu on Sep 17 2022, 4:47 PM.

Details

Summary

In the past, we've had a bug resulting in a compiler crash after
forgetting to merge function attributes (D105729).

This patch teaches InlineFunction to merge function attributes. This
way, we minimize the "time" when the IR is valid, but the function
attributes are not.

Diff Detail

Event Timeline

kazu created this revision.Sep 17 2022, 4:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2022, 4:47 PM
kazu requested review of this revision.Sep 17 2022, 4:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2022, 4:47 PM

Why not adding another parameter to InlineFunction method to specify whether attribute Merge is done?

kazu updated this revision to Diff 461044.Sep 17 2022, 10:23 PM

Taught InlineFunction to take an additional parameter.

kazu retitled this revision from [Transforms] Introduce InlineFunctionAndMergeAttributes (NFC) to [Transforms] Merge function attributes within InlineFunction (NFC).Sep 17 2022, 10:23 PM
kazu edited the summary of this revision. (Show Details)
kazu added a comment.Sep 17 2022, 10:29 PM

Why not adding another parameter to InlineFunction method to specify whether attribute Merge is done?

Thank you for the review. I've updated the patch. Please take a look.

One concern is that I have to pass several default parameters before I can specify the last parameter. Perhaps I could reorder the parameters to reduce the number default parameters to pass, but that should be left as a follow-up patch.

davidxl accepted this revision.Sep 17 2022, 10:33 PM

lgtm (The InlineFunction body is getting really big. Probably worth breaking it up in the future).

This revision is now accepted and ready to land.Sep 17 2022, 10:33 PM
kazu added a comment.Sep 17 2022, 11:12 PM

Thanks for the review!

lgtm (The InlineFunction body is getting really big. Probably worth breaking it up in the future).

Totally agreed.