[PATCH] D102452: [Remarks] Add analysis remarks for memset/memcpy/memmove lengths

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 18 17:54:00 PDT 2021


jroelofs marked an inline comment as done.
jroelofs added inline comments.


================
Comment at: llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h:48
+  /// \return true iff MemoryOpRemark can describe this instruction.
+  static bool describes(const Instruction *I);
+
----------------
thegameg wrote:
> Nit: I am not sure if `describe` is the best fit here. I used `inspect` in other places which is probably even worse now that I'm looking back. Maybe something like `canHandle`?
Other ideas: `appliesTo`, `understands`, `accepts`/`accept`. I don't have a strong preference.

Also, `s/inspect/visit/` seemed appropriate.


================
Comment at: llvm/lib/Transforms/Utils/MemoryOpRemark.cpp:31
+  // * volatile / atomic
+  if (auto *SI = dyn_cast<StoreInst>(I)) {
+    inspectStore(*SI);
----------------
xbolva00 wrote:
> Switch over instruction’s opcode?
I'm not sure that would simplify this much, since CallInst/IntrinsicInst aren't leaves.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102452



More information about the llvm-commits mailing list