This patch adds operand type counts to the detailed function properties
analysis. This is intended to enable more interesting and detailed
comparisons across different languages on specific metrics (like usage
of inline assembly or global values).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Planning on this and then probably a follow-up patch that adds more detailed statistics on phi nodes/branching and intrinsic usage, and then we should have a complete supserset of the statistics used in the literature (when combined with raw instruction counts).
Address some reviewer feedback.
- Denote integer and FP constant counts as operand counts.
- Add unknown operand count.
llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp | ||
---|---|---|
131 | Can you explicate a little bit more on how you envision the macro? A macro defining a list of features that macros can then be plugged into for doing things like printing? Generating the operand counts with a macro seems a little counterintuitive to me since I believe it would be hard to preserve the semantics of the if/else if/else chain. |
llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp | ||
---|---|---|
131 | #define CHECK(TYPE) if (isa<TYPE>(Operand)) { TYPE ## OperandCount += 1; continue; } |
Address reviewer feedback.
- Convert counting operands into a macro.
- Convert printing properties into a macro.
Integer/FP constant count makes little sense. Make them "Operand" counts as well.