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

Repository
rL LLVM

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 ↗(On Diff #210486)

willreturn (among other properties)

463 ↗(On Diff #210486)

willreturn (among other properties)

507 ↗(On Diff #210486)

willreturn (among other properties) for all three above.

585 ↗(On Diff #210486)

willreturn (among other properties)

714 ↗(On Diff #210486)

willreturn (among other properties)

757 ↗(On Diff #210486)

willreturn (among other properties)

814 ↗(On Diff #210486)

willreturn (among other properties) the 4 above

827 ↗(On Diff #210486)

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

924 ↗(On Diff #210486)

willreturn (among other properties) all 6 above

1024 ↗(On Diff #210486)

willreturn (among other properties)

1033 ↗(On Diff #210486)

willreturn (among other properties)

1044 ↗(On Diff #210486)

willreturn (among other properties)

1090 ↗(On Diff #210486)

willreturn (among other properties) for 8 above.

1142 ↗(On Diff #210486)

willreturn (among other properties) the 3 above

1144 ↗(On Diff #210486)

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.