[all-commits] [llvm/llvm-project] a2af37: [SelectionDAG] Add space-optimized forms of OPC_Ch...

Wang Pengcheng via All-commits all-commits at lists.llvm.org
Thu Jan 11 19:38:18 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2af3742847899070322f15d6cefb7e9c738f40d
      https://github.com/llvm/llvm-project/commit/a2af3742847899070322f15d6cefb7e9c738f40d
  Author: Wang Pengcheng <wangpengcheng.pp at bytedance.com>
  Date:   2024-01-12 (Fri, 12 Jan 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAGISel.h
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    M llvm/test/TableGen/address-space-patfrags.td
    M llvm/test/TableGen/predicate-patfags.td
    M llvm/utils/TableGen/DAGISelMatcherEmitter.cpp

  Log Message:
  -----------
  [SelectionDAG] Add space-optimized forms of OPC_CheckPredicate (#77763)


We record the usage of each `Predicate` and sort them by usage.

For the top 8 `Predicate`s, we will emit a `PC_CheckPredicateN` to
save one byte.

Overall this reduces the llc binary size with all in-tree targets by
about 61K.

This is a recommit of 1a57927, which was reverted in bc98c31.

The CI failures occurred when doing expensive checks (with option
`LLVM_ENABLE_EXPENSIVE_CHECKS` being ON).

The key point here is that we need stable sorting result in the
test, but doing expensive checks uncovered the non-determinism of
`llvm::sort`. So `llvm::sort` is changed to `llvm::stable_sort`
in this revised patch.

And we use `llvm::MapVector` to keep insertion order.




More information about the All-commits mailing list