[PATCH] D110534: [llvm-reduce] Reduce metadata references.

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 11:25:23 PDT 2021


nickdesaulniers added inline comments.


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceMetadata.cpp:61
+      for (std::pair<unsigned, MDNode *> &MD : MDs)
+        if (!O.shouldKeep())
+          I.setMetadata(MD.first, NULL);
----------------
I was curious if we should switch the order of the for/if on `!O.shouldKeep()`, but if I'm reading this correctly, it seems that if `O.shouldKeep() == true`, then we do no work in this function and should just return early? Then we can remove all of the conditional checks on `!O.shouldKeep()`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110534



More information about the llvm-commits mailing list