[PATCH] D111765: [llvm-reduce] Add reduction passes to reduce operands to undef/1/0

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 14 10:15:22 PDT 2021


Meinersbur added a comment.

Thanks for the patch, looks useful to me.

I have a concern in that this will repeatedly replace undef->one->zero->undef->... (if possible) when running the passes multiple times. Ideally, I'd run the reduction passes until no more changes can be applied. This can either be done by comparing the Module before & after a round, or checking whether no pass has applied any chunk while still being interesting. In my experimental setup I am using textual comparison of the dumped Module, so this would not a problem, but think we'd want the latter approach for llvm-reduce.



================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceOperands.cpp:24-26
+        if (Reduced && !O.shouldKeep()) {
+          Op.set(Reduced);
         }
----------------



================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceOperands.cpp:38-40
+        if (ReduceValue(Op)) {
           Count++;
         }
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111765



More information about the llvm-commits mailing list