This is an archive of the discontinued LLVM Phabricator instance.

Use "willreturn" function attribute in isGuaranteedToTransferExecutionToSuccessor
ClosedPublic

Authored by uenoku on Jun 14 2019, 11:36 PM.

Details

Summary

"willreturn" function attribute guarantees a function to come back to the call site. Therefore, this attribute can be used in isGuaranteedToTransferExecutionToSuccessor.

Diff Detail

Repository
rL LLVM

Event Timeline

uenoku created this revision.Jun 14 2019, 11:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2019, 11:36 PM
jdoerfert added a comment.EditedJun 18 2019, 1:24 AM

Could you run this with the LLVM test suite [0]?
Do you see a difference in statistics, compile time and/or runtime?

If you don't have a computer to do so, let me know.

[0] http://llvm.org/docs/lnt/quickstart.html

jdoerfert added inline comments.Jun 18 2019, 1:27 AM
llvm/lib/Analysis/ValueTracking.cpp
4290 ↗(On Diff #204901)

Can you keep and modify the comment instead? There are other possibilities specified to improve this and/or the willreturn deduction.

uenoku updated this revision to Diff 205746.Jun 20 2019, 6:17 AM

Address comment.

Could you run this with the LLVM test suite [0]?
Do you see a difference in statistics, compile time and/or runtime?

If you don't have a computer to do so, let me know.

[0] http://llvm.org/docs/lnt/quickstart.html

I ran LLVM test suite but there was no significant difference in both execution time and runtime.
I want to see stats (NumFnWillReturn and etc.) but I don't know how to gather stats. I ran with TEST_SUITE_COLLECT_STATS=ON but I couldn't merge them. Can you tell me?

Could you run this with the LLVM test suite [0]?
Do you see a difference in statistics, compile time and/or runtime?

If you don't have a computer to do so, let me know.

[0] http://llvm.org/docs/lnt/quickstart.html

I ran LLVM test suite but there was no significant difference in both execution time and runtime.
I want to see stats (NumFnWillReturn and etc.) but I don't know how to gather stats. I ran with TEST_SUITE_COLLECT_STATS=ON but I couldn't merge them. Can you tell me?

I have scripts for that, I'll send them tomorrow, traveling today :(

jdoerfert accepted this revision.Jun 24 2019, 8:00 AM

I think this looks fine with one request for change: We "decided" to use enum attributes not string attributes (for willreturn and others).

To seem real improvements we might need to use this function more (we will soon in the Attributor). Just to make sure, you enabled the attributor and willreturn deduction for your test, correct?

This revision is now accepted and ready to land.Jun 24 2019, 8:00 AM

I think this looks fine with one request for change: We "decided" to use enum attributes not string attributes (for willreturn and others).

I'll fix it.

To seem real improvements we might need to use this function more (we will soon in the Attributor). Just to make sure, you enabled the attributor and willreturn deduction for your test, correct?

Yes. I confirmed in the report that willreturn is actually deduced.

uenoku updated this revision to Diff 206440.Jun 25 2019, 7:11 AM

Use enum attr.

This revision was automatically updated to reflect the committed changes.