[PATCH] D136560: llvm-reduce: Try to turn calls into something else

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 11:39:42 PDT 2022


dblaikie added inline comments.


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceOpcodes.cpp:98-101
+    if (IsStore && !DataArg)
+      DataArg = Arg;
+    else
+      return false;
----------------
Could invert this to reduce indentation?
```
if (!IsStore || DataArg)
  return false;
DataArg = Arg;
```
(or even split out the two conditions and have separate returns - keep each one simpler)


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceOpcodes.cpp:183
+    }
+  } else if (CB->getType()->isIntOrIntVectorTy()) {
+    switch (Arguments.size()) {
----------------
This amounts to an else-after-return, since the above switch is exhaustive - maybe skip the else? (& tag the end of the previous `if` with `llvm_unreachable` - same thing with this following `if`.


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

https://reviews.llvm.org/D136560



More information about the llvm-commits mailing list