This is an archive of the discontinued LLVM Phabricator instance.

[Inliner] Add return attributes to callsites not marked `willreturn`/`nounwind`
ClosedPublic

Authored by goldstein.w.n on Aug 1 2023, 6:45 PM.

Details

Summary

The actual callsite we are adding to doesn't need to be
willreturn/nounwind, only ever instructions between the callsite
and the return.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Aug 1 2023, 6:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2023, 6:45 PM
goldstein.w.n requested review of this revision.Aug 1 2023, 6:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2023, 6:45 PM
nikic added inline comments.Aug 15 2023, 3:14 AM
llvm/lib/Transforms/Utils/InlineFunction.cpp
1340

Can't happen? You can assert this instead.

1399

Why do we need the unwind check? If the function unwinds, the attribute doesn't matter. If it doesn't unwind, then it will reach the nonnull.

goldstein.w.n marked 2 inline comments as done.Aug 15 2023, 3:33 PM

ALso do nounwind

goldstein.w.n retitled this revision from [Inliner] Add return attributes to callsites not marked `willreturn` to [Inliner] Add return attributes to callsites not marked `willreturn`/`nounwind`.Aug 15 2023, 3:47 PM
goldstein.w.n edited the summary of this revision. (Show Details)
nikic accepted this revision.Aug 16 2023, 3:15 AM

LGTM

This revision is now accepted and ready to land.Aug 16 2023, 3:15 AM
This revision was landed with ongoing or failed builds.Aug 16 2023, 8:42 PM
This revision was automatically updated to reflect the committed changes.