This is an archive of the discontinued LLVM Phabricator instance.

[FunctionAttrs] Annotate "willreturn" for intrinsics
ClosedPublic

Authored by uenoku on Jul 17 2019, 11:26 PM.

Details

Summary

In D62801, new function attribute willreturn was introduced. In short, a function with willreturn is guaranteed to come back to the call site(more precise definition is in LangRef).

In this patch, willreturn is annotated for LLVM intrinsics.

Diff Detail

Event Timeline

uenoku created this revision.Jul 17 2019, 11:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2019, 11:26 PM
uenoku retitled this revision from [FunctionAttrs] Annotate "willreturn for floating point and bit manipulation intrinsics. to [FunctionAttrs] Annotate "willreturn" for floating point and bit manipulation intrinsics..Jul 17 2019, 11:27 PM

More opportunities for willreturn.

llvm/include/llvm/IR/Intrinsics.td
456

willreturn (among other properties)

463

willreturn (among other properties)

507

willreturn (among other properties) for all three above.

585

willreturn (among other properties)

714

willreturn (among other properties)

757

willreturn (among other properties)

814

willreturn (among other properties) the 4 above

827

willreturn (among other properties) for the below intrinsics:
overflow, saturation, fix point, and combinations thereof

924

willreturn (among other properties) all 6 above

1024

willreturn (among other properties)

1033

willreturn (among other properties)

1044

willreturn (among other properties)

1090

willreturn (among other properties) for 8 above.

1142

willreturn (among other properties) the 3 above

1144

willreturn (among other properties) all reductions

uenoku updated this revision to Diff 211555.Jul 24 2019, 10:31 AM
uenoku retitled this revision from [FunctionAttrs] Annotate "willreturn" for floating point and bit manipulation intrinsics. to [FunctionAttrs] Annotate "willreturn" for intrinsics..
uenoku edited the summary of this revision. (Show Details)

Address comments.

jdoerfert added inline comments.Jul 24 2019, 12:48 PM
llvm/test/Transforms/Inline/noalias-calls.ll
37 ↗(On Diff #211555)

Why do the numbers above change but no willreturn is visible?

uenoku updated this revision to Diff 211756.EditedJul 25 2019, 7:56 AM

Address comment.

jdoerfert accepted this revision.Jul 26 2019, 5:04 AM

Assuming the tests pass, LGTM.

This revision is now accepted and ready to land.Jul 26 2019, 5:04 AM
uenoku updated this revision to Diff 212045.Jul 26 2019, 10:25 PM
uenoku retitled this revision from [FunctionAttrs] Annotate "willreturn" for intrinsics. to [FunctionAttrs] Annotate "willreturn" for intrinsics.

Minor fix.

This revision was automatically updated to reflect the committed changes.