[all-commits] [llvm/llvm-project] 35264e: llvm-reduce: Introduce new scoring mechanism for M...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Sun May 1 15:26:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35264e7179693da9b1cc55c38370e9e894b1c456
      https://github.com/llvm/llvm-project/commit/35264e7179693da9b1cc55c38370e9e894b1c456
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2022-05-01 (Sun, 01 May 2022)

  Changed paths:
    M llvm/tools/llvm-reduce/DeltaManager.cpp
    M llvm/tools/llvm-reduce/ReducerWorkItem.cpp
    M llvm/tools/llvm-reduce/ReducerWorkItem.h

  Log Message:
  -----------
  llvm-reduce: Introduce new scoring mechanism for MIR reductions

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 is useful on the kinds of
testcases I want to throw at it.




More information about the All-commits mailing list