This is an archive of the discontinued LLVM Phabricator instance.

[Inline] Avoid incompatible return attributes on deoptimize
ClosedPublic

Authored by anna on Aug 18 2023, 8:16 AM.

Details

Summary

When updating the return type of deoptimize call during inline, we need to drop incompatible return attributes.
This bug was exposed once we relaxed the contraint of adding the attributes through D156844. With that
change deoptimize (are not willreturn) will start having return attributes added to it.

Fix https://github.com/llvm/llvm-project/issues/64804.

Diff Detail

Event Timeline

anna created this revision.Aug 18 2023, 8:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2023, 8:16 AM
anna requested review of this revision.Aug 18 2023, 8:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2023, 8:16 AM
anna edited the summary of this revision. (Show Details)Aug 18 2023, 8:17 AM
anna edited the summary of this revision. (Show Details)
nikic added a comment.Aug 18 2023, 8:19 AM

Where is this update done? Shouldn't the code changing the return type drop incompatible attributes?

anna added a comment.Aug 18 2023, 8:21 AM

Where is this update done? Shouldn't the code changing the return type drop incompatible attributes?

yeah, that's better. Will update.

anna updated this revision to Diff 551536.Aug 18 2023, 8:58 AM

remove incompatible return attributes at the point we change the return type.

anna added a comment.Aug 18 2023, 9:00 AM

One thing to note though is we would need to future proof against incompatible types (whenever new return types are added), but that happens in the common API: AttributeFuncs::typeIncompatible.

anna edited the summary of this revision. (Show Details)Aug 18 2023, 9:01 AM
anna edited the summary of this revision. (Show Details)Aug 18 2023, 9:18 AM
nikic added inline comments.Aug 18 2023, 9:33 AM
llvm/lib/IR/Attributes.cpp
1999 ↗(On Diff #551536)

This change is unnecessary, this is all handled by !Ty->isPointerTy() above.

anna marked an inline comment as done.Aug 18 2023, 9:43 AM
anna added inline comments.
llvm/lib/IR/Attributes.cpp
1999 ↗(On Diff #551536)

good point.

anna updated this revision to Diff 551555.Aug 18 2023, 9:43 AM
anna marked an inline comment as done.

addressed review comment.

anna edited the summary of this revision. (Show Details)Aug 18 2023, 9:46 AM
This revision is now accepted and ready to land.Aug 18 2023, 9:46 AM
This revision was landed with ongoing or failed builds.Aug 18 2023, 9:56 AM
This revision was automatically updated to reflect the committed changes.