[PATCH] D73853: [llvm-reduce] add ReduceAttribute delta pass

George Burgess IV via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 2 15:02:33 PST 2020


george.burgess.iv added a comment.

Thanks for this! I'm always happy to see reduction tooling gain new powers :)

I've only touched these files in passing, so I'm probably not the best person to LGTM stamp. Just a few tiny nits.



================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp:1
+//===- ReduceGlobalVars.h - Specialized Delta Pass ------------------------===//
+//
----------------
nit: ReduceAttributes.cpp


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp:32
+
+static void extractAttributes(std::vector<llvm::Chunk> ChunksToKeep,
+                              llvm::Module *M) {
----------------
nit: looks like `const std::vector<T> &` would match the std::function signature in `runDeltaPass`, and save us a copy?


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp:34
+                              llvm::Module *M) {
+  int AttributeIndex = 0;
+  int ChunkIndex = 0;
----------------
nit: indices are generally `unsigned`


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp:48
+static int countAttributes(llvm::Module *M) {
+  unsigned TotalAttributeCount = 0;
+  for (const llvm::Function &F : M->getFunctionList())
----------------
nit: `int`, since this function is returning an `int`?


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.h:1
+//===- ReduceGlobalVars.h - Specialized Delta Pass ------------------------===//
+//
----------------
nit: ReduceAttributes.h


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73853





More information about the llvm-commits mailing list