[PATCH] D158018: [FunctionPropertiesAnalysis] Add operand type counts

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 20:40:33 PDT 2023


jdoerfert added inline comments.


================
Comment at: llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp:134
+        } else if (isa<Argument>(Operand)) {
+          ArgumentOperandCount += Direction;
         }
----------------
aidengrossman wrote:
> jdoerfert wrote:
> > The above should probably be a macro + a few invocations, also below. Anyway.
> 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.
```
#define CHECK(TYPE) if (isa<TYPE>(Operand)) { TYPE ## OperandCount += 1; continue; }
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158018/new/

https://reviews.llvm.org/D158018



More information about the llvm-commits mailing list