[PATCH] D82283: Add new function properties to FunctionPropertiesAnalysis
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 23 14:32:15 PDT 2020
jdoerfert added inline comments.
================
Comment at: llvm/lib/Analysis/ML/FunctionPropertiesAnalysis.cpp:27
Uses = ((!F.hasLocalLinkage()) ? 1 : 0) + F.getNumUses();
+ int64_t LoopDepth;
----------------
move down to line 53 please, short lifetimes are better :)
================
Comment at: llvm/lib/Analysis/ML/FunctionPropertiesAnalysis.cpp:50
+ ++StoreInstCount;
+ }
}
----------------
Style: clang format the code please.
================
Comment at: llvm/lib/Analysis/ML/FunctionPropertiesAnalysis.cpp:59
+ ++LoopCount;
}
}
----------------
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)` :)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82283/new/
https://reviews.llvm.org/D82283
More information about the llvm-commits
mailing list