[PATCH] D111503: [llvm-reduce] Introduce operands-to-args pass.

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 15:58:21 PDT 2021


aeubanks added inline comments.


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp:21
+static bool canReplaceFunction(Function *F) {
+  return all_of(F->uses(), [F](Use &Op) {
+    if (auto *CI = dyn_cast<CallBase>(Op.getUser()))
----------------
unused `F`


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp:31
+  Type *Ty = Val->getType();
+  Val->dump();
+
----------------
leftover debugging?


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp:34
+  // Only replace operands that can be passed-by-value.
+  if (!Ty->isFirstClassType())
+    return false;
----------------
does `isa<Instruction> || isa<GlobalValue>` work, instead of these various checks?


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp:46
+  // Do not replace literals.
+  if (isa<ConstantData>(Val))
+    return false;
----------------
if this pass runs after the `operands` pass and the `operands` pass reduces a bunch of things to `undef`, doesn't that mostly defeat the purpose of this since we're skipping constants?
and the description mentions that the instruction reduction pass should hopefully clean up dead instructions, but that runs before this pass




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111503



More information about the llvm-commits mailing list