[PATCH] D124049: llvm-reduce: Introduce new scoring mechanism for MIR reductions

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 15:42:09 PDT 2022


arsenm created this revision.
arsenm added reviewers: markus, reames, lebedev.ri, qcolombet, MatzeB, fhahn, diegotf, aeubanks.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Many MIR reductions benefit from or require increasing the instruction
count. For example, unlike in the IR, you may need to insert a new
instruction to represent an undef. The current instruction reduction
pass works around this by sticking implicit defs on whatever
instruction happens to be first in the entry block block.

      

Other strategies I've applied manually include breaking instructions
with multiple defs into separate instructions, or breaking large register defs
into multiple subregister defs.

      

Make up a simple scoring system based on what I generally try to get
rid of first when manually reducing. Counts implicit defs as free
since reduction passes will be introducing them, although they
probably should count for something. It also might make more sense to
have a comparison the two functions, rather than having to compute a
contextless number. This isn't particularly well tested since overall
the MIR support isn't in a place where it


https://reviews.llvm.org/D124049

Files:
  llvm/tools/llvm-reduce/DeltaManager.cpp
  llvm/tools/llvm-reduce/ReducerWorkItem.cpp
  llvm/tools/llvm-reduce/ReducerWorkItem.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124049.423751.patch
Type: text/x-patch
Size: 4227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220419/d47e82b4/attachment.bin>


More information about the llvm-commits mailing list