This is an archive of the discontinued LLVM Phabricator instance.

Add new function properties to FunctionPropertiesAnalysis
ClosedPublic

Authored by tarinduj on Jun 21 2020, 10:27 PM.

Details

Summary

Added LoadInstCount, StoreInstCount, MaxLoopDepth, LoopCount

Diff Detail

Event Timeline

tarinduj created this revision.Jun 21 2020, 10:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2020, 10:27 PM
tarinduj edited the summary of this revision. (Show Details)Jun 21 2020, 10:28 PM
mtrofin accepted this revision.Jun 22 2020, 8:14 AM

lgtm

This revision is now accepted and ready to land.Jun 22 2020, 8:14 AM
jdoerfert added inline comments.Jun 23 2020, 2:21 PM
llvm/lib/Analysis/ML/FunctionPropertiesAnalysis.cpp
27 ↗(On Diff #272327)

move down to line 53 please, short lifetimes are better :)

50 ↗(On Diff #272327)

Style: clang format the code please.

59 ↗(On Diff #272327)

This will not count all loops, only top-level loops. Unclear if we want either or both.
To get all you need to iterate over subloops. Probably you want a worklist approach.

Style: you should prefer range loops, e.g., for (Loop &L : LI) :)

tarinduj updated this revision to Diff 273242.EditedJun 25 2020, 12:52 AM

fixed formatting and renamed the LoopCount to TopLevelLoopCount.

tarinduj updated this revision to Diff 273627.Jun 26 2020, 2:11 AM
tarinduj marked 3 inline comments as done.

What happened to this patch?

tarinduj updated this revision to Diff 279833.Jul 22 2020, 8:24 AM
tarinduj marked an inline comment as done and an inline comment as not done.

[rebased] can someone upstream this? I do not have commit access.

This revision was automatically updated to reflect the committed changes.