[PATCH] D135539: llvm-reduce: Don't write out IR to score IR complexity

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 12:03:20 PDT 2022


aeubanks added a comment.

> note that there exist some flags where the presence of the flag is semantically simpler than the absence of the flag! for example, a noundef function parameter can make a function considerably easier to understand. that's one of the things I disliked about the previous "file size" approach. could you please add some TODO/FIXME items regarding that sort of thing?

IMO we should still be reducing away those attributes, if somebody submitted a test case I'd request irrelevant attributes to be removed



================
Comment at: llvm/tools/llvm-reduce/ReducerWorkItem.cpp:607
+  if (auto *C = dyn_cast<ConstantData>(V)) {
+    if (isa<UndefValue>(V) || isa<PoisonValue>(V))
+      return 0;
----------------
a poison value is an undef value, `isa<UndefValue>(V)` is enough


================
Comment at: llvm/tools/llvm-reduce/ReducerWorkItem.cpp:608
+    if (isa<UndefValue>(V) || isa<PoisonValue>(V))
+      return 0;
+    if (C->isNullValue())
----------------
I thought we wanted undef to be more expensive than 0?


================
Comment at: llvm/tools/llvm-reduce/ReducerWorkItem.cpp:644
+
+    for (const Instruction &I : BB) {
+      // TODO: Fast math flags?
----------------
do we want to add a flat cost to every instruction? (same with globals below)


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

https://reviews.llvm.org/D135539



More information about the llvm-commits mailing list